00001
00002
00003
00004
00005
00006
00007
00008
00009 #include <Configuration.h>
00010 #include <Gene.h>
00011
00012 #ifndef __REAL_GENE__
00013 #define __REAL_GENE__
00014
00019 class RealGene : public Gene {
00020 public:
00021 double allele_ ;
00022 double lowerBound_ ;
00023 double upperBound_ ;
00024
00025
00026 RealGene(Random * random) ;
00027 RealGene(double lowerBound, double upperBound, Random * random) ;
00028 RealGene(RealGene & realgene) ;
00029 RealGene(RealGene * realGene) ;
00030
00031
00032 ~RealGene() ;
00033
00034
00035 int randomMutation(double mutationProbability) ;
00036 int polynomialMutation(double mutationProbability,
00037 double distributionIndex) ;
00038 int uniformMutation(double mutationProbability, double perturbation) ;
00039
00040 double getRealAllele() ;
00041 void writeGenotype(ofstream &outputFile) ;
00042
00043
00044 RealGene & operator=(const RealGene& realGene) ;
00045 friend ostream& operator<< (ostream& outputStream, RealGene& gene) ;
00046
00047 #ifdef __MPI__
00048 void send(int address) ;
00049 void receive(int address) ;
00050
00051 int getSize() ;
00052 void calculateSize() ;
00053
00054 void packData(char * buffer, int * bufferOffset, int bufferSize) ;
00055 void unpackData(char * buffer, int * bufferOffset, int bufferSize) ;
00056
00057 #endif
00058
00059 } ;
00060
00061 #endif