[galib] Discard solutions
mika
supern3t at gmail.com
Sun Oct 4 03:53:44 EDT 2009
Hello everybody,
I'm trying to use galib and genetic algorithms for the first time, so
I have a simple question for you!
There is a way to reject a solution in the objective function?
I'll try to be more understandable: this is the pseudocode describing
what I want to do:
float objective(GAGenome &g)
{
GARealGenome genome = (GARealGenome&)g;
if(!possibleSolution(genome.gene(0), genome.gene(1))
DISCARD GENOME
else
return genome.gene(0)+genome.gene(1);
}
where possibleSolution() is my function that cheks if the solution is
admisible or not.
So, you could say "why doesn't you give a score=-999 when
possibleSolution returns false?". Because I've seen that it produces
an early stop of the search returning a solution with score -999!!
Thank you in advance
More information about the galib
mailing list