00001 /* 00002 * @file BinaryGene.h 00003 * @author Antonio Jesus Nebro Urbaneja 00004 * @version 1.0 00005 * @date 29 January 2004 00006 * @brief Header file of BinaryGene.cpp 00007 */ 00008 00009 #include <Configuration.h> 00010 #include <Gene.h> 00011 00012 #ifndef __BINARY_GENE__ 00013 #define __BINARY_GENE__ 00014 00019 class BinaryGene : public Gene { 00020 public: 00021 char * allele_ ; 00022 int numberOfBits_ ; 00023 00024 // Constructors 00025 BinaryGene(int bits, Random * random) ; 00026 BinaryGene(BinaryGene & binaryGene) ; 00027 BinaryGene(BinaryGene * binaryGene) ; 00028 00029 // Destructors 00030 ~BinaryGene() ; 00031 00032 // Methods 00033 int bitFlipMutation(double mutationProbability) ; 00034 00035 void writeGenotype(ofstream &outputFile) ; 00036 00037 // Operators 00038 BinaryGene & operator=(const BinaryGene& binaryGene) ; 00039 friend ostream& operator<< (ostream& outputStream, BinaryGene& gene) ; 00040 00041 } ; // Binary 00042 00043 #endif 00044