[galib] Resp.: Customize the Objective function

Fábio Roberto Teodoro fr.teodoro at gmail.com
Fri Mar 27 15:47:09 EDT 2009

yes, there is a member field variable in the Genome class that is of
type void*, so you can point it to anywhere use the object pointed by
it in your objective function.

something like this:
float Objective(GAGenome& g)
MyObject1* obj1 = (MyObject1*)g.data;

Obs.: maybe the member variable name isn't quite correct, but its
something like that.

Hope this help

2009/3/27, Michele Conconi <michele.conconi at unibo.it>:
> Hi, I'm new of galib and a beginner of c++.
> In my program, I would need to pass some objects to the objective
> function, but I do not know how to do this. It should be something like that
> float Objective(GAGenome& g, MyObject1 *obj1, MyObject2 * obj2)
> Is it possible?
> Thank you in advance
> --
> * Eng. Michele Conconi*
> Ph.D. student
> DIEM - Dept. of Mechanical Engineering
> Alma Mater Studiorum - University of Bologna
> Viale Risorgimento 2, 40136, Bologna, Italy
> Email: michele.conconi at unibo.it
> Website: http://www.diem.ing.unibo.it/grab
> Office: (+39) 051 20 93451
> Mobile: (+39) 329 0287996
> Questo messaggio contiene informazioni riservate e confidenziali.
> Se il lettore non fosse il destinatario del messaggio, inoltrato e
> ricevuto per errore,
> il testo dovrà essere immediatamente cancellato dal computer del ricevente.
> E' assolutamente proibita qualunque circolazione, disseminazione o
> copia del messaggio spedito e/o ricevuto per errore.
> This message may contain legally privileged or confidential information.
> If the reader is not the intended recipient, you received this message
> in error
> and it should therefore be deleted from your computer at once.
> Any dissemination, distribution and copying of a message
> mistakenly sent or received is strictly forbidden.
> _______________________________________________
> galib mailing list
> galib at mit.edu
> http://mailman.mit.edu/mailman/listinfo/galib

Fábio Roberto Teodoro

More information about the galib mailing list