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

simplepopula.h

Go to the documentation of this file.
00001 
00025 #ifndef __SIMPLEPOPULA_H__
00026 #define __SIMPLEPOPULA_H__
00027 
00028 #include "population.h"
00029 
00031 //                                                                           //
00032 //  ---- o            |       ----                  |           o            //
00033 // (              --  |  ___  |   )       --        |  ___   |           _   //
00034 //  ---  | |/|/| |  ) | /   ) |---   __  |  ) |   | |  ___| -+- |  __  |/ \  //
00035 //     ) | | | | |--  | |---  |     /  \ |--  |   | | (   |  |  | /  \ |   | //
00036 // ___/  | | | | |    |  \__  |     \__/ |     \__! |  \__|   \ | \__/ |   | //
00037 //                                                                           //
00039 
00042 class SimplePopulation : public Population {
00043   public:
00044 
00047                                 SimplePopulation (EAEnvironment& envr, const StringMap& params);
00048 
00049                                 ~SimplePopulation ();
00050 
00060     double                      evolve          (int generations,
00061                                                  const char* savefile=NULL,
00062                                                  double trg_fitn=-1);
00063     
00066     const Individual&           operator[]		(int i) const {return (*mpPopulation)[i];}
00067 
00071     Individual&                 operator[]		(int i) {return (*mpPopulation)[i];}
00072     
00075     int                         size            () const {return mpPopulation->size();}
00076 
00079     void                        print           (TextOStream& out) const;
00080 
00083     void                        report          (TextOStream& log) const;
00084 
00087     const EAStrategy&           getstrategy     () const {return *mpStrategy;}
00088 
00092     int                         getAge          () const {return mAge;}
00093 
00096     MutationRate&               mutRate         () {return mGlobalMutationRate;}
00097 
00100     const SelectionPrms&        selParams       () const {return mSelectionParams;}
00103     SelectionPrms&              selParams       () {return mSelectionParams;}
00104 
00109     void                        resetFitnesses  ();
00110 
00112     virtual void                check           () const;
00113     
00116     double                      minsimilarity;
00117 
00118     const Array<Individual>&    getPopArray () const {return *mpPopulation;}
00119   private:
00120 
00124     void                    evaluate        (EAEnvironment& envr, TextOStream& out);
00125 
00130     void                    addFeaturesTo   (Genome& genome) const;
00131 
00132   private:
00133     Array<Individual>*      mpPopulation;       
00134     EAStrategy*             mpStrategy;         
00135     FitnessStats            mFitnessStats;      
00136     int                     mElites;            
00137     bool                    mUseGlobalElites;   
00138     SelectionPrms           mSelectionParams;   
00139     bool                    mUseGlobalMu;       
00140     bool                    mUseGlobalQ;        
00141     bool                    mUseGlobalEtaPlus;  
00143     friend class EAStrategy;
00144     friend class Selector;
00145 };
00146 
00147 #endif
00148 

Generated on Thu Feb 10 20:12:01 2005 for NeHeP by doxygen1.2.18