00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef REALGENOTYPE_H
00021 #define REALGENOTYPE_H
00022
00023 #include "gaconfig.h"
00024 #include "genotypes/doublegenotype.h"
00025 #include <cfloat>
00026
00027 namespace farsa {
00028
00037 class FARSA_GA_API RealGenotype : public DoubleGenotype {
00038 public:
00048 RealGenotype( unsigned int numGenes = 0, float min = FLT_MIN, float max = FLT_MAX );
00050 virtual ~RealGenotype();
00052 RealGenotype( const RealGenotype& genotype );
00054 virtual RealGenotype& operator=( const Genotype& genotype );
00056 virtual double at( unsigned int i );
00058 virtual void set( unsigned int i, double value );
00060 virtual void randomize();
00067 virtual void configure( ConfigurationParameters& params, QString prefix );
00074 virtual void save( ConfigurationParameters& params, QString prefix );
00076 static void describe( QString type );
00078 virtual RealGenotype* clone() const;
00079 private:
00081 float* genes;
00082 };
00083
00084 }
00085
00086 #endif