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

BinaryGene Class Reference

Abstract class that represents a binary gene.

#include <BinaryGene.h>

Inheritance diagram for BinaryGene:

Gene List of all members.

Public Member Functions

 BinaryGene (int bits, Random *random)
 Constructor.

 BinaryGene (BinaryGene &binaryGene)
 Copy constructor.

 BinaryGene (BinaryGene *binaryGene)
 Copy constructor.

 ~BinaryGene ()
 Destructor.

int bitFlipMutation (double mutationProbability)
void writeGenotype (ofstream &outputFile)
BinaryGeneoperator= (const BinaryGene &binaryGene)

Public Attributes

char * allele_
 Bit string.

int numberOfBits_
 Number of bits of the bit string.


Friends

ostream & operator<< (ostream &outputStream, BinaryGene &gene)

Constructor & Destructor Documentation

BinaryGene::BinaryGene int  numberOfBits,
Random random
 

Parameters:
individual The individual to copy
Constructor of the class

Definition at line 17 of file BinaryGene.cpp.

References allele_, BINARY, numberOfBits_, Gene::random_, and Random::rnd().

BinaryGene::BinaryGene BinaryGene binaryGene  ) 
 

Parameters:
individual The individual to copy
Constructor of the class

Definition at line 43 of file BinaryGene.cpp.

References allele_, and numberOfBits_.

BinaryGene::BinaryGene BinaryGene binaryGene  ) 
 

Parameters:
individual The individual to copy
Constructor of the class

Definition at line 65 of file BinaryGene.cpp.

References allele_, and numberOfBits_.

BinaryGene::~BinaryGene  ) 
 

Destructor of the class

Definition at line 85 of file BinaryGene.cpp.

References allele_.


Member Function Documentation

int BinaryGene::bitFlipMutation double  mutationProbability  )  [virtual]
 

Reimplemented from Gene.

Definition at line 90 of file BinaryGene.cpp.

References allele_, Random::flip(), numberOfBits_, and Gene::random_.

BinaryGene & BinaryGene::operator= const BinaryGene binaryGene  ) 
 

Definition at line 118 of file BinaryGene.cpp.

References allele_, and numberOfBits_.

void BinaryGene::writeGenotype ofstream &  outputFile  )  [virtual]
 

Implements Gene.

Definition at line 108 of file BinaryGene.cpp.

References allele_, and numberOfBits_.


Friends And Related Function Documentation

ostream& operator<< ostream &  outputStream,
BinaryGene gene
[friend]
 

Definition at line 128 of file BinaryGene.cpp.


Member Data Documentation

char* BinaryGene::allele_
 

Definition at line 21 of file BinaryGene.h.

Referenced by BinaryGene(), bitFlipMutation(), operator<<(), operator=(), writeGenotype(), and ~BinaryGene().

int BinaryGene::numberOfBits_
 

Definition at line 22 of file BinaryGene.h.

Referenced by BinaryGene(), bitFlipMutation(), operator<<(), operator=(), and writeGenotype().


The documentation for this class was generated from the following files:
Generated on Wed Feb 11 10:38:03 2004 for Paes by doxygen 1.3.3