Next: Extending views
Up: How to use views
Previous: Constructors
Trying to downsize the interface of this class as much as
possible, only two methods are used, one to access the i-th gene in
a chromosome, and other to know the size of the chromosome, if it is
not known in advance (for instance, if variable-size chromosomes are
used).
- virtual Type operator () (const chrom* _chrom, unsigned _idx
): with a pointer-to-chromosome as the first argument, and an index
as second, returns the gene that starts at index and goes on for
several bits as the type with which the template has been initialized.
- virtual unsigned size(const chrom* _chrom) const:
implemented as an inline function, returns the ``number of genes'',
which is roughly defined as the index of the last gene plus one. It
will be fixed in fixed-size views, but will vary in other kind of
views.
J. J. Merelo
jmerelo@kal-el.ugr.es![[E-MAIL]](/common/mail.gif)
Equipo GeNeura -- GeNeura Team
Departamento de Electrónica y Tecnología de los Computadores
Universidad de Granada Granada (Espaņa)
Phone: +34-58-243162; Fax: +34-58-243230