Changeset 247 for cpp/frams/genetics/oper_fx.cpp
- Timestamp:
- 11/07/14 17:51:01 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/frams/genetics/oper_fx.cpp
r197 r247 58 58 if (p->type(i)[0] == 'd') 59 59 { 60 long_mn = 0, _mx = 1, _def = 0;60 paInt _mn = 0, _mx = 1, _def = 0; 61 61 defined = p->getMinMax(i, _mn, _mx, _def); 62 62 if (defined == 1) _mx = _mn + 1; … … 150 150 void GenoOperators::setIntFromDoubleWithProbabilisticDithering(ParamInterface &p, int index, double value) //TODO 151 151 { 152 p.setInt(index, value); //TODO value=2.5 will result in 2 but we want it to be 2 or 3 with equal probability. value=2.1 would be mostly 2, rarely 3. Careful with negative values (test it!)152 p.setInt(index, (paInt)value); //TODO value=2.5 will result in 2 but we want it to be 2 or 3 with equal probability. value=2.1 would be mostly 2, rarely 3. Careful with negative values (test it!) 153 153 } 154 154 … … 187 187 NeuroClass* GenoOperators::parseNeuroClass(char*& s) 188 188 { 189 int len = strlen(s);189 int len = (int)strlen(s); 190 190 int Len = 0; 191 191 NeuroClass *I = NULL; … … 193 193 { 194 194 const char *n = Neuro::getClass(i)->name; 195 int l = strlen(n);195 int l = (int)strlen(n); 196 196 if (len >= l && l>Len && (strncmp(s, n, l) == 0)) { I = Neuro::getClass(i); Len = l; } 197 197 } … … 210 210 int GenoOperators::neuroClassProp(char*& s, NeuroClass *nc, bool also_v1_N_props) 211 211 { 212 int len = strlen(s);212 int len = (int)strlen(s); 213 213 int Len = 0, I = -1; 214 214 if (nc) … … 218 218 { 219 219 const char *n = p.id(i); 220 int l = strlen(n);220 int l = (int)strlen(n); 221 221 if (len >= l && l>Len && (strncmp(s, n, l) == 0)) { I = 100 + i; Len = l; } 222 222 if (also_v1_N_props) //recognize old properties symbols /=! … … 225 225 if (strcmp(n, "in") == 0) n = "="; else 226 226 if (strcmp(n, "fo") == 0) n = "!"; 227 l = strlen(n);227 l = (int)strlen(n); 228 228 if (len >= l && l > Len && (strncmp(s, n, l) == 0)) { I = 100 + i; Len = l; } 229 229 } … … 235 235 { 236 236 const char *n = p.id(i); 237 int l = strlen(n);237 int l = (int)strlen(n); 238 238 if (len >= l && l>Len && (strncmp(s, n, l) == 0)) { I = i; Len = l; } 239 239 }
Note: See TracChangeset
for help on using the changeset viewer.