#49 CompositeGene bug

closed-wont-fix
nobody
None
5
2009-02-04
2008-06-22
Luis Garcia
No

I et this bug when working with a composite bug that has Double and Integer genes in it.
Exception in thread "main" java.lang.ClassCastException: java.lang.Double cannot be cast to java.lang.Integer
at org.jgap.impl.IntegerGene.mapValueToWithinBounds(IntegerGene.java:294)
at org.jgap.impl.NumberGene.setAllele(NumberGene.java:148)
at org.jgap.impl.CrossoverOperator.doCrossover(CrossoverOperator.java:415)
at org.jgap.impl.CrossoverOperator.operate(CrossoverOperator.java:376)
at org.jgap.BreederBase.applyGeneticOperators(BreederBase.java:109)
at org.jgap.impl.GABreeder.evolve(GABreeder.java:82)
at org.jgap.Genotype.evolve(Genotype.java:225)
at org.jgap.Genotype.evolve(Genotype.java:242)

Discussion

  • Klaus

    Klaus - 2009-02-04

    You cannot use the standard crossover operator with CompositeGenes that hold differently typed genes.
    So this is not an error. There simply is no crossover possible in your case. You have to write an operator of your own (e.g. with the current one as a template). If you need help, please ask in the list.

     
  • Klaus

    Klaus - 2009-02-04
    • status: open --> closed-wont-fix
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks