Ignore:
Timestamp:
07/11/24 17:15:51 (4 months ago)
Author:
Maciej Komosinski
Message:

Color mutations in f1 and f4, and a new syntax for "allowed modifiers" (opposite to previous "excluded modifiers") with optional probabilities for each modifier

File:
1 edited

Legend:

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

    r1259 r1313  
    11// This file is a part of Framsticks SDK.  http://www.framsticks.com/
    2 // Copyright (C) 1999-2023  Maciej Komosinski and Szymon Ulatowski.
     2// Copyright (C) 1999-2024  Maciej Komosinski and Szymon Ulatowski.
    33// See LICENSE.txt for details.
    44
     
    14141414                        char *ptr = (char*)(genot + pos_inout);
    14151415                        string original = "";
    1416                         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
     1416                        while (GenoOperators::strchr_no0(all_modifiers_no_comma, *ptr)) //only processes a section of chars known in all_modifiers_no_comma, other characters will exit the loop
    14171417                        {
    14181418                                original += *ptr;
     
    14221422                        if (advanced > 0) //found modifiers
    14231423                        {
    1424                                 string simplified = GenoOperators::simplifiedModifiers(original);
     1424                                string simplified = GenoOperators::simplifiedModifiers(original, F14_MODIFIERS_COLOR);
    14251425                                // add a node for each char in "simplified"
    14261426                                for (size_t i = 0; i < simplified.length(); i++)
    14271427                                {
    1428                                         int pos = GenoOperators::strchrn0(genot + pos_inout, simplified[i]) - genot; //unnecessarily finding the same char, if it occurrs multiple times in simplified
     1428                                        int pos = GenoOperators::strchr_no0(genot + pos_inout, simplified[i]) - genot; //unnecessarily finding the same char, if it occurrs multiple times in simplified
    14291429                                        f4_Node *node = new f4_Node(simplified[i], par, pos); //location is approximate. In the simplification process we don't trace where the origin(s) of the simplified[i] gene were. We provide 'pos' as the first occurrence of simplified[i] (for example, all 'L' will have the same location assigned, but at least this is where 'L' occurred in the genotype, so in case of any modification of a node (repair, removal, whatever... even mapping of genes) the indicated gene will be one of the responsible ones)
    14301430                                        par = node;
Note: See TracChangeset for help on using the changeset viewer.