Changeset 955 for cpp/frams/genetics/genooperators.h
- Timestamp:
- 06/25/20 00:34:29 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/frams/genetics/genooperators.h
r935 r955 81 81 public: 82 82 Param par; 83 char supported_format; ///<genotype format which is supported by this class ('6' for GenoOper_f6, 'F' for GenoOper_fF, etc.). Must be initialized in constructor84 string name; ///< name of thisset of genetic operators83 SString supported_format; ///<genotype format which is supported by this class ("6" for GenoOper_f6, "Latent" for GenoOper_fLatent, etc.). Must be initialized in constructor. 84 string name; ///<short human-friendly name of this genetic representation/set of genetic operators 85 85 const char **mutation_method_names; ///<array of names for mutation methods. If initialized (by new const char*[]), must have entries for each method index returned by mutate(geno,chg,METHOD). If initialized, it is automatically freed by this destructor. 86 GenoOperators() : par(empty_paramtab) { supported_format = 'x'; name = "Default"; mutation_method_names = NULL; setDefaults(); }86 GenoOperators() : par(empty_paramtab) { supported_format = "x"; name = "Default"; mutation_method_names = NULL; setDefaults(); } 87 87 88 88 /**Used to perform initializations of Param parameters that are not handled by the Param itself … … 182 182 static int roulette(const double *probtab, const int count); ///<returns random index according to probabilities in the \e probtab table or -1 if all probs are zero. \e count is the number of elements in \e probtab. 183 183 static bool getMinMaxDef(ParamInterface *p, int propindex, double &mn, double &mx, double &def); ///<perhaps a more useful (higher-level) way to obtain min/max/def info for integer and double properties. Returns true if min/max/def was really available (otherwise it is just invented). 184 static int selectRandom Property(Neuro* n); ///<selects random property (either 0-based extraproperty of Neuro or 100-based property of its NeuroClass). -1 if Neuro has no properties.184 static int selectRandomNeuProperty(Neuro* n); ///<selects random property (either 0-based extraproperty of Neuro or 100-based property of its NeuroClass). -1 if Neuro has no properties. 185 185 static double mutateNeuProperty(double current, Neuro *n, int propindex); ///<returns value \e current mutated for the property \e propindex of NeuroClass \e nc or for extraproperty (\e propindex - 100) of Neuro. Neuro is used as read-only. Give \e propindex == -1 to mutate connection weight (\e nc is then ignored). 186 186 static bool mutatePropertyNaive(ParamInterface &p, int propindex); ///<creep-mutate selected property. Returns true when success. mutateProperty() should be used instead of this function.
Note: See TracChangeset
for help on using the changeset viewer.