- Timestamp:
- 03/28/18 02:33:11 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/frams/genetics/oper_fx.cpp
r764 r765 51 51 double _mn = 0, _mx = 1, _def = 0.5; 52 52 defined = p->getMinMaxDouble(i, _mn, _mx, _def); 53 if (defined == 1) _mx = _mn + 1.0; 54 if (_mx < _mn && defined == 3) _mn = _mx = _def; //only default was defined, let's assume min=max=default 53 if (defined == 1) _mx = _mn + 1000.0; //only min was defined, so let's set some arbitrary range, just to have some freedom. Assumes _mn is not close to maxdouble... 54 if (_mx < _mn && defined == 3) //only default was defined, so let's assume some arbitrary range. Again, no check for min/maxdouble... 55 { 56 _mn = _def - 500.0; 57 _mx = _def + 500.0; 58 } 55 59 if (defined < 3) _def = (_mn + _mx) / 2.0; 56 60 mn = _mn; mx = _mx; def = _def; … … 60 64 paInt _mn = 0, _mx = 1, _def = 0; 61 65 defined = p->getMinMaxInt(i, _mn, _mx, _def); 62 if (defined == 1) _mx = _mn + 1; 63 if (_mx < _mn && defined == 3) _mn = _mx = _def; //only default was defined, let's assume min=max=default 66 if (defined == 1) _mx = _mn + 1000; //only min was defined, so let's set some arbitrary range, just to have some freedom. Assumes _mn is not close to maxint... 67 if (_mx < _mn && defined == 3) //only default was defined, so let's assume some arbitrary range. Again, no check for min/maxint... 68 { 69 _mn = _def - 500; 70 _mx = _def + 500; 71 } 64 72 if (defined < 3) _def = (_mn + _mx) / 2; 65 73 mn = _mn; mx = _mx; def = _def;
Note: See TracChangeset
for help on using the changeset viewer.