Is there an easy way to calculate the fitness based on the seed population?

20 views
Skip to first unread message

Kevin Xu

unread,
Jul 17, 2014, 11:25:44 PM7/17/14
to watch...@googlegroups.com
Hello,

I implemented the interface FitnessEvaluator and override the method public double getFitness(Measure candidate, List<? extends Measure> population) to calculate the fitness.

But this method has only two parameters, the candidate itself and the entire population. My fitness calculation also need the data in seed population. Is there an easy way to pass in the seed population? If not I suggest to think about it in the later version.

Thanks,
Kevin

Klaas Hölscher

unread,
Jul 22, 2014, 3:36:01 PM7/22/14
to watch...@googlegroups.com
Hey Kevin,

not sure if i get your question right, but maybe this helps Your initial population can be created by the factory
with 
 List<T> generateInitialPopulation(int populationSize, Random rng) 

you could then pass the initial population List<T> as seed as a member to your implemented evaluator and start the evolutionEngine with 
 Tevolve(int populationSize, int eliteCount, Collection<T> seedCandidates,TerminationCondition... conditions) 

No need to pass the same argument for every evolve() call this way.

regards,
Klaas

--
You received this message because you are subscribed to the Google Groups "Watchmaker Framework for Evolutionary Computation" group.
To unsubscribe from this group and stop receiving emails from it, send an email to watchmaker+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages