Changeset 674
- Timestamp:
- 08/19/17 02:45:00 (7 years ago)
- Location:
- cpp/frams/genetics/f4
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/frams/genetics/f4/oper_f4.cpp
r671 r674 16 16 17 17 18 //see also modifiers in f1 19 #define F4_MODIFIERS_VISUAL "" //not supported in f4 20 #define F4_MODIFIERS_RARE "EeWwAaSs" //expdef would need to handle these properly/specifically to ensure reasonable behavior, and hardly any expdef does. Modifying initial energy of a creature as a result of its genes (Ee) is in general not a good idea. Weight (Ww) works only in water, and there sinking/going up should usually be caused by real activity of a creature, not by its inherited weight. For assimilation (Aa) , there is a dedicated parameter in CreaturesGroup. Stamina (Ss) is no longer needed as destructive collisions are not supported, and even if they were, some expdef would need to impose reasonable restrictions on the value of this parameter (e.g. similar to normalizeBiol4()) and the specific consequences of destructions should be defined as needed. 21 #define F4_MODIFIERS "LlRrCcQqFfMmIi" F4_MODIFIERS_RARE F4_MODIFIERS_VISUAL //TODO no Rr in f4? 22 const char *Geno_f4::all_modifiers = F4_MODIFIERS; 23 18 24 #define FIELDSTRUCT Geno_f4 19 25 20 26 static ParamEntry GENO4param_tab[] = 21 27 { 22 { "Genetics: f4", 1, F4_COUNT + F4_ADD_COUNT , },28 { "Genetics: f4", 1, F4_COUNT + F4_ADD_COUNT + 1, }, 23 29 { "f4_mut_add", 0, 0, "Add node", "f 0 100 50", FIELD(prob[F4_ADD]), "mutation: probability of adding a node", }, 24 30 { "f4_mut_add_div", 0, 0, "- add division", "f 0 100 20", FIELD(probadd[F4_ADD_DIV]), "add node mutation: probability of adding a division", }, … … 29 35 { "f4_mut_del", 0, 0, "Delete node", "f 0 100 20", FIELD(prob[F4_DEL]), "mutation: probability of deleting a node", }, 30 36 { "f4_mut_mod", 0, 0, "Modify node", "f 0 100 30", FIELD(prob[F4_MOD]), "mutation: probability of changing a node", }, 37 { "f4_mut_exmod", 1, 0, "Excluded modifiers", "s 0 30", FIELD(excluded_modifiers), "Modifiers that will not be added nor deleted during mutation\n(all: " F4_MODIFIERS ")", }, 31 38 { 0, }, 32 39 }; … … 52 59 mutation_method_names[index++] = "modified a node"; 53 60 if (index != F4_COUNT + F4_ADD_COUNT - 1) logMessage("Geno_f4", "Constructor", 3, "Mutation names init error"); 61 } 62 63 void Geno_f4::setDefaults() 64 { 65 excluded_modifiers = F4_MODIFIERS_RARE F4_MODIFIERS_VISUAL; 54 66 } 55 67 -
cpp/frams/genetics/f4/oper_f4.h
r671 r674 33 33 public: 34 34 Geno_f4(); 35 void setDefaults(); 36 35 37 int checkValidity(const char *, const char *genoname); 36 38 int validate(char *&, const char *genoname); … … 42 44 // mutation probabilities 43 45 double prob[F4_COUNT], probadd[F4_ADD_COUNT]; 46 47 SString excluded_modifiers; //not to be used in mutations 48 static const char *all_modifiers; 44 49 45 50 protected:
Note: See TracChangeset
for help on using the changeset viewer.