objective function: use of info not in genome, and dependence on other genomes

Filip Ginter fginter at volny.cz
Tue Nov 7 04:39:19 EST 2000


Hi,

I think you should use population evaluator rather than genome
evaluator. Like this:

ga.population().evaluator(popEvaluator); //ga is genetic algorithm

and then the popEvaluator function would look like this:

void popEvaluator(GAPopulation & p) {

...let the individuals fight here
...some data from outside you could pass as global variables

...directly assign fitness of all individuals in the population

for example something like:

for (int i=0; i<p.size(); i++) {
  p.individual(i).score(_whatever value you compute_);
 //Perhaps you yet would have to set the _evaluated flag to gaTrue
}


return;

}

The popEvaluator() function is called by GALib every time new population
is created. So, I think it's the right place for you, because in this
function, you have all the individuals together at one place.

I don't know what it is "info not in genome". I mean what data it is, how
you obtain it, etc... But I guess you would have to store it in some
global arrays, so that it is accessible in your population evaluator. But
perhaps someone has a better idea. :-)

Hope this helps...

       Filip

>------------------------------------------<
Filip GINTER
Czech republic, Europe, Earth, Solar system, Milky Way, Universe
fginter at volny.cz
http://www.volny.cz/fginter





More information about the galib mailing list