java.lang.RuntimeException: applyMutation may not be called for a CompositeGene.

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

java.lang.RuntimeException: applyMutation may not be called for a CompositeGene.

Emmanouil Kardaris
Hello everyone,

I would be really pleased if anyone knows how is possible to avoid
this exception:

Exception in thread "main" java.lang.RuntimeException: applyMutation
may not be called for a CompositeGene. Call this method for each gene
contained in the CompositeGene.
    at org.jgap.impl.CompositeGene.applyMutation(CompositeGene.java:628)
    at org.jgap.impl.MutationOperator.mutateGene(MutationOperator.java:266)
    at org.jgap.impl.MutationOperator.operate(MutationOperator.java:230)
    at org.jgap.BreederBase.applyGeneticOperators(BreederBase.java:141)
    at org.jgap.impl.GABreeder.evolve(GABreeder.java:135)
    at org.jgap.Genotype.evolve(Genotype.java:233)
    at org.jgap.Genotype.evolve(Genotype.java:250)

I actually have a composite gene chromosome and when I try to evolve I
get the exception.

Thank you,
Emmanouil.

------------------------------------------------------------------------------
_______________________________________________
jgap-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jgap-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: java.lang.RuntimeException: applyMutation may not be called for a CompositeGene.

Jakub Siberski
In your Breeder  override applyGeneticOperators and add code that can pick concrete Gene parts of the CompositeGene and apply Mutation accordingly.

Or or in your CompositeGene override applyMuatation so that it can pick concrete Gene parts of the CompositeGene and apply Mutation accordingly


Somewhere you have to have logic that can Call this (applyMutation) method for each gene contained in the CompositeGene.


On Mon, Oct 27, 2014 at 7:38 PM, Emmanouil Kardaris <[hidden email]> wrote:
Hello everyone,

I would be really pleased if anyone knows how is possible to avoid
this exception:

Exception in thread "main" java.lang.RuntimeException: applyMutation
may not be called for a CompositeGene. Call this method for each gene
contained in the CompositeGene.
    at org.jgap.impl.CompositeGene.applyMutation(CompositeGene.java:628)
    at org.jgap.impl.MutationOperator.mutateGene(MutationOperator.java:266)
    at org.jgap.impl.MutationOperator.operate(MutationOperator.java:230)
    at org.jgap.BreederBase.applyGeneticOperators(BreederBase.java:141)
    at org.jgap.impl.GABreeder.evolve(GABreeder.java:135)
    at org.jgap.Genotype.evolve(Genotype.java:233)
    at org.jgap.Genotype.evolve(Genotype.java:250)

I actually have a composite gene chromosome and when I try to evolve I
get the exception.

Thank you,
Emmanouil.

------------------------------------------------------------------------------
_______________________________________________
jgap-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jgap-users



--
Jakub

------------------------------------------------------------------------------

_______________________________________________
jgap-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jgap-users
Loading...