Ignore:
Timestamp:
05/02/23 01:36:15 (13 months ago)
Author:
Maciej Komosinski
Message:
  • Thanks to r1230, it is possible to detect (and repair=remove) junk trailing genes that are left after successful parsing (after last '>')
  • The validate() function may attempt to repair a genotype where earlier it would give up
  • Stricter parsing of the '#' gene
File:
1 edited

Legend:

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

    r1230 r1231  
    242242         * Constructor taking genotype in a form of a tree.
    243243         * @param genome genotype tree
    244          * @param nrepair 0 if nothing to repair
    245          */
    246         f4_Cells(f4_Node *genome, int nrepair);
    247 
    248         /**
    249          * Constructor taking genotype in a form of a string.
    250          * @param genome genotype string
    251          * @param nrepair 0 if nothing to repair
    252          */
    253         f4_Cells(SString &genome, int nrepair);
     244         * @param nrepair false if nothing to repair
     245         */
     246        f4_Cells(f4_Node *genome, bool nrepair);
    254247
    255248        /**
     
    336329private:
    337330        // for error reporting / genotype fixing
    338         int repair;
     331        bool repair;
    339332        int errorcode;
    340333        int errorpos;
     
    343336        f4_Node *repair_insert;
    344337        void toF1GenoRec(int curc, SString &out);
    345         f4_Cell *tmpcel;                // needed by toF1Geno
    346         f4_Node *f4rootnode;          // used by constructor
     338        f4_Cell *tmpcel;  // needed by toF1Geno
    347339};
    348340
     
    477469 * semantic aspect is neuron class name extraction, where the GenoOperators
    478470 * class is used to parse the potential neuron class name.
    479  * @param genot the string holding all the genotype
    480  * @param pos0 the current position of processing in string
     471 * This is an internal function; for regular cases, use f4_process().
     472 * @param genot the string with the entire genotype
     473 * @param pos_inout the current position of processing in string (advanced by the function)
    481474 * @param parent current parent of the analysed branch of the genotype
    482475 * @return 0 if processing was successful, otherwise returns the position of an error in the genotype
    483476 */
    484477int f4_processRecur(const char *genot, int &pos_inout, f4_Node *parent);
     478
     479/**
     480 * A wrapper for f4_processRecur(). Creates a tree of f4_Node objects corresponding to
     481 * the provided genotype.
     482 * @param genot the string with the entire genotype
     483 * @param root root of the tree corresponding to the genotype
     484 * @return 0 if processing was successful, otherwise returns the position of an error in the genotype
     485 */
     486int f4_process(const char *genot, f4_Node *root);
    485487
    486488/**
Note: See TracChangeset for help on using the changeset viewer.