Ignore:
Timestamp:
06/25/20 00:34:29 (4 years ago)
Author:
Maciej Komosinski
Message:

Genetic format ID becomes a string (no longer limited to a single character)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpp/frams/genetics/genooperators.h

    r935 r955  
    8181public:
    8282        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 constructor
    84         string name; ///<name of this set of genetic operators
     83        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
    8585        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(); }
    8787
    8888        /**Used to perform initializations of Param parameters that are not handled by the Param itself
     
    182182        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.
    183183        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 selectRandomProperty(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.
    185185        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).
    186186        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.