Changeset 1186


Ignore:
Timestamp:
11/20/22 20:32:43 (12 days ago)
Author:
Maciej Komosinski
Message:

For consistency with other numerical types, unlimited string length is now indicated by "-1" as the second value of the definition of the "s" property

Location:
cpp/frams
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • cpp/frams/_demos/loader_test_param.cpp

    r994 r1186  
    3737        { "Data", 1, 16, "data", },
    3838        { "text", 0, 0, "Text", "s 0 10", FIELD(text), }, // 10 = length limit
    39         { "longtext", 0, 0, "Long text", "s 1", FIELD(longtext), }, // 1 = multiline, 0 = unlimited
    40         { "deftext", 0, 0, "Text with default value", "s 0 0 some text", FIELD(deftext), },
     39        { "longtext", 0, 0, "Long text", "s 1", FIELD(longtext), }, // 1 = multiline, -1 = unlimited
     40        { "deftext", 0, 0, "Text with default value", "s 0 -1 some text", FIELD(deftext), },
    4141        { "i1", 0, 0, "Integer 1", "d", FIELD(i1), },          // unrestricted integer
    4242        { "i2", 0, 0, "Integer 2", "d -5 5 1", FIELD(i2), }, // [-5..5] integer, default=1
  • cpp/frams/config/f0-SDK.def

    r1183 r1186  
    33GROUP(Visual)
    44PROP(se,0,1024,startenergy,f,,,,startenergy)
    5 PROP(Vstyle,1,0,Visual style,s,0,0,,vis_style,,``See the \"Visual style definition\" context for more information'')
     5PROP(Vstyle,1,0,Visual style,s,0,-1,,vis_style,,``See the \"Visual style definition\" context for more information'')
    66ENDCLASS
    77
     
    2727PROP(rz,0,1024,rot.z,f,,,,rot.z)
    2828PROP(i,1,0,`info',s,,,,info)
    29 PROP(Vstyle,2,0,Visual style,s,0,0,part,vis_style,,``See the \"Visual style definition\" context for more information'')
     29PROP(Vstyle,2,0,Visual style,s,0,-1,part,vis_style,,``See the \"Visual style definition\" context for more information'')
    3030XPROP(vr,2,0,red component,f,0.0,1.0,0.5,vcolor.x)
    3131XPROP(vg,2,1024,green component,f,0.0,1.0,0.5,vcolor.y)
     
    6666PROP(stam,2,0,stamina,f,0.0,1.0,0.25,stamina)
    6767PROP(i,2,0,`info',s,,,,info)
    68 PROP(Vstyle,3,0,Visual style,s,0,0,joint,vis_style,,``See the \"Visual style definition\" context for more information'')
     68PROP(Vstyle,3,0,Visual style,s,0,-1,joint,vis_style,,``See the \"Visual style definition\" context for more information'')
    6969XPROP(vr,3,0,red component,f,0.0,1.0,0.5,vcolor.x)
    7070XPROP(vg,3,1024,green component,f,0.0,1.0,0.5,vcolor.y)
     
    9494PROP(stam,2,0,stamina,f,0.0,1.0,0.25,stamina)
    9595PROP(i,2,0,`info',s,,,,info)
    96 PROP(Vstyle,3,0,Visual style,s,0,0,joint,vis_style,,``See the \"Visual style definition\" context for more information'')
     96PROP(Vstyle,3,0,Visual style,s,0,-1,joint,vis_style,,``See the \"Visual style definition\" context for more information'')
    9797XPROP(vr,3,0,red component,f,0.0,1.0,0.5,vcolor.x)
    9898XPROP(vg,3,1024,green component,f,0.0,1.0,0.5,vcolor.y)
     
    108108PROP(d,1,0,details,s,,,N,details,GETSET)
    109109PROP(i,1,0,`info',s,,,,info)
    110 PROP(Vstyle,2,0,Visual style,s,0,0,neuro,vis_style,,``See the \"Visual style definition\" context for more information'')
     110PROP(Vstyle,2,0,Visual style,s,0,-1,neuro,vis_style,,``See the \"Visual style definition\" context for more information'')
    111111PROP(getInputCount,0,1+2,`input count',d,,,,inputCount,GETONLY)
    112112PROP(getInputNeuroDef,0,0,`get input neuron',p oNeuroDef(d),,,,p_getInputNeuroDef,PROCEDURE)
  • cpp/frams/config/f0.def

    r1183 r1186  
    33GROUP(Visual)
    44PROP(se,0,1024,startenergy,f,,,,startenergy)
    5 PROP(Vstyle,1,0,Visual style,s,0,0,,vis_style,,``See the \"Visual style definition\" context for more information'')
     5PROP(Vstyle,1,0,Visual style,s,0,-1,,vis_style,,``See the \"Visual style definition\" context for more information'')
    66ENDCLASS
    77
     
    2727PROP(rz,0,1024,rot.z,f,,,,rot.z)
    2828PROP(i,1,0,`info',s,,,,info)
    29 PROP(Vstyle,2,0,Visual style,s,0,0,part,vis_style,,``See the \"Visual style definition\" context for more information'')
     29PROP(Vstyle,2,0,Visual style,s,0,-1,part,vis_style,,``See the \"Visual style definition\" context for more information'')
    3030XPROP(vr,2,0,red component,f,0.0,1.0,0.5,vcolor.x)
    3131XPROP(vg,2,1024,green component,f,0.0,1.0,0.5,vcolor.y)
     
    6666PROP(stam,2,0,stamina,f,0.0,1.0,0.25,stamina)
    6767PROP(i,2,0,`info',s,,,,info)
    68 PROP(Vstyle,3,0,Visual style,s,0,0,joint,vis_style,,``See the \"Visual style definition\" context for more information'')
     68PROP(Vstyle,3,0,Visual style,s,0,-1,joint,vis_style,,``See the \"Visual style definition\" context for more information'')
    6969XPROP(vr,3,0,red component,f,0.0,1.0,0.5,vcolor.x)
    7070XPROP(vg,3,1024,green component,f,0.0,1.0,0.5,vcolor.y)
     
    9494PROP(stam,2,0,stamina,f,0.0,1.0,0.25,stamina)
    9595PROP(i,2,0,`info',s,,,,info)
    96 PROP(Vstyle,3,0,Visual style,s,0,0,joint,vis_style,,``See the \"Visual style definition\" context for more information'')
     96PROP(Vstyle,3,0,Visual style,s,0,-1,joint,vis_style,,``See the \"Visual style definition\" context for more information'')
    9797XPROP(vr,3,0,red component,f,0.0,1.0,0.5,vcolor.x)
    9898XPROP(vg,3,1024,green component,f,0.0,1.0,0.5,vcolor.y)
     
    108108PROP(d,1,0,details,s,,,N,details,GETSET)
    109109PROP(i,1,0,`info',s,,,,info)
    110 PROP(Vstyle,2,0,Visual style,s,0,0,neuro,vis_style,,``See the \"Visual style definition\" context for more information'')
     110PROP(Vstyle,2,0,Visual style,s,0,-1,neuro,vis_style,,``See the \"Visual style definition\" context for more information'')
    111111PROP(getInputCount,0,1+2,`input count',d,,,,inputCount,GETONLY)
    112112PROP(getInputNeuroDef,0,0,`get input neuron',p oNeuroDef(d),,,,p_getInputNeuroDef,PROCEDURE)
  • cpp/frams/genetics/fn/fn_oper.cpp

    r974 r1186  
    2727        { "fn_xover", 0, 0, "Fraction inherited in linear mix crossover", "f 0.5 1.0 0.9", FIELD(xover_proportion), "0.5 => children are averaged parents.\n0.8 => children are only 20% different from parents.\n1.0 => each child is identical to one parent (no crossover).", },
    2828        { "fn_xover_random", 0, 0, "Random fraction inherited in crossover", "d 0 1 1", FIELD(xover_proportion_random), "If active, the amount of linear mix is random in each crossover operation, so the \"Fraction inherited in linear mix crossover\" parameter is ignored.", },
    29         { "fn_mut_bound_low", 1, 0, "Lower bounds for mutation", "s 0 0 [-10.0, -10.0]", FIELD(mut_bound_low), "A vector of lower bounds (one real value for each variable)", },
    30         { "fn_mut_bound_high", 1, 0, "Higher bounds for mutation", "s 0 0 [10.0, 10.0]", FIELD(mut_bound_high), "A vector of higher bounds (one real value for each variable)", },
    31         { "fn_mut_stddev", 1, 0, "Standard deviations for mutation", "s 0 0 [0.1, 0.1]", FIELD(mut_stddev), "A vector of standard deviations (one real value for each variable)", },
     29        { "fn_mut_bound_low", 1, 0, "Lower bounds for mutation", "s 0 -1 [-10.0, -10.0]", FIELD(mut_bound_low), "A vector of lower bounds (one real value for each variable)", },
     30        { "fn_mut_bound_high", 1, 0, "Higher bounds for mutation", "s 0 -1 [10.0, 10.0]", FIELD(mut_bound_high), "A vector of higher bounds (one real value for each variable)", },
     31        { "fn_mut_stddev", 1, 0, "Standard deviations for mutation", "s 0 -1 [0.1, 0.1]", FIELD(mut_stddev), "A vector of standard deviations (one real value for each variable)", },
    3232        { "fn_mut_single_var", 0, 0, "Mutate only a single variable", "d 0 1 0", FIELD(mut_single_var), "If active, only a single randomly selected variable will be mutated in each mutation operation. Otherwise all variables will be mutated.", },
    3333        { 0, },
  • cpp/frams/model/f0-SDK-classes.h

    r1183 r1186  
    1010 {"Visual",},
    1111 {"se",0,1024,"startenergy","f",FIELD(startenergy),},
    12  {"Vstyle",1,0,"Visual style","s 0 0 ",FIELD(vis_style),"See the \"Visual style definition\" context for more information",},
     12 {"Vstyle",1,0,"Visual style","s 0 -1 ",FIELD(vis_style),"See the \"Visual style definition\" context for more information",},
    1313 {0,0,0,}
    1414};
     
    4444 {"rz",0,1024,"rot.z","f",FIELD(rot.z),},
    4545 {"i",1,0,"info","s",FIELD(info),},
    46  {"Vstyle",2,0,"Visual style","s 0 0 part",FIELD(vis_style),"See the \"Visual style definition\" context for more information",},
     46 {"Vstyle",2,0,"Visual style","s 0 -1 part",FIELD(vis_style),"See the \"Visual style definition\" context for more information",},
    4747 {"vr",2,0,"red component","f 0.0 1.0 0.5",FIELD(vcolor.x),},
    4848 {"vg",2,1024,"green component","f 0.0 1.0 0.5",FIELD(vcolor.y),},
     
    111111 {"stam",2,0,"stamina","f 0.0 1.0 0.25",FIELD(stamina),},
    112112 {"i",2,0,"info","s",FIELD(info),},
    113  {"Vstyle",3,0,"Visual style","s 0 0 joint",FIELD(vis_style),"See the \"Visual style definition\" context for more information",},
     113 {"Vstyle",3,0,"Visual style","s 0 -1 joint",FIELD(vis_style),"See the \"Visual style definition\" context for more information",},
    114114 {"vr",3,0,"red component","f 0.0 1.0 0.5",FIELD(vcolor.x),},
    115115 {"vg",3,1024,"green component","f 0.0 1.0 0.5",FIELD(vcolor.y),},
     
    154154 {"stam",2,0,"stamina","f 0.0 1.0 0.25",FIELD(stamina),},
    155155 {"i",2,0,"info","s",FIELD(info),},
    156  {"Vstyle",3,0,"Visual style","s 0 0 joint",FIELD(vis_style),"See the \"Visual style definition\" context for more information",},
     156 {"Vstyle",3,0,"Visual style","s 0 -1 joint",FIELD(vis_style),"See the \"Visual style definition\" context for more information",},
    157157 {"vr",3,0,"red component","f 0.0 1.0 0.5",FIELD(vcolor.x),},
    158158 {"vg",3,1024,"green component","f 0.0 1.0 0.5",FIELD(vcolor.y),},
     
    183183 {"d",1,0,"details","s",GETSET(details),},
    184184 {"i",1,0,"info","s",FIELD(info),},
    185  {"Vstyle",2,0,"Visual style","s 0 0 neuro",FIELD(vis_style),"See the \"Visual style definition\" context for more information",},
     185 {"Vstyle",2,0,"Visual style","s 0 -1 neuro",FIELD(vis_style),"See the \"Visual style definition\" context for more information",},
    186186 {"getInputCount",0,1+2,"input count","d",GETONLY(inputCount),},
    187187 {"getInputNeuroDef",0,0,"get input neuron","p oNeuroDef(d)",PROCEDURE(p_getInputNeuroDef),},
  • cpp/frams/param/param.cpp

    r1184 r1186  
    909909                //if (have == 1) return false; //not sure?
    910910                if ((have >= 1) && (!((a == 0) || (a == 1)))) return false; // 'min' for string (single/multi) can be only 0 or 1
    911                 if ((have >= 2) && (b < 0)) return false; // max=0 means unlimited, max<0 is not allowed
     911                if ((have >= 2) && (b < -1)) return false; // max=-1 means unlimited, >=0 is max len, max<-1 is not allowed
    912912        }
    913913        break;
     
    11621162        if (sscanf(t, "%d %d", &mn, &mx) == 2) //using getMinMax would also get default value, which is not needed here
    11631163        {
    1164                 if ((x.length() > mx) && (mx > 0))
     1164                if ((x.length() > mx) && (mx >= 0))
    11651165                {
    11661166                        vs = x.substr(0, mx);
Note: See TracChangeset for help on using the changeset viewer.