next up previous
Next: Extending views Up: Doing GAs with Previous: Population

Extending GAGS

 

Both genetic operators and view use a letter/envelope structure (see [Coplien, 1994]); different ``letter'' and thus, different implementations are used for different views and genetic operators, but the client-programmer need not worry about it, since all letters can be accessed using envelopes, that is, genOp and view. This is done mainly because views and genOps are friends of chromosomes, and since friendship is not inherited, only view base objects can access the chromosome internal representation (i.e. the bitstring). This causes a problem with templates, since in gnu's g++, there is no such a thing as frienship-to-template. Currently, only templates instantiated with float and char can be used; to use any other, it must be added to the friendship list at the beginning of chrom.

This letter/envelope structure, at the same time, makes easier to program new objects, since their interface is quite simplified, and most, if not all, protected functions needed are already defined.





J.J. Merelo Guervos
Fri Aug 22 12:58:28 MDT 1997