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

Public Member Functions | |
| BinaryIntegerGene (int numberOfBits, int lowerBound, int upperBound, Random *random) | |
| Constructor. | |
| BinaryIntegerGene (BinaryIntegerGene &BinaryIntegerGene) | |
| Copy constructor. | |
| BinaryIntegerGene (BinaryIntegerGene *BinaryIntegerGene) | |
| Copy constructor. | |
| virtual | ~BinaryIntegerGene () |
| 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 () |
| int | decodeToInteger () |
| Decodes a binary string into an integer value. | |
| void | codeToBinary () |
| Codes an integer value into a binary string THIS PROCEDURE MUST BE TESTED TO ENSURE IT WORKS PROPERLY. | |
| BinaryIntegerGene & | operator= (const BinaryIntegerGene &gene) |
| bool | operator== (const BinaryIntegerGene &gene) |
| bool | operator!= (const BinaryIntegerGene &gene) |
Public Attributes | |
| bitset< MAX_LENGTH > | binaryAllele_ |
| int | numberOfBits_ |
| int | integerAllele_ |
| int | lowerBound_ |
| int | upperBound_ |
Static Public Attributes | |
| static const int | MAX_LENGTH = 30 |
Friends | |
| ostream & | operator<< (ostream &outputStream, BinaryIntegerGene &gene) |
Detailed Description
Definition at line 20 of file BinaryIntegerGene.h.
Constructor & Destructor Documentation
|
||||||||||||||||||||
|
Definition at line 20 of file BinaryIntegerGene.cpp. References binaryAllele_, decodeToInteger(), integerAllele_, lowerBound_, MAX_LENGTH, numberOfBits_, Gene::random_, Random::rnd(), and upperBound_. |
|
|
Definition at line 56 of file BinaryIntegerGene.cpp. References binaryAllele_, integerAllele_, lowerBound_, numberOfBits_, and upperBound_. |
|
|
Definition at line 77 of file BinaryIntegerGene.cpp. References binaryAllele_, integerAllele_, lowerBound_, numberOfBits_, and upperBound_. |
|
|
Destructor of the class Definition at line 95 of file BinaryIntegerGene.cpp. |
Member Function Documentation
|
|
Reimplemented from Gene. Definition at line 127 of file BinaryIntegerGene.cpp. References binaryAllele_, Random::flip(), numberOfBits_, and Gene::random_. |
|
|
Definition at line 205 of file BinaryIntegerGene.cpp. References binaryAllele_, integerAllele_, lowerBound_, numberOfBits_, and upperBound_. Referenced by setRealAllele(). |
|
|
Reimplemented in BinaryGrayIntegerGene. Definition at line 233 of file BinaryIntegerGene.cpp. References binaryAllele_, and numberOfBits_. Referenced by BinaryIntegerGene(). |
|
|
Reimplemented from Gene. Definition at line 148 of file BinaryIntegerGene.cpp. References numberOfBits_. |
|
|
Reimplemented from Gene. Definition at line 144 of file BinaryIntegerGene.cpp. References integerAllele_. |
|
|
Definition at line 168 of file BinaryIntegerGene.cpp. References binaryAllele_, and numberOfBits_. |
|
|
Definition at line 98 of file BinaryIntegerGene.cpp. References binaryAllele_, integerAllele_, lowerBound_, numberOfBits_, and upperBound_. |
|
|
Definition at line 160 of file BinaryIntegerGene.cpp. References binaryAllele_, and numberOfBits_. |
|
|
Implements Gene. Definition at line 156 of file BinaryIntegerGene.cpp. References integerAllele_. |
|
|
Reimplemented from Gene. Definition at line 196 of file BinaryIntegerGene.cpp. References codeToBinary(), and integerAllele_. |
|
||||||||||||
|
Reimplemented from Gene. Definition at line 113 of file BinaryIntegerGene.cpp. References numberOfBits_. |
|
|
Implements Gene. Definition at line 152 of file BinaryIntegerGene.cpp. References integerAllele_. |
Friends And Related Function Documentation
|
||||||||||||
|
Definition at line 176 of file BinaryIntegerGene.cpp. |
Member Data Documentation
|
|
Definition at line 24 of file BinaryIntegerGene.h. Referenced by BinaryIntegerGene(), bitFlipMutation(), codeToBinary(), decodeToInteger(), BinaryGrayIntegerGene::grayToBinary(), operator!=(), operator<<(), operator=(), and operator==(). |
|
|
Definition at line 26 of file BinaryIntegerGene.h. Referenced by BinaryIntegerGene(), codeToBinary(), getRealAllele(), operator<<(), operator=(), printGenotype(), setRealAllele(), and writeGenotype(). |
|
|
Definition at line 27 of file BinaryIntegerGene.h. Referenced by BinaryIntegerGene(), codeToBinary(), and operator=(). |
|
|
Definition at line 22 of file BinaryIntegerGene.h. Referenced by BinaryIntegerGene(). |
|
|
Definition at line 25 of file BinaryIntegerGene.h. Referenced by BinaryIntegerGene(), bitFlipMutation(), codeToBinary(), decodeToInteger(), BinaryGrayIntegerGene::decodeToInteger(), getNumberOfBits(), BinaryGrayIntegerGene::grayToBinary(), operator!=(), operator<<(), operator=(), operator==(), and singlePointCrossover(). |
|
|
Definition at line 28 of file BinaryIntegerGene.h. Referenced by BinaryIntegerGene(), codeToBinary(), and operator=(). |
The documentation for this class was generated from the following files: