Mime-Version: |
1.0 (Apple Message framework v746.2) |
Sender: |
|
Date: |
Thu, 8 Dec 2005 10:08:59 -0800 |
Reply-To: |
|
Subject: |
|
Content-Transfer-Encoding: |
7bit |
Content-Type: |
text/plain; charset=US-ASCII; delsp=yes; format=flowed |
From: |
|
Comments: |
|
Parts/Attachments: |
|
|
(Excuse the newbiness, pointers to FAQs gladly accepted, etc.)
I'm evolving LongVectorIndividuals. I'd like to use the entire range
of the long type, because it's secretly a packed binary
representation of what I'm breeding.
Is there a way to not specify min-gene and max-gene? I tried leaving
them out:
pop.subpop.0.species = ec.vector.IntegerVectorSpecies
pop.subpop.0.species.ind = ec.vector.LongVectorIndividual
# Other setup details omitted
and got this:
Initializing Generation 0
FATAL ERROR:
IntegerVectorSpecies must have a default min-gene which is <= the
default max-gene
PARAMETER: pop.subpop.0.species.max-gene
ALSO: vector.species.max-gene
I also tried including the max and min value for a long:
pop.subpop.0.species.min-gene = -9223372036854775808
pop.subpop.0.species.max-gene = 9223372036854775807
Result:
Initializing Generation 0
Exception in thread "main" java.lang.IllegalArgumentException: n must
be positive
at ec.util.MersenneTwisterFast.nextLong(MersenneTwisterFast.java:711)
at ec.vector.LongVectorIndividual.reset(LongVectorIndividual.java:170)
at ec.vector.VectorSpecies.newIndividual(VectorSpecies.java:151)
at ec.Subpopulation.populate(Subpopulation.java:202)
at ec.Population.populate(Population.java:104)
at ec.simple.SimpleInitializer.initialPopulation
(SimpleInitializer.java:39)
at ec.simple.SimpleEvolutionState.startFresh
(SimpleEvolutionState.java:47)
at ec.Evolve.startFresh(Evolve.java:320)
at ec.Evolve.main(Evolve.java:468)
This happens, no doubt, because LongVectorIndividual.reset() tries
something to the effect of (max-gene - min-gene), resulting in an
overflow.
I was able to work around the problem by subclassing
LongVectorIndividual, overriding reset() and defaultMutate().
Is there a better way?
Thanks,
Peter Drake
Assistant Professor of Computer Science
Lewis & Clark College
http://www.lclark.edu/~drake/
|
|
|