Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

gal::IntChromosome Class Reference

class IntChromosome implements a Chromosome<int> that represents a natural number. More...

#include <IntChromosome.h>

Inheritance diagram for gal::IntChromosome:

[legend]
List of all members.

Public Member Functions

 IntChromosome (int length)
 Constructs a new IntChromosome and initialises it randomly.
int const getValue ()
 Returns the decimal value that the bitstring represents.
std::string const getValueText ()
 Returns a string representation of the decimal value.

Detailed Description

class IntChromosome implements a Chromosome<int> that represents a natural number.

Bitstring is interpreted as a reversed binary number.


Constructor & Destructor Documentation

gal::IntChromosome::IntChromosome int  length  )  [inline]
 

Constructs a new IntChromosome and initialises it randomly.

Do not set the length too large (<=32 generally)

Parameters:
length Length of the bitstring.


Member Function Documentation

int const gal::IntChromosome::getValue  )  [inline, virtual]
 

Returns the decimal value that the bitstring represents.

Reimplemented from gal::Chromosome< int >.

std::string const gal::IntChromosome::getValueText  )  [inline, virtual]
 

Returns a string representation of the decimal value.

Reimplemented from gal::Chromosome< int >.


The documentation for this class was generated from the following file:
Generated on Tue Oct 20 12:59:24 2009 for LabSci GALib optimisation by genetic algorithms, student version by  doxygen 1.3.9.1