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

Gene.h

Go to the documentation of this file.
00001 /*
00002  * @file    Gene.h
00003  * @author  Antonio Jesus Nebro Urbaneja
00004  * @version 1.0
00005  * @date    29 January 2004
00006  * @brief   Header file of Gene.cpp
00007  */
00008  
00009 #include <Configuration.h>
00010 #include <Random.h>
00011 
00012 #ifndef __GENE__
00013 #define __GENE__
00014 
00019 class Gene {
00020 public:
00021   Random *     random_   ; 
00022   VariableType geneType_ ; 
00023   
00024   // Constructors
00025   Gene(VariableType geneType_, Random * random) ;
00026   Gene(Gene & gene) ;
00027   Gene(Gene * gene) ;
00028   
00029   // Destructor
00030   virtual ~Gene() ;
00031   
00032   // Methods
00033   virtual int bitFlipMutation(double mutationProbability) ; 
00034   
00035   virtual int randomMutation(double mutationProbability) ;
00036   virtual int polynomialMutation(double mutationProbability, 
00037                                  double distributionIndex) ; 
00038   virtual int uniformMutation(double mutationProbability, 
00039                               double perturbation) ; 
00040 
00041   virtual double getRealAllele() ;
00042   virtual void   writeGenotype(ofstream &outputFile) = 0 ;
00043   
00044   // Operators 
00045   Gene & operator=(const Gene& gene) ;
00046   friend ostream& operator<< (ostream& outputStream, Gene& gene) ;
00047 
00048 } ; // Gene
00049 
00050 #endif
00051 
00052 

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