[galib] population based evaluation

Marc Fischer spam at totallyawesome.at
Sat Sep 22 08:09:15 EDT 2012


Hi.

What you will need to do is to implement a PopulationEvaluator. This is the function that actually calls the Objective functions of the individual Genomes. In the original galib code this is simply a for loop calling the Objective function of each individual.
(as you can see here: http://lancet.mit.edu/galib-2.4/Extensions.html#pop_evaluation)

So what you would like to implement, would roughly look like (in addition to implementing a very simple Objective function):

void PopEvaluator(GAPopulation & p){
  //do stuff here
}
//in some other function
FooGenome g();
GApopulation pop(g);
pop.evaluator(PopEvaluator);
GASimpleGA ga(pop);
However in GASimpleGA, there seems to be a problem, so that when a new Population is initialized, it does not copy the evaluator from the old population to the new one. (look at the step() function) This is why suggest, deriving your own GASimpleGA or GAPopulation (where you override the copying behavior).
I like to copy the step function and add the line:
pop->evaluator(oldPop->evaluator()); //I hope I remembered it correctly, can't test it or access my code atm
Best,
Marc


On Sep 22, 2012, at 12:38 PM, Alin Ionascu <alin1x at live.com> wrote:

> Hello everyone,
> 
> What I'm tring to do is the following. I want to do a population based 
> evaluation. Is there any way to find out for which individual the 
> Objective function is called (not the value of the individual but it's 
> position in the population -> is it the first one? or the 3rd one).
> 
> Is there a way to work without the Objective function (it was sugessted 
> somewhere in the code -> GAGenome.h) here is the section:
> If there is no objective function, then simply return the score. This
>   allows us to use population-based evaluation methods (where the 
> population
>   method sets the score of each genome).
> Does someone have an example or a hint on how to do this ? Where shlould 
> I return the score and how does the command look like?
> 
> Thank you,
> 
> Alin
> _______________________________________________
> galib mailing list
> galib at mit.edu
> http://mailman.mit.edu/mailman/listinfo/galib

PopEvaluator

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.mit.edu/pipermail/galib/attachments/20120922/d8503912/attachment.htm


More information about the galib mailing list