Qualia  0.2
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
BinaryChromosome Class Reference

#include <BinaryChromosome.h>

Inheritance diagram for BinaryChromosome:
Inheritance graph
[legend]
Collaboration diagram for BinaryChromosome:
Collaboration graph
[legend]

Public Member Functions

 BinaryChromosome (BinaryChromosomeProperties *info)
 
virtual ~BinaryChromosome ()
 
virtual void copyFrom (const Chromosome &c)
 
virtual void init ()
 
virtual void mutate (float p)
 
virtual bool equals (const Chromosome &c) const
 
uint64_t getGeneValue (int gene) const
 Returns the value of gene #gene# as a 64-bit integer. More...
 
void setGeneValue (int gene, uint64_t value)
 Sets the value of gene #gene# to #value# (max. 64-bit). More...
 
- Public Member Functions inherited from Chromosome
 Chromosome ()
 
virtual ~Chromosome ()
 

Static Public Member Functions

static void initializeRandom (Chromosome &chromosome)
 
static void mutateFlip (Chromosome &chromosome, float probability)
 
static void crossoverOnePoint (const Chromosome &parent1, const Chromosome &parent2, Chromosome *offspring1, Chromosome *offspring2)
 
static void crossoverTwoPoint (const Chromosome &parent1, const Chromosome &parent2, Chromosome *offspring1, Chromosome *offspring2)
 
static void _codeCrossoverOnePoint (uint8_t *offspringCode, const uint8_t *parentCode1, const uint8_t *parentCode2, unsigned int point, unsigned int codeSize)
 
static void _codeCrossoverTwoPoint (uint8_t *offspringCode, const uint8_t *parentCode1, const uint8_t *parentCode2, unsigned int point1, unsigned int point2, unsigned int codeSize)
 

Public Attributes

BinaryChromosomePropertiesinfo
 
uint8_t * code
 

Constructor & Destructor Documentation

BinaryChromosome::BinaryChromosome ( BinaryChromosomeProperties info)
BinaryChromosome::~BinaryChromosome ( )
virtual

Member Function Documentation

void BinaryChromosome::_codeCrossoverOnePoint ( uint8_t *  offspringCode,
const uint8_t *  parentCode1,
const uint8_t *  parentCode2,
unsigned int  point,
unsigned int  codeSize 
)
static
void BinaryChromosome::_codeCrossoverTwoPoint ( uint8_t *  offspringCode,
const uint8_t *  parentCode1,
const uint8_t *  parentCode2,
unsigned int  point1,
unsigned int  point2,
unsigned int  codeSize 
)
static
void BinaryChromosome::copyFrom ( const Chromosome c)
virtual

Reimplemented from Chromosome.

void BinaryChromosome::crossoverOnePoint ( const Chromosome parent1,
const Chromosome parent2,
Chromosome offspring1,
Chromosome offspring2 
)
static
void BinaryChromosome::crossoverTwoPoint ( const Chromosome parent1,
const Chromosome parent2,
Chromosome offspring1,
Chromosome offspring2 
)
static
bool BinaryChromosome::equals ( const Chromosome c) const
virtual

Implements Chromosome.

uint64_t BinaryChromosome::getGeneValue ( int  gene) const

Returns the value of gene #gene# as a 64-bit integer.

void BinaryChromosome::init ( )
virtual

Reimplemented from Chromosome.

void BinaryChromosome::initializeRandom ( Chromosome chromosome)
static
void BinaryChromosome::mutate ( float  p)
virtual

Reimplemented from Chromosome.

void BinaryChromosome::mutateFlip ( Chromosome chromosome,
float  probability 
)
static
void BinaryChromosome::setGeneValue ( int  gene,
uint64_t  value 
)

Sets the value of gene #gene# to #value# (max. 64-bit).

Member Data Documentation

uint8_t* BinaryChromosome::code
BinaryChromosomeProperties* BinaryChromosome::info

The documentation for this class was generated from the following files: