[galib] Return value
Somnath Bhattacharjee
sn.bhattacharjee at yahoo.co.in
Sun Dec 23 00:55:07 EST 2007
Hi everyone,
I'm new in GA. I made a maximization problem. but what I saw in the examples of the GAlib246 from mit.edu. is that only the best genomes are being printed , not the maximum or minimum value of the objective function.
1.how can I print the best maximum value for the objective function.
2. where the value is being returned from objective function?
3.how can I add the values of two or three objective functions in an another objective function and then print the maximum or minimum value of that Obj function.
cout << "the ga generated:\n" << ga.statistics().bestIndividual() << "\n";
float
D1(GAGenome & c)
{
GABin2DecGenome & genome = (GABin2DecGenome &)c;
float value=0;
value += genome.phenotype(0) * genome.phenotype(0);
value += genome.phenotype(1) * genome.phenotype(1);
value += genome.phenotype(2) * genome.phenotype(2);
return(value);
}
Thanks
Happy New Year in Advance
Somnath
5, 50, 500, 5000 - Store N number of mails in your inbox. Go to http://help.yahoo.com/l/in/yahoo/mail/yahoomail/tools/tools-08.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.mit.edu/pipermail/galib/attachments/20071223/e471ad6c/attachment.htm
More information about the galib
mailing list