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

testenv.h

Go to the documentation of this file.
00001 
00025 #include "nhp/gaenvrnmt.h"
00026 #include <magic/mtable.h>
00027 #include <magic/mmath.h>
00028 #include <magic/mmap.h>
00029 
00031 // -----                  ----   _   -----             o                                      //
00032 //   |    ___   ____  |  |      / \  |       _                      _          ___    _    |  //
00033 //   |   /   ) (     -+- | --- /   \ |---  |/ \  |   | | |/\  __  |/ \  |/|/| /   ) |/ \  -+- //
00034 //   |   |---   \__   |  |   \ |---| |     |   |  \ /  | |   /  \ |   | | | | |---  |   |  |  //
00035 //   |    \__  ____)   \ |___/ |   | |____ |   |   V   | |   \__/ |   | | | |  \__  |   |   \ //
00037 
00040 class BinaryTestEAEnv : public EAEnvironment {
00041     // Should be bool-table but gcc doesn't like them
00042     PackTable<int>  targets;
00043     int             mObjective;
00044   public:
00045 
00053                     BinaryTestEAEnv (int d, int nObjectives=1);
00054 
00057     void            changeObjective             (int target);
00058     
00059     // Implementations
00060     
00061     virtual void    addFeaturesTo               (Genome& genome) const;
00062     virtual void    init_cycle                  () {;}
00063     virtual double  evaluateg                   (const Individual& genome);
00064     virtual void    cycle_report                (OStream& log, OStream& out);
00065 };
00066 
00067 
00068 
00070 //  ----- |                -----                  ----   _   -----              //
00071 //  |     |       ___   |    |    ___   ____  |  |      / \  |       _          //
00072 //  |---  |  __   ___| -+-   |   /   ) (     -+- | --- /   \ |---  |/ \  |   |  //
00073 //  |     | /  \ (   |  |    |   |---   \__   |  |   \ |---| |     |   |  \ /   //
00074 //  |     | \__/  \__|   \   |    \__  ____)   \ |___/ |   | |____ |   |   V   O//
00076 
00079 class FloatTestEAEnv : public EAEnvironment {
00080   public:
00081 
00093                     FloatTestEAEnv      (const StringMap& params,
00094                                              int dim=2, int funct_b=-1);
00095 
00099     void            printMathematica2D  ();
00100 
00106     double  calc                        (const Vector& v, int f);
00107 
00110     void            changeObjective     (int o) {mObjective=o;}
00111 
00115     void            setGeneType         (int vt) {mGeneType=vt;}
00116     
00117     // Implementations
00118     
00119     virtual void    addFeaturesTo           (Genome& genome) const;
00120     virtual void    init_cycle              () {;}
00121     virtual double  evaluateg               (const Individual& genome);
00122     virtual void    cycle_report            (OStream& log, OStream& out) {;}
00123 
00124     enum testfunctions {Sphere=0, Ellipsoid, NegSphere, ZeroMin,
00125                         F4, F5, F6, F7, F8, /* Number of functions: */ functions};
00126     enum genetypes {ESFLOAT=0, BITFLOAT};
00127 
00128   protected:
00130     int dim;
00131 
00133     int func;
00134 
00136     double par_a;
00137 
00139     double par_b;
00140 
00141     int     mObjective;
00142     int     mGeneType;
00143 
00144     const StringMap& mParams;
00145     
00146 };
00147 
00150 class MultiMinEAEnv : public EAEnvironment {
00151   public:
00152 
00160                     MultiMinEAEnv   (int minima, int minimadist) {;}
00161     virtual void    addFeaturesTo   (Genome& genome) const;
00162     virtual void    init_cycle      () {;}
00163     virtual double  evaluateg       (const Individual& genome);
00164     virtual void    cycle_report    (OStream& log, OStream& out) {;}
00165 };
00166 
00167 
00168 

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