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

BinaryRealGene Class Reference

#include <BinaryRealGene.h>

Inheritance diagram for BinaryRealGene:

Gene List of all members.

Public Member Functions

 BinaryRealGene (int numberOfBits, double lowerBound, double upperBound, Random *random)
 Constructor.

 BinaryRealGene (BinaryRealGene &binaryRealGene)
 Copy constructor.

 BinaryRealGene (BinaryRealGene *binaryRealGene)
 Copy constructor.

virtual ~BinaryRealGene ()
 Destructor.

int bitFlipMutation (double mutationProbability)
double getRealAllele ()
void writeGenotype (ofstream &outputFile)
BinaryRealGeneoperator= (const BinaryRealGene &gene)

Public Attributes

char * binaryAllele_
 Binary string.

int numberOfBits_
 Number of bits of the bit string.

double realAllele_
 Real value of the allele.

double lowerBound_
 Lower bound of the allele.

double upperBound_
 Upper bound of the allele.


Private Member Functions

double decodeToReal ()

Friends

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

Constructor & Destructor Documentation

BinaryRealGene::BinaryRealGene int  numberOfBits,
double  lowerBound,
double  upperBound,
Random random
 

Parameters:
individual The individual to copy
Constructor of the class

Definition at line 17 of file BinaryRealGene.cpp.

References BINARY_REAL, binaryAllele_, decodeToReal(), lowerBound_, numberOfBits_, Gene::random_, realAllele_, Random::rnd(), and upperBound_.

BinaryRealGene::BinaryRealGene BinaryRealGene gene  ) 
 

Parameters:
individual The individual to copy
Constructor of the class

Definition at line 51 of file BinaryRealGene.cpp.

References binaryAllele_, lowerBound_, numberOfBits_, realAllele_, and upperBound_.

BinaryRealGene::BinaryRealGene BinaryRealGene gene  ) 
 

Parameters:
individual The individual to copy
Constructor of the class

Definition at line 80 of file BinaryRealGene.cpp.

References binaryAllele_, lowerBound_, numberOfBits_, realAllele_, and upperBound_.

BinaryRealGene::~BinaryRealGene  )  [virtual]
 

Destructor of the class

Definition at line 105 of file BinaryRealGene.cpp.

References binaryAllele_.


Member Function Documentation

int BinaryRealGene::bitFlipMutation double  mutationProbability  )  [virtual]
 

Reimplemented from Gene.

Definition at line 122 of file BinaryRealGene.cpp.

References binaryAllele_, decodeToReal(), Random::flip(), numberOfBits_, Gene::random_, and realAllele_.

double BinaryRealGene::decodeToReal  )  [private]
 

Definition at line 163 of file BinaryRealGene.cpp.

References binaryAllele_, lowerBound_, numberOfBits_, and upperBound_.

Referenced by BinaryRealGene(), and bitFlipMutation().

double BinaryRealGene::getRealAllele  )  [virtual]
 

Reimplemented from Gene.

Definition at line 140 of file BinaryRealGene.cpp.

References realAllele_.

BinaryRealGene & BinaryRealGene::operator= const BinaryRealGene gene  ) 
 

Definition at line 109 of file BinaryRealGene.cpp.

References binaryAllele_, lowerBound_, numberOfBits_, realAllele_, and upperBound_.

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

Implements Gene.

Definition at line 144 of file BinaryRealGene.cpp.

References realAllele_.


Friends And Related Function Documentation

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

Definition at line 149 of file BinaryRealGene.cpp.


Member Data Documentation

char* BinaryRealGene::binaryAllele_
 

Definition at line 23 of file BinaryRealGene.h.

Referenced by BinaryRealGene(), bitFlipMutation(), decodeToReal(), operator<<(), operator=(), and ~BinaryRealGene().

double BinaryRealGene::lowerBound_
 

Definition at line 26 of file BinaryRealGene.h.

Referenced by BinaryRealGene(), decodeToReal(), and operator=().

int BinaryRealGene::numberOfBits_
 

Definition at line 24 of file BinaryRealGene.h.

Referenced by BinaryRealGene(), bitFlipMutation(), decodeToReal(), operator<<(), and operator=().

double BinaryRealGene::realAllele_
 

Definition at line 25 of file BinaryRealGene.h.

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

double BinaryRealGene::upperBound_
 

Definition at line 27 of file BinaryRealGene.h.

Referenced by BinaryRealGene(), decodeToReal(), and operator=().


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