- Timestamp:
- 05/06/25 22:56:57 (2 days ago)
- Location:
- cpp/frams/genetics
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/frams/genetics/f1/f1_conv.cpp
r1302 r1335 1 1 // This file is a part of Framsticks SDK. http://www.framsticks.com/ 2 // Copyright (C) 1999-202 3Maciej Komosinski and Szymon Ulatowski.2 // Copyright (C) 1999-2025 Maciej Komosinski and Szymon Ulatowski. 3 3 // See LICENSE.txt for details. 4 4 … … 136 136 Builder builder(settings, g, map ? 1 : 0); 137 137 builder.model.open(using_checkpoints); 138 builder.grow(-1, g, Pt3D_0, GeneProps:: standard_values, -1); // uses Model::addFromString() to create model elements138 builder.grow(-1, g, Pt3D_0, GeneProps::get_standard_values(), -1); // uses Model::addFromString() to create model elements 139 139 if (builder.invalid) return SString(); 140 140 builder.addPendingInputs(); -
cpp/frams/genetics/f4/f4_general.cpp
r1313 r1335 1 1 // This file is a part of Framsticks SDK. http://www.framsticks.com/ 2 // Copyright (C) 1999-202 4Maciej Komosinski and Szymon Ulatowski.2 // Copyright (C) 1999-2025 Maciej Komosinski and Szymon Ulatowski. 3 3 // See LICENSE.txt for details. 4 4 … … 642 642 643 643 // create ancestor cell 644 C[0] = new f4_Cell(this, 0, genome, genome, NULL, 0, GeneProps:: standard_values);644 C[0] = new f4_Cell(this, 0, genome, genome, NULL, 0, GeneProps::get_standard_values()); 645 645 cell_count = 1; 646 646 development_stagnation = false; … … 882 882 { 883 883 if (tmpcel) delete tmpcel; 884 tmpcel = new f4_Cell(-1, NULL, 0, GeneProps:: standard_values);884 tmpcel = new f4_Cell(-1, NULL, 0, GeneProps::get_standard_values()); 885 885 out = ""; 886 886 toF1GenoRec(0, out); -
cpp/frams/genetics/geneprops.cpp
r1260 r1335 1 1 // This file is a part of Framsticks SDK. http://www.framsticks.com/ 2 // Copyright (C) 1999-202 3Maciej Komosinski and Szymon Ulatowski.2 // Copyright (C) 1999-2025 Maciej Komosinski and Szymon Ulatowski. 3 3 // See LICENSE.txt for details. 4 4 … … 6 6 #include <algorithm> 7 7 8 GeneProps GeneProps::standard_values; 8 9 const GeneProps& GeneProps::get_standard_values() //this getter function ensures controlled initialization of the static standard_values object 10 { 11 static GeneProps standard_values; 12 return standard_values; 13 } 9 14 10 15 GeneProps::GeneProps() … … 94 99 void GeneProps::propagateAlong(bool use_f1_muscle_reset_range, GenePropsOps* ops) 95 100 { 101 const GeneProps& standard_values = get_standard_values(); 96 102 length = 0.5 * length + 0.5 * standard_values.length; 97 103 weight += (standard_values.weight - weight) * 0.5; … … 202 208 GenePropsOps_Legacy::GenePropsOps_Legacy() 203 209 { 210 const GeneProps& standard_values = GeneProps::get_standard_values(); 211 204 212 use_normalizebiol4 = true; 205 213 206 length = new GenePropsOp_Legacy(0.33, 2.0, GeneProps::standard_values.length, 0.3);207 weight = new GenePropsOp_Legacy(0.5, 2.0, GeneProps::standard_values.weight, 0.3);208 friction = new GenePropsOp_Legacy(0, 4.0, GeneProps::standard_values.friction, 0.2);209 curvedness = new GenePropsOp_Legacy(-2, 2, GeneProps::standard_values.curvedness, 0.25);210 twist = new GenePropsOp_Legacy(-M_PI_2, M_PI_2, GeneProps::standard_values.twist, 0.3);211 energy = new GenePropsOp_Legacy(0, 10, GeneProps::standard_values.energy, 0.1);212 213 assimilation = new GenePropsOp_Legacy(0, 1, GeneProps::standard_values.assimilation, 0.8, 0.4);214 ingestion = new GenePropsOp_Legacy(0, 1, GeneProps::standard_values.ingestion, 0.8, 0.4);215 stamina = new GenePropsOp_Legacy(0, 1, GeneProps::standard_values.stamina, 0.8, 0.4);216 muscle_power = new GenePropsOp_Legacy(0, 1, GeneProps::standard_values.muscle_power, 0.8, 0.4);217 218 cred = new GenePropsOp_Legacy(0, 1, GeneProps::standard_values.cred, 0.25);219 cgreen = new GenePropsOp_Legacy(0, 1, GeneProps::standard_values.cgreen, 0.25);220 cblue = new GenePropsOp_Legacy(0, 1, GeneProps::standard_values.cblue, 0.25);214 length = new GenePropsOp_Legacy(0.33, 2.0, standard_values.length, 0.3); 215 weight = new GenePropsOp_Legacy(0.5, 2.0, standard_values.weight, 0.3); 216 friction = new GenePropsOp_Legacy(0, 4.0, standard_values.friction, 0.2); 217 curvedness = new GenePropsOp_Legacy(-2, 2, standard_values.curvedness, 0.25); 218 twist = new GenePropsOp_Legacy(-M_PI_2, M_PI_2, standard_values.twist, 0.3); 219 energy = new GenePropsOp_Legacy(0, 10, standard_values.energy, 0.1); 220 221 assimilation = new GenePropsOp_Legacy(0, 1, standard_values.assimilation, 0.8, 0.4); 222 ingestion = new GenePropsOp_Legacy(0, 1, standard_values.ingestion, 0.8, 0.4); 223 stamina = new GenePropsOp_Legacy(0, 1, standard_values.stamina, 0.8, 0.4); 224 muscle_power = new GenePropsOp_Legacy(0, 1, standard_values.muscle_power, 0.8, 0.4); 225 226 cred = new GenePropsOp_Legacy(0, 1, standard_values.cred, 0.25); 227 cgreen = new GenePropsOp_Legacy(0, 1, standard_values.cgreen, 0.25); 228 cblue = new GenePropsOp_Legacy(0, 1, standard_values.cblue, 0.25); 221 229 } 222 230 223 231 GenePropsOps_AllChange05::GenePropsOps_AllChange05() 224 232 { 233 const GeneProps& standard_values = GeneProps::get_standard_values(); 234 225 235 use_normalizebiol4 = false; 226 236 … … 235 245 236 246 delete curvedness; 237 curvedness = new GenePropsOp_Legacy(-M_PI_2, M_PI_2, GeneProps::standard_values.curvedness, CHANGE);247 curvedness = new GenePropsOp_Legacy(-M_PI_2, M_PI_2, standard_values.curvedness, CHANGE); 238 248 } 239 249 240 250 GenePropsOps_Exponential::GenePropsOps_Exponential() 241 251 { 242 length = new GenePropsOp_Exponential(0.33, 2.0, GeneProps::standard_values.length); 243 weight = new GenePropsOp_Exponential(0.5, 2.0, GeneProps::standard_values.weight); 244 friction = new GenePropsOp_Exponential(0, 4.0, GeneProps::standard_values.friction); 245 curvedness = new GenePropsOp_Exponential(-2, 2, GeneProps::standard_values.curvedness); 246 twist = new GenePropsOp_Exponential(-M_PI_2, M_PI_2, GeneProps::standard_values.twist); 247 energy = new GenePropsOp_Exponential(0, 10, GeneProps::standard_values.energy); 248 249 assimilation = new GenePropsOp_Exponential(0, 1, GeneProps::standard_values.assimilation); 250 ingestion = new GenePropsOp_Exponential(0, 1, GeneProps::standard_values.ingestion); 251 stamina = new GenePropsOp_Exponential(0, 1, GeneProps::standard_values.stamina); 252 muscle_power = new GenePropsOp_Exponential(0, 1, GeneProps::standard_values.muscle_power); 253 254 cred = new GenePropsOp_Exponential(0, 1, GeneProps::standard_values.cred); 255 cgreen = new GenePropsOp_Exponential(0, 1, GeneProps::standard_values.cgreen); 256 cblue = new GenePropsOp_Exponential(0, 1, GeneProps::standard_values.cblue); 252 const GeneProps& standard_values = GeneProps::get_standard_values(); 253 length = new GenePropsOp_Exponential(0.33, 2.0, standard_values.length); 254 weight = new GenePropsOp_Exponential(0.5, 2.0, standard_values.weight); 255 friction = new GenePropsOp_Exponential(0, 4.0, standard_values.friction); 256 curvedness = new GenePropsOp_Exponential(-2, 2, standard_values.curvedness); 257 twist = new GenePropsOp_Exponential(-M_PI_2, M_PI_2, standard_values.twist); 258 energy = new GenePropsOp_Exponential(0, 10, standard_values.energy); 259 260 assimilation = new GenePropsOp_Exponential(0, 1, standard_values.assimilation); 261 ingestion = new GenePropsOp_Exponential(0, 1, standard_values.ingestion); 262 stamina = new GenePropsOp_Exponential(0, 1, standard_values.stamina); 263 muscle_power = new GenePropsOp_Exponential(0, 1, standard_values.muscle_power); 264 265 cred = new GenePropsOp_Exponential(0, 1, standard_values.cred); 266 cgreen = new GenePropsOp_Exponential(0, 1, standard_values.cgreen); 267 cblue = new GenePropsOp_Exponential(0, 1, standard_values.cblue); 257 268 } 258 269 -
cpp/frams/genetics/geneprops.h
r1313 r1335 1 1 // This file is a part of Framsticks SDK. http://www.framsticks.com/ 2 // Copyright (C) 1999-202 4Maciej Komosinski and Szymon Ulatowski.2 // Copyright (C) 1999-2025 Maciej Komosinski and Szymon Ulatowski. 3 3 // See LICENSE.txt for details. 4 4 … … 143 143 double cblue; ///<incremented by G, decremented by g. Part's blue color proportion 144 144 145 static GeneProps standard_values;145 static const GeneProps& get_standard_values(); 146 146 147 147 static GenePropsOps* getDefaultOps();
Note: See TracChangeset
for help on using the changeset viewer.