BinaryRealGene Class Reference
Class representing a binary-coded real gene.
#include <BinaryRealGene.h>
Inheritance diagram for BinaryRealGene:

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) |
| void | singlePointCrossover (int point, Gene *gene) |
| Bitwise crossover between two genes. | |
| int | getNumberOfBits () |
| double | getRealAllele () |
| void | setRealAllele (double value) |
| Set the value of the real allele. | |
| void | writeGenotype (ofstream &outputFile) |
| void | printGenotype () |
| double | decodeToReal () |
| Decodes a binary string into a real value. | |
| void | codeToBinary () |
| Codes a real value into a binary string THIS PROCEDURE MUST BE TESTED TO ENSURE IT WORKS PROPERLY. | |
| BinaryRealGene & | operator= (const BinaryRealGene &gene) |
| bool | operator== (const BinaryRealGene &gene) |
| bool | operator!= (const BinaryRealGene &gene) |
Public Attributes | |
| bitset< MAX_LENGTH > | binaryAllele_ |
| int | numberOfBits_ |
| double | realAllele_ |
| double | lowerBound_ |
| double | upperBound_ |
Static Public Attributes | |
| static const int | MAX_LENGTH = 30 |
Friends | |
| ostream & | operator<< (ostream &outputStream, BinaryRealGene &gene) |
Detailed Description
Definition at line 20 of file BinaryRealGene.h.
Constructor & Destructor Documentation
|
||||||||||||||||||||
|
Definition at line 20 of file BinaryRealGene.cpp. References binaryAllele_, decodeToReal(), lowerBound_, MAX_LENGTH, numberOfBits_, Gene::random_, realAllele_, Random::rnd(), and upperBound_. |
|
|
Definition at line 56 of file BinaryRealGene.cpp. References binaryAllele_, lowerBound_, numberOfBits_, realAllele_, and upperBound_. |
|
|
Definition at line 77 of file BinaryRealGene.cpp. References binaryAllele_, lowerBound_, numberOfBits_, realAllele_, and upperBound_. |
|
|
Destructor of the class Definition at line 95 of file BinaryRealGene.cpp. |
Member Function Documentation
|
|
Reimplemented from Gene. Definition at line 127 of file BinaryRealGene.cpp. References binaryAllele_, Random::flip(), numberOfBits_, and Gene::random_. |
|
|
Definition at line 223 of file BinaryRealGene.cpp. References binaryAllele_, lowerBound_, numberOfBits_, realAllele_, and upperBound_. Referenced by setRealAllele(). |
|
|
Reimplemented in BinaryGrayRealGene. Definition at line 204 of file BinaryRealGene.cpp. References binaryAllele_, and numberOfBits_. Referenced by BinaryRealGene(). |
|
|
Reimplemented from Gene. Definition at line 148 of file BinaryRealGene.cpp. References numberOfBits_. |
|
|
Reimplemented from Gene. Definition at line 144 of file BinaryRealGene.cpp. References realAllele_. |
|
|
Definition at line 168 of file BinaryRealGene.cpp. References binaryAllele_, and numberOfBits_. |
|
|
Definition at line 98 of file BinaryRealGene.cpp. References binaryAllele_, lowerBound_, numberOfBits_, realAllele_, and upperBound_. |
|
|
Definition at line 160 of file BinaryRealGene.cpp. References binaryAllele_, and numberOfBits_. |
|
|
Implements Gene. Definition at line 156 of file BinaryRealGene.cpp. References realAllele_. |
|
|
Reimplemented from Gene. Definition at line 196 of file BinaryRealGene.cpp. References codeToBinary(), and realAllele_. |
|
||||||||||||
|
Reimplemented from Gene. Definition at line 113 of file BinaryRealGene.cpp. References numberOfBits_. |
|
|
Implements Gene. Definition at line 152 of file BinaryRealGene.cpp. References realAllele_. |
Friends And Related Function Documentation
|
||||||||||||
|
Definition at line 176 of file BinaryRealGene.cpp. |
Member Data Documentation
|
|
Definition at line 24 of file BinaryRealGene.h. Referenced by BinaryRealGene(), bitFlipMutation(), codeToBinary(), decodeToReal(), BinaryGrayRealGene::grayToBinary(), operator!=(), operator<<(), operator=(), and operator==(). |
|
|
Definition at line 27 of file BinaryRealGene.h. Referenced by BinaryRealGene(), codeToBinary(), and operator=(). |
|
|
Definition at line 22 of file BinaryRealGene.h. Referenced by BinaryRealGene(). |
|
|
Definition at line 25 of file BinaryRealGene.h. Referenced by BinaryRealGene(), bitFlipMutation(), codeToBinary(), decodeToReal(), BinaryGrayRealGene::decodeToReal(), getNumberOfBits(), BinaryGrayRealGene::grayToBinary(), operator!=(), operator<<(), operator=(), operator==(), and singlePointCrossover(). |
|
|
Definition at line 26 of file BinaryRealGene.h. Referenced by BinaryRealGene(), codeToBinary(), getRealAllele(), operator<<(), operator=(), printGenotype(), setRealAllele(), and writeGenotype(). |
|
|
Definition at line 28 of file BinaryRealGene.h. Referenced by BinaryRealGene(), codeToBinary(), and operator=(). |
The documentation for this class was generated from the following files: