Changeset 1248 for cpp


Ignore:
Timestamp:
05/21/23 23:03:45 (20 months ago)
Author:
Maciej Komosinski
Message:

Less duplicated constants (default values of Part and Joint properties)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpp/frams/genetics/geneprops.cpp

    r1246 r1248  
    1010GeneProps::GeneProps()
    1111{
     12        Part_MinMaxDef default_part = Model::getDefPart();
     13        Joint default_joint = Model::getDefJoint();
     14
    1215        length = 1.0;
    1316        weight = 1.0;
    14         friction = 0.4;
     17        friction = default_part.friction;
    1518        curvedness = 0.0;
    1619        twist = 0.0;
    1720        energy = 1.0;
    1821
    19         muscle_power = 0.25; // "biological" property
    20         assimilation = 0.25; // "biological" property
    21         stamina = 0.25; // "biological" property
    22         ingestion = 0.25; // "biological" property
    23 
    24         muscle_bend_range = 1.0;
     22        // before 2023-05, the four fields below were aggregated and normalized using normalizeBiol4(), but this normalization only worked for f1 and f4 - other genetic encodings do not perform such normalization. If at all, this should be handled by the expdef depending on the goal of the experiment (e.g., to encourage specialization).
     23        muscle_power = 0.25; // "biological" property, same as findNeuroClass("BendMuscle or RotMuscle")->paraminterface->getDoubleById("power")
     24        assimilation = default_part.assim; // "biological" property
     25        stamina = default_joint.stamina; // "biological" property
     26        ingestion = default_part.ingest; // "biological" property
     27
     28        muscle_bend_range = 1.0; // same as findNeuroClass("BendMuscle")->paraminterface->getDoubleById("range")
    2529        muscle_reset_range = true;
    2630
    27         cred = 0.5;
    28         cgreen = 0.5;
    29         cblue = 0.5;
    30 
    31         normalizeBiol4();
     31        cred = default_part.vcolor.x;
     32        cgreen = default_part.vcolor.y;
     33        cblue = default_part.vcolor.z;
    3234}
    3335
Note: See TracChangeset for help on using the changeset viewer.