Ignore:
Timestamp:
05/18/23 03:43:42 (11 months ago)
Author:
Maciej Komosinski
Message:

No longer sort modifiers and cancel out antagonistic modifiers in f1 and f4; simplifying modifier sequences is now much less intrusive to allow for 2N distinct values of properties instead of only 2*N that resulted from earlier forced ordering (N is the number of same-letter upper- and lower-case characters in a modifier sequence)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpp/frams/genetics/f4/f4_general.cpp

    r1240 r1241  
    13631363                        // in the future this could be generalized to all neuron properties, for example N:|:power:0.6:range:1.4, or can even use '=' or ',' instead of ':' if no ambiguity
    13641364                        char prop_dir, prop_symbol, prop_end[2]; // prop_end is only to ensure that neuron parameter definition is completed
    1365                         if (sscanf(genot + pos_inout, ":%c%c%1[:]", &prop_dir, &prop_symbol, &prop_end) != 3)
     1365                        if (sscanf(genot + pos_inout, ":%c%c%1[:]", &prop_dir, &prop_symbol, prop_end) != 3)
    13661366                                // error: incorrect format
    13671367                                return pos_inout + 1 + 1;
     
    14021402#ifdef F4_SIMPLIFY_MODIFIERS
    14031403                        char *ptr = (char*)(genot + pos_inout);
    1404 
    1405 #ifdef __BORLANDC__ // "[bcc32c Error] cannot compile this non-trivial TLS destruction yet" (C++B 10.4u2)
    1406                         static
    1407 #else
    1408                         thread_local
    1409 #endif
    1410                                 vector<int> modifs_counts(strlen(all_modifiers_no_comma)); ///<an array with a known constant size storing counters of each modifier symbol from all_modifiers_no_comma, created once to avoid reallocation every time when modifier genes are simplified during parsing. Initialization of required size; it will never be resized.
    1411                         std::fill(modifs_counts.begin(), modifs_counts.end(), 0); //zeroing only needed if we encountered a char from all_modifiers_no_comma and enter the 'while' loop below
    1412 
    1413                         while (char *m = GenoOperators::strchrn0(all_modifiers_no_comma, *ptr)) //only processes a section of chars known in all_modifiers_no_comma, other characters will exit the loop
    1414                         {
    1415                                 modifs_counts[m - all_modifiers_no_comma]++;
     1404                        string original = "";
     1405                        while (GenoOperators::strchrn0(all_modifiers_no_comma, *ptr)) //only processes a section of chars known in all_modifiers_no_comma, other characters will exit the loop
     1406                        {
     1407                                original += *ptr;
    14161408                                GenoOperators::skipWS(++ptr); //advance and ignore whitespace
    14171409                        }
     
    14191411                        if (advanced > 0) //found modifiers
    14201412                        {
    1421                                 string simplified = GenoOperators::simplifiedModifiers(all_modifiers_no_comma, modifs_counts);
     1413                                string simplified = GenoOperators::simplifiedModifiers(original);
    14221414                                // add a node for each char in "simplified"
    14231415                                for (size_t i = 0; i < simplified.length(); i++)
Note: See TracChangeset for help on using the changeset viewer.