Changeset 772


Ignore:
Timestamp:
04/05/18 20:03:20 (7 years ago)
Author:
Maciej Komosinski
Message:

Unified #define modifiers in f1 and f4, fixes issue number 16 [refs #62]

Location:
cpp/frams/genetics
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpp/frams/genetics/f4/oper_f4.cpp

    r771 r772  
    1717
    1818
    19 //see also modifiers in f1
    20 #define F4_MODIFIERS_VISUAL "DdGgBbHh"
    21 #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 in water sinking/going up should usually be caused by real "intentional" 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()) so there is some cost associated with it, and the specific consequences of destructions should be defined as needed.
    22 #define F4_MODIFIERS ",LlRrCcQqFfMmIi" F4_MODIFIERS_RARE F4_MODIFIERS_VISUAL
    23 const char *Geno_f4::all_modifiers = F4_MODIFIERS;
     19const char *Geno_f4::all_modifiers = F14_MODIFIERS ","; //comma in f4 is handled the same way (simple node, F4_ADD_SIMP) as modifiers
    2420
    2521// codes that can be changed (apart from being added/deleted)
     
    4036        { "f4_mut_del", 0, 0, "Delete node", "f 0 100 20", FIELD(prob[F4_DEL]), "mutation: probability of deleting a node", },
    4137        { "f4_mut_mod", 0, 0, "Modify node", "f 0 100 30", FIELD(prob[F4_MOD]), "mutation: probability of changing a node", },
    42         { "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 ")", },
     38        { "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: " F14_MODIFIERS ")", },
    4339        { 0, },
    4440};
     
    6864void Geno_f4::setDefaults()
    6965{
    70         excluded_modifiers = F4_MODIFIERS_RARE F4_MODIFIERS_VISUAL;
     66        excluded_modifiers = F14_MODIFIERS_RARE F14_MODIFIERS_VISUAL;
    7167}
    7268
     
    722718        char ch = g[pos];
    723719        // style categories
    724 #define STYL4CAT_MODIFIC F4_MODIFIERS ","
     720#define STYL4CAT_MODIFIC F14_MODIFIERS ","
    725721#define STYL4CAT_NEUMOD "[]|@*GTS:+-/!="
    726722#define STYL4CAT_DIGIT "0123456789."
  • cpp/frams/genetics/geneprops.h

    r759 r772  
    88#include <common/nonstd_math.h>
    99#include <frams/model/model.h>
     10
     11
     12
     13
     14
     15#define F14_MODIFIERS_VISUAL "DdGgBbHh"
     16#define F14_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 in water sinking/going up should usually be caused by real "intentional" 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()) so there is some cost associated with it, and the specific consequences of destructions should be defined as needed.
     17#define F14_MODIFIERS "LlRrCcQqFfMmIi" F14_MODIFIERS_RARE F14_MODIFIERS_VISUAL
     18
     19
     20
     21
    1022
    1123/**
Note: See TracChangeset for help on using the changeset viewer.