[galib] Does GAlib support a predefined population as initial population?
blazefirst
blazefirst at freemail.hu
Sun Feb 28 03:39:27 EST 2010
After initializing and before evolving the population, you can modify
your genomes to
contain the predefined information you were referring to.
The other way of doing this is writing you own initializer function:
GAPopulation calls each individual's initializer function.
void
GAPopulation::DefaultInitializer(GAPopulation & p){
for(int i=0; i<p.size(); i++)
p.individual(i).initialize();
}
A function, which is referred by the Initializer pointer (GAGenome.h:)
typedef void (*Initializer)(GAGenome &);
The initializer is usually configured in the constructor of the genomes.
For example, in GARealGenome:
initializer(DEFAULT_REAL_INITIALIZER);
Check out ex11.C in the examples directory for the customization of the
genome's initializer function.
genome.initializer(ListInitializer);
So, there is a way, but you have to implement it.
Regards,
Balazs
2010.02.27. 18:56 kelteze'ssel, vishnu prathish i'rta:
> Is there any way to give a predefined population as initial
> population? I could see only a random number population as initial ones.
>
> --
> Regards,
> Vishnu Prathish
>
>
> _______________________________________________
> galib mailing list
> galib at mit.edu
> http://mailman.mit.edu/mailman/listinfo/galib
>
>
>
> __________ Information from ESET NOD32 Antivirus, version of virus signature database 4901 (20100227) __________
>
> The message was checked by ESET NOD32 Antivirus.
>
> http://www.eset.com
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.mit.edu/pipermail/galib/attachments/20100228/6e28f7c4/attachment.htm
More information about the galib
mailing list