Roselle,
you are right with the bug you reported. I fixed it by adding
DefaultConfiguration.reset() to method test() of class
AbstractSupergeneTest.
The call to reset is necessary because in the loop of the test function the
config is built from scratch each loop, and for building it freshly it needs
to be told that it is intended rebuilding the confi (which normally is not
allowed).
Changed were checked in to CVS.
Best
Klaus
> -----Original Message-----
> From: P T [mailto:roselle63@...]
> Sent: Saturday, August 19, 2006 12:14 AM
> To: jgap-users@...
> Subject: [jgap-users] Jgap 3.0RC2 - supergene example error
>
>
> Hello,
>
> I just downloaded the jgap 3.0RC2 and tried to run the
> supergene example and got the following error:
>
> EXCANGING 20
>
> The best solution has a fitness value of 197.0 It contained
> the following:
> 0 quarters.
> 2 dimes.
> 0 nickels.
> 0 pennies.
> For a total of 20 cents in 2 coins.
> err 0
> ---------------
> EXCANGING 21
> java.lang.RuntimeException: Fitness evaluator has already
> been set differently.
> Maybe org.jgap.DefaultFitnessEvaluator.hashCode() is not
> implemented accordingly.
> at
> org.jgap.Configuration.checkProperty(Configuration.java:458)
> at
> org.jgap.Configuration.setFitnessEvaluator(Configuration.java:1165)
> at
> org.jgap.impl.DefaultConfiguration.<init>(DefaultConfiguration
> .java:53)
> at
> examples.supergene.WithoutSupergeneSample.makeChangeForAmount(
> WithoutSupergeneSample.java:45)
> at
> examples.supergene.AbstractSupergeneTest.test(AbstractSupergen
> eTest.java:187)
>
>
> I read in the documentation that the Configuration
> will be locked by the Genotype and its properties
> (such as FitnessFunction or FitnessEvaluator)can not
> be changed after that. So, what is the solution for
> this problem?
>
> Thanks
> Roselle
--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.405 / Virus Database: 268.11.3/423 - Release Date: 18.08.2006
|