Ignore:
Timestamp:
06/22/23 03:52:39 (11 months ago)
Author:
Maciej Komosinski
Message:

f4: three #define's -> enum, minor refactorizations, added comments

File:
1 edited

Legend:

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

    r1249 r1259  
    3333class f4_Cells;  // later
    3434
    35 
    36 /** @name Types of f4_Cell's */
    37 //@{
    38 #define CELL_UNDIFF 40 ///<undifferentiated cell
    39 #define CELL_STICK  41 ///<differentiated to stick, cannot divide
    40 #define CELL_NEURON 42 ///<differentiated to neuron, can divide
    41 //@}
    42 
     35enum class f4_Cell_type {
     36        CELL_UNDIFF, ///<undifferentiated cell
     37        CELL_STICK,  ///<differentiated to stick, cannot divide
     38        CELL_NEURON  ///<differentiated to neuron, can divide
     39};
    4340
    4441class f4_CellConn;
     
    154151         * at least once. If one cell requires another one to develop, oneStep
    155152         * should be deployed again on this cell.
    156          * 
     153         *
    157154         * This method, unlike genotype tree creation, checks semantics. This means that
    158155         * this function will fail (set error code) if:
     
    184181
    185182        int        nr;                 ///<number of cell (seems to be used only in the approximate f1 converter for neuron connections)
    186         int        type;               ///<type
     183        f4_Cell_type type;             ///<type
    187184        f4_Cell *dadlink;              ///<pointer to cell parent
    188185        f4_Cells  *org;                ///<uplink to organism
     
    462459 * @return a pointer to the f4_Node object representing the f4 tree root
    463460 */
    464 //f4_Node* f4_processTree(const char *geno);
    465 
    466 /**
    467  * Scans a genotype string starting from a given position. This recursive method creates
    468  * a tree of f4_Node objects. This method extracts each potentially functional element
    469  * of a genotype string to a separate f4_Nodes. When the branching character '<' occurs,
    470  * f4_processRecur is deployed for the latest f4_Node element. This method does not
    471  * analyse the genotype semantically, it only checks if the syntax is proper. The only
    472  * semantic aspect is neuron class name extraction, where the GenoOperators
    473  * class is used to parse the potential neuron class name.
    474  * This is an internal function; for regular cases, use f4_process().
    475  * @param genot the string with the entire genotype
    476  * @param genot_len length of genot (precomputed for efficiency)
    477  * @param pos_inout the current position of processing in string (advanced by the function)
    478  * @param parent current parent of the analysed branch of the genotype
    479  * @return 0 if processing was successful, otherwise returns the position of an error in the genotype
    480  */
     461 //f4_Node* f4_processTree(const char *geno);
     462
     463 /**
     464  * Scans a genotype string starting from a given position. This recursive method creates
     465  * a tree of f4_Node objects. This method extracts each potentially functional element
     466  * of a genotype string to a separate f4_Nodes. When the branching character '<' occurs,
     467  * f4_processRecur is deployed for the latest f4_Node element. This method does not
     468  * analyse the genotype semantically, it only checks if the syntax is proper. The only
     469  * semantic aspect is neuron class name extraction, where the GenoOperators
     470  * class is used to parse the potential neuron class name.
     471  * This is an internal function; for regular cases, use f4_process().
     472  * @param genot the string with the entire genotype
     473  * @param genot_len length of genot (precomputed for efficiency)
     474  * @param pos_inout the current position of processing in string (advanced by the function)
     475  * @param parent current parent of the analysed branch of the genotype
     476  * @return 0 if processing was successful, otherwise returns the position of an error in the genotype
     477  */
    481478int f4_processRecur(const char *genot, const int genot_len, int &pos_inout, f4_Node *parent);
    482479
Note: See TracChangeset for help on using the changeset viewer.