JGAP, made a ByteGene but it won't run, any help?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

JGAP, made a ByteGene but it won't run, any help?

Fukushuusha
Hello people,

First of all hi, and thanks in advance for any answering my questions that might occur in this thread. I recently started using JGAP for a project and find it fascinating. I wanted to use a ByteGene for this project which did not already exist so I thought I could make one by simply adjusting the IntegerGene.
   Unfortunately I get this runtime exception when I try to do this :

[quote]Exception in thread "main" org.jgap.InvalidConfigurationException: The sample Gene at gene position (locus) 0 does not appear to have a working equals() or compareTo() method.
It could also be that you forgot to implement method newGene() in your Gene implementation.
When tested, the method returned false when comparing the sample gene with a gene of the same type and possessing the same value (allele).
        at org.jgap.Configuration.verifyStateIsValid(Configuration.java:1142)
        at org.jgap.Configuration.lockSettings(Configuration.java:1048)
        at org.jgap.Genotype.randomInitialGenotype(Genotype.java:293)
        at kicurriculum.Kicurriculum.execute(Kicurriculum.java:50)
        at kicurriculum.Kicurriculum.main(Kicurriculum.java:90)[/quote]

Any ideas what might it be? If you wanna see the ByteGene code in order to make a better judgement just say so. I just thought that i might be a stupid mistake of mine so I did not include byteGene at first in order to save space.
Reply | Threaded
Open this post in threaded view
|

Re: JGAP, made a ByteGene but it won't run, any help?

Florian Hafner
Hey there,

Klaus will likely have a better answer based on your error, but based on your description, I am just wondering why you chose the IntegerGene class as your basis for a ByteGene. I assume that your Bytes have values of 0 and 1 only, which seems to be a natural implementation of the BooleanGene.

Cheers,
Florian

On Dec 14, 2007 4:11 AM, Fukushuusha <[hidden email]> wrote:

Hello people,

First of all hi, and thanks in advance for any answering my questions that
might occur in this thread. I recently started using JGAP for a project and
find it fascinating. I wanted to use a ByteGene for this project which did
not already exist so I thought I could make one by simply adjusting the
IntegerGene.
  Unfortunately I get this runtime exception when I try to do this :

[quote]Exception in thread "main" org.jgap.InvalidConfigurationException :
The sample Gene at gene position (locus) 0 does not appear to have a working
equals() or compareTo() method.
It could also be that you forgot to implement method newGene() in your Gene
implementation.
When tested, the method returned false when comparing the sample gene with a
gene of the same type and possessing the same value (allele).
       at
org.jgap.Configuration.verifyStateIsValid(Configuration.java:1142)
       at org.jgap.Configuration.lockSettings(Configuration.java:1048)
       at org.jgap.Genotype.randomInitialGenotype(Genotype.java:293)
       at kicurriculum.Kicurriculum.execute(Kicurriculum.java:50)
       at kicurriculum.Kicurriculum.main(Kicurriculum.java:90)[/quote]

Any ideas what might it be? If you wanna see the ByteGene code in order to
make a better judgement just say so. I just thought that i might be a stupid
mistake of mine so I did not include byteGene at first in order to save
space.

--
View this message in context: http://www.nabble.com/JGAP%2C-made-a-ByteGene-but-it-won%27t-run%2C-any-help--tp14332349p14332349.html
Sent from the jgap-users mailing list archive at Nabble.com.


-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
jgap-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jgap-users


-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
jgap-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jgap-users
Reply | Threaded
Open this post in threaded view
|

Re: JGAP, made a ByteGene but it won't run, any help?

Klaus Meffert-5
In reply to this post by Fukushuusha
Fukushuusha,

going into the same direction as Florian, I suggest using an existing gene class (either IntegerGene or BooleanGene, depending on the value range you need). Regarding your own implementation it would help if you could send it for inspection. It seems that some methods are not adapted properly.

Best

Klaus
----- original Nachricht --------

Betreff: [jgap-users]  JGAP, made a ByteGene but it won't run, any help?
Gesendet: Fr, 14. Dez 2007
Von: Fukushuusha<[hidden email]>

>
> Hello people,
>
> First of all hi, and thanks in advance for any answering my questions that
> might occur in this thread. I recently started using JGAP for a project and
> find it fascinating. I wanted to use a ByteGene for this project which did
> not already exist so I thought I could make one by simply adjusting the
> IntegerGene.
>    Unfortunately I get this runtime exception when I try to do this :
>
> [quote]Exception in thread "main" org.jgap.InvalidConfigurationException:
> The sample Gene at gene position (locus) 0 does not appear to have a
> working
> equals() or compareTo() method.
> It could also be that you forgot to implement method newGene() in your Gene
> implementation.
> When tested, the method returned false when comparing the sample gene with
> a
> gene of the same type and possessing the same value (allele).
>         at
> org.jgap.Configuration.verifyStateIsValid(Configuration.java:1142)
>         at org.jgap.Configuration.lockSettings(Configuration.java:1048)
>         at org.jgap.Genotype.randomInitialGenotype(Genotype.java:293)
>         at kicurriculum.Kicurriculum.execute(Kicurriculum.java:50)
>         at kicurriculum.Kicurriculum.main(Kicurriculum.java:90)[/quote]
>
> Any ideas what might it be? If you wanna see the ByteGene code in order to
> make a better judgement just say so. I just thought that i might be a
> stupid
> mistake of mine so I did not include byteGene at first in order to save
> space.
>

-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
jgap-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jgap-users