00001 #ifndef GLCONSTANTS_H_ 00002 #define GLCONSTANTS_H_ 00003 #include <string> 00004 using namespace std; 00005 00009 class GLConstants 00010 { 00011 public: 00013 enum TGeneBounds 00014 { 00015 BOUNDED_GENES = 0, 00016 UNBOUNDED_GENES = 1 00017 }; 00018 00023 enum TMemoryPolicy 00024 { 00025 DO_NOT_FREE = 0, //do not free memory at all 00026 FREE_ALL = 1, //free all the pointers in the storage. 00027 FREE_UNLOCKED = 2 //free only those, which are not locked in memory. 00028 }; 00029 00033 enum TMutationPolicy 00034 { 00035 MUTATE_PARENTS = 0x01, //only parents will be mutated 00036 MUTATE_CHILDREN = 0x02 //only children will be mutated 00037 }; 00038 00040 enum TSizeLimits 00041 { 00042 FIXED = 0, 00043 NOT_FIXED = 1, 00044 00045 }; 00046 00051 enum TStorageFilling 00052 { 00053 REPLACE = 0, 00054 APPEND = 1 00055 }; 00056 00060 // enum TTagConstants 00061 // { 00062 // KEEP = 1, 00063 // REMOVE = 2 00064 // }; 00065 00070 enum TTwinsFlags 00071 { 00072 TWINS_ALLOWED = 0, 00073 NO_TWINS = 1 00074 }; 00075 00079 static const bool CORPSES_KEEP = true; 00083 static const bool CORPSES_DISPOSE = false; 00084 00087 static const bool AND_OPERATOR = true; 00088 00091 static const bool OR_OPERATOR = false; 00092 00093 /*---------------------------------------------------------------------*/ 00094 /*| CONSTANTS FOR GENETIC ALGORITHM STATUS |*/ 00095 /*---------------------------------------------------------------------*/ 00098 static const int GA_STATE_INITIALISED = 101; 00100 static const int GA_STATE_RUNNING = 105; 00102 static const int GA_STATE_STOPPED_ERROR = 110; 00104 static const int GA_STATE_STOPPED_NORMALLY = 115; 00105 00106 /*---------------------------------------------------------------------*/ 00107 /*| CONSTANTS FOR GENETIC ALGORITHM PARAMETERS |*/ 00108 /*---------------------------------------------------------------------*/ 00112 00113 static const int MUTATOR_GENES_SWAPPING = 1001; 00115 static const int MUTATOR_GENES_SHUFFLING = 1002; 00117 static const int MUTATOR_GENE_MOVING = 1003; 00120 static const int MUTATOR_COMBINED = 1004; 00121 00125 00126 00127 static const int CROSSOVER_VECTOR_KEEP_MATCHING_INT = 2001; 00129 static const int CROSSOVER_ONE_POINT = 2002; 00132 static const int CROSSOVER_TWO_POINTS = 2003; 00133 00137 00138 static const int RANKER_STANDARD_SO = 3001; 00139 00143 00144 00145 static const int VARIATOR_STANDARD = 4001; 00146 00150 00151 00152 static const int BREEDER_STANDARD = 5001; 00153 00157 00158 00159 static const int SELECTIONIST_ELITIST = 6001; 00162 static const int SELECTIONIST_MIXER = 6002; 00163 00167 00168 static const int POPULATION_STANDARD = 7001; 00169 00173 00174 static const int INITIALISER_SHUFFLE_INT_VECTOR = 8001; 00175 00182 static string toString (TGeneBounds bounds); 00183 00189 static string toString (TMemoryPolicy memory); 00190 00197 static string toString (TSizeLimits limits); 00198 00205 //static string toString (TTagConstants tag); 00206 00213 static string toStringBreeder(int breeder_type); 00214 00221 static string toStringCrossover(int crossover_type); 00222 00229 static string toStringGaState(int ga_state); 00230 00238 static string toStringInitialiser(int initialiser_type); 00239 00246 static string toStringMutator(int mutator_type); 00247 00254 static string toStringPopulation(int population_type); 00255 00262 static string toStringRanker(int ranker_type); 00263 00270 static string toStringSelectionist(int selectionist_type); 00271 00278 static string toStringVariator(int variator_type); 00279 00280 }; //GLConstants 00281 #endif /*GLCONSTANTS_H_*/