Changeset 1241 for cpp/frams/genetics/genooperators.h
- Timestamp:
- 05/18/23 03:43:42 (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified cpp/frams/genetics/genooperators.h ΒΆ
r1233 r1241 215 215 static void skipWS(char *&s); ///<advances pointer \a s skipping whitespaces. 216 216 static bool areAlike(char*, char*); ///<compares two text strings skipping whitespaces. Returns 1 when equal, 0 when different. 217 static char* strchrn0(const char *str, char ch); ///<like strchr, but does not find zerochar in \a str.217 static char* strchrn0(const char *str, char ch); ///<like strchr, but does not find ascii=0 char in \a str. 218 218 219 219 static int getRandomChar(const char *choices, const char *excluded); ///<returns index of a random character from \a choices excluding \a excluded, or -1 when everything is excluded or \a choices is empty. 220 static string simplifiedModifiers (const char *str_of_char_pairs, vector<int> &char_counts); ///<returns a sequence of chars from \a str_of_char_pairs based on how many times each char occurred in \a char_counts. Assume that an even-index char and the following odd-index char have the opposite influence, so they cancel out.220 static string simplifiedModifiersFixedOrder(const char *str_of_char_pairs, vector<int> &char_counts); ///<returns a sequence of chars from \a str_of_char_pairs based on how many times each char occurred in \a char_counts. Assume that an even-index char and the following odd-index char have the opposite influence, so they cancel out. We don't use this function, because a fixed order imposed by this function means that the number of different parameter values produced by a sequence of modifiers is lowered (N same-letter upper- and lower-case chars yield only 2*N different values). Due to how modifiers work, the effect of aaA, aAa, Aaa etc. is different (N same-letter upper- and lower-case chars yield 2^N different values), so simplifying modifiers should not impose any order and should not interfere with their original order - see \a simplifiedModifiers(). 221 221 //@} 222 static string simplifiedModifiers(const string &original); ///<from the \a original sequence removes modifiers that are too numerous (exceeding a defined threshold number), starting the removal from the leftmost (="oldest" when interpreting the sequence from left to right) ones. 222 223 }; 223 224
Note: See TracChangeset
for help on using the changeset viewer.