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

RealGene.h

Go to the documentation of this file.
00001 /*
00002  * @file    RealGene.h
00003  * @author  Antonio Jesus Nebro Urbaneja
00004  * @version 1.0
00005  * @date    29 January 2004
00006  * @brief   Header file of RealGene.cpp
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   // Constructors
00026   RealGene(Random * random) ;
00027   RealGene(double lowerBound, double upperBound, Random * random) ;
00028   RealGene(RealGene & realgene) ;
00029   RealGene(RealGene * realGene) ;
00030 
00031   // Destructor
00032   ~RealGene() ;
00033   
00034   // Methods
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   // Operators
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 } ; // RealGene
00060 
00061 #endif

Generated on Wed Feb 11 10:38:02 2004 for Paes by doxygen 1.3.3