[galib] Help using GALib: customising mutation operator

Christophe Philemotte cphilemo at iridia.ulb.ac.be
Tue Jul 19 04:53:54 EDT 2005


Hi,

Following the typedef int (*GAGenome::Mutator)(GAGenome &, float), you can
write your own mutation operator. To apply to a given genome, you have
just to use the method GAGenome::Mutator mutator(GAGenome::Mutator func).
In your case, that gives something like this:
int swap(GAGenome &g, float pmut) { ... }

int main() {
  ...
  //g is your GARealGenome
  g.mutator(swap);
  ...
}

you can find all these in the galib API:
http://lancet.mit.edu/galib-2.4/API.html
regards

christophe

> hey,
>
> I'm new to galib and c++ so have a basic question to ask.
> I am using real genomes and want to write my own mutation operator
> called "swap". so where do i place the code for this mutation operator
> n how do i set the genome class to use it?
>
> sincerely,
> Aditi
>
> _______________________________________________
> galib mailing list
> galib at mit.edu
> http://mailman.mit.edu/mailman/listinfo/galib





More information about the galib mailing list