Changeset 1257 for cpp/frams/genetics
- Timestamp:
- 06/22/23 03:47:26 (18 months ago)
- Location:
- cpp/frams/genetics/fH
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/frams/genetics/fH/fH_general.cpp
r973 r1257 1 1 // This file is a part of Framsticks SDK. http://www.framsticks.com/ 2 // Copyright (C) 1999-202 0Maciej Komosinski and Szymon Ulatowski.2 // Copyright (C) 1999-2023 Maciej Komosinski and Szymon Ulatowski. 3 3 // See LICENSE.txt for details. 4 4 … … 16 16 // Methods for loading handles 17 17 18 const char *fH_part_names[FH_PART_PROPS_COUNT] = { " dn", "fr", "ing", "as" };19 20 const char *fH_joint_names[FH_JOINT_PROPS_COUNT] = { "stif", "rotstif" , "stam" };18 const char *fH_part_names[FH_PART_PROPS_COUNT] = { "fr" }; // , "dn", "ing", "as" }; 19 20 const char *fH_joint_names[FH_JOINT_PROPS_COUNT] = { "stif", "rotstif" }; //, "stam" }; 21 21 22 22 void fH_Handle::loadProperties(Param par) … … 376 376 model->addPart(newpart); 377 377 378 newpart-> density = partprops[0];379 newpart->friction= partprops[1];380 newpart->ingest = partprops[2];381 newpart->assim = partprops[3];378 newpart->friction = partprops[0]; //Macko 2023-06: TODO partprops[0] is different from par.getDoubleById("fr"); (and par.getDoubleById() is used in createJoint() below, investigate why this difference and whether hardcoded references to fields like here could be avoided? Only use fH_part_names if possible.) 379 //newpart->density = partprops[1]; 380 //newpart->ingest = partprops[2]; 381 //newpart->assim = partprops[3]; 382 382 383 383 if (createmapping) newpart->addMapping(ranges); … … 399 399 newjoint->stif = par.getDoubleById("stif"); 400 400 newjoint->rotstif = par.getDoubleById("rotstif"); 401 newjoint->stamina = par.getDoubleById("stam");401 //newjoint->stamina = par.getDoubleById("stam"); 402 402 newjoint->attachToParts(firstpart, secondpart); 403 403 if (createmapping) newjoint->addMapping(IRange(begin, end)); -
cpp/frams/genetics/fH/fH_general.h
r1167 r1257 1 1 // This file is a part of Framsticks SDK. http://www.framsticks.com/ 2 // Copyright (C) 1999-202 0Maciej Komosinski and Szymon Ulatowski.2 // Copyright (C) 1999-2023 Maciej Komosinski and Szymon Ulatowski. 3 3 // See LICENSE.txt for details. 4 4 … … 18 18 #define HANDLE_VECTOR_TYPE "f -1.0 1.0 0.0" ///<Vector values type definition 19 19 #define STICKH_LENGTH_TYPE "f 0.001 1.999 1.0" ///<Length of stick handle. Minimum should not be equal to 0, because calculating direction of next part from current stick with length 0 would be impossible 20 #define FH_PART_PROPS_COUNT 4///<Count of part properties21 #define FH_JOINT_PROPS_COUNT 3///<Count of joint properties20 #define FH_PART_PROPS_COUNT 1 ///<Count of part properties 21 #define FH_JOINT_PROPS_COUNT 2 ///<Count of joint properties 22 22 #define FH_PE_NEURO_DET "d" ///<Id of details type definition in f0_neuro_paramtab 23 23 #define FH_PE_CONN_WEIGHT "w" ///<Id of weight type definition in f0_neuroconn_paramtab … … 118 118 * - double stif - joint property of a stick representing stiffness 119 119 * - double rotstif - joint property of a stick representing rotation stiffness 120 * - double stamina - joint property of a stick representing stamina 121 * - double density - parts property of a stick representing density 120 * //- double stamina - joint property of a stick representing stamina 122 121 * - double friction - parts property of a stick representing friction 123 * - double ingest - parts property of a stick representing ingestion 124 * - double assimilation - parts property of a stick representing assimilation 122 * //- double density - parts property of a stick representing density 123 * //- double ingest - parts property of a stick representing ingestion 124 * //- double assimilation - parts property of a stick representing assimilation 125 125 * - double length - length of a stick 126 126 */ -
cpp/frams/genetics/fH/fH_oper.cpp
r1215 r1257 14 14 { 15 15 { "Genetics: fH", 1, FH_OPCOUNT + FH_ADD_OPCOUNT, }, 16 { "fH_mut_addition", 0, 0, "Add element", "f 0 1 0.3", FIELD(operations[FH_ADD]), "Probability of adding new element to genotype", },17 { "fH_mut_add_joint", 0, 0, " - add joint", "f 0 1 0.33", FIELD(addoperations[FH_ADD_STICK]), "Probability of adding new stick handle", },18 { "fH_mut_add_neuron", 0, 0, " - add neuron", "f 0 1 0.33", FIELD(addoperations[FH_ADD_NEURO]), "Probability of adding new neuron handle", },19 { "fH_mut_add_connection", 0, 0, " - add neural connection", "f 0 1 0.33", FIELD(addoperations[FH_ADD_CONN]), "Probability of adding new neuron connection handle", },20 { "fH_mut_deletion", 0, 0, "Delete element", "f 0 1 0.1", FIELD(operations[FH_DEL]), "Probability of removing element from genotype", },21 { "fH_mut_handle", 0, 0, "Modify vectors of handles", "f 0 1 0.3", FIELD(operations[FH_HANDLE]), "Probability of changing values in vectors of handle", },22 { "fH_mut_property", 0, 0, "Modify properties of handles", "f 0 1 0.3", FIELD(operations[FH_PROP]), "Probability of changing properties of handles", },16 { "fH_mut_addition", 0, 0, "Add element", "f 0 100 30", FIELD(operations[FH_ADD]), "Probability of adding new element to genotype", }, 17 { "fH_mut_add_joint", 0, 0, " - add joint", "f 0 100 33", FIELD(addoperations[FH_ADD_STICK]), "Probability of adding new stick handle", }, 18 { "fH_mut_add_neuron", 0, 0, " - add neuron", "f 0 100 33", FIELD(addoperations[FH_ADD_NEURO]), "Probability of adding new neuron handle", }, 19 { "fH_mut_add_connection", 0, 0, " - add neural connection", "f 0 100 33", FIELD(addoperations[FH_ADD_CONN]), "Probability of adding new neuron connection handle", }, 20 { "fH_mut_deletion", 0, 0, "Delete element", "f 0 100 10", FIELD(operations[FH_DEL]), "Probability of removing element from genotype", }, 21 { "fH_mut_handle", 0, 0, "Modify vectors of handles", "f 0 100 30", FIELD(operations[FH_HANDLE]), "Probability of changing values in vectors of handle", }, 22 { "fH_mut_property", 0, 0, "Modify properties of handles", "f 0 100 30", FIELD(operations[FH_PROP]), "Probability of changing properties of handles", }, 23 23 { 0, }, 24 24 };
Note: See TracChangeset
for help on using the changeset viewer.