Changeset 1247 for cpp/frams/genetics/genooperators.cpp
- Timestamp:
- 05/21/23 22:52:02 (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified cpp/frams/genetics/genooperators.cpp ¶
r1243 r1247 4 4 5 5 #include <ctype.h> //isupper() 6 #include <algorithm> // std::min, std::max 6 7 #include "genooperators.h" 7 8 #include <common/log.h> 8 9 #include <common/nonstd_math.h> 9 10 #include <frams/util/rndutil.h> 10 #include <algorithm> // std::min, std::max11 11 12 12 // … … 537 537 string GenoOperators::simplifiedModifiers(const string & original) 538 538 { 539 const int MAX_NUMBER_SAME_TYPE = 6; // max. number of modifiers of each type (case-insensitive). rR is treated separately in simplification because their influence follows different (i.e., simple additive) logic - so the simplifiedModifiersFixedOrder() logic with cancelling out antagonistic modifiers isappropriate for rR.539 const int MAX_NUMBER_SAME_TYPE = 5; // max. number of modifiers of each type (case-insensitive). The more characters, the closer we can get to min and max values of a given property at the expense of the length of evolved genotypes. 5 is "close enough", but how close we get to the extreme also depends on the initial value of a given property, which is not always exactly in the middle of min and max. rR is treated separately in simplification because their influence follows different (i.e., simple additive) logic - so the simplifiedModifiersFixedOrder() logic with cancelling out antagonistic modifiers would be appropriate for rR. 540 540 int counter[256] = {}; //initialize with zeros; 256 is unnecessarily too big and redundant, but enables very fast access (indexed directly by the ascii code) 541 541 string simplified = "";
Note: See TracChangeset
for help on using the changeset viewer.