Changeset 1030 for cpp/frams/genetics/fS/fS_general.h
- Timestamp:
- 11/26/20 01:30:40 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified cpp/frams/genetics/fS/fS_general.h ¶
r1017 r1030 43 43 #define FRICTION "f" 44 44 #define STIFFNESS "st" 45 #define S IZE "s"46 #define S IZE_X "x"47 #define S IZE_Y "y"48 #define S IZE_Z "z"45 #define SCALE "s" 46 #define SCALE_X "x" 47 #define SCALE_Y "y" 48 #define SCALE_Z "z" 49 49 #define ROT_X "tx" 50 50 #define ROT_Y "ty" … … 83 83 const int JOINT_COUNT = JOINTS.length(); 84 84 const string MODIFIERS = "IFS"; 85 const char S IZE_MODIFIER = 's';86 const vector<string> PARAMS {INGESTION, FRICTION, ROT_X, ROT_Y, ROT_Z, RX, RY, RZ, S IZE, SIZE_X, SIZE_Y, SIZE_Z};87 const vector<string> S IZE_PARAMS {SIZE, SIZE_X, SIZE_Y, SIZE_Z};85 const char SCALE_MODIFIER = 's'; 86 const vector<string> PARAMS {INGESTION, FRICTION, ROT_X, ROT_Y, ROT_Z, RX, RY, RZ, SCALE, SCALE_X, SCALE_Y, SCALE_Z}; 87 const vector<string> SCALE_PARAMS {SCALE, SCALE_X, SCALE_Y, SCALE_Z}; 88 88 89 89 /** @name Default values of node parameters*/ … … 247 247 struct GenotypeParams{ 248 248 double modifierMultiplier; // Every modifier changes the underlying value by this multiplier 249 /// When calculating the distance between parts, the internal result is a range of numbers 250 /// distanceTolerance is the maximal allowed size of this range 251 double distanceTolerance; 252 /// Used for deriving density for MeshBuilder 253 double relativeDensity; 254 /// 255 bool turnWithRotation; 256 /// 257 double paramMutationStrength; 249 258 }; 250 259 … … 265 274 Part *part; /// A part object built from node. Used in building the Model 266 275 int partCodeLen; /// The length of substring that directly describes the corresponding part 267 GenotypeParams genotypeParams; 276 static std::map<string, double> minValues; /// Min parameter values 277 static std::map<string, double> defaultValues; /// Default parameter values 278 static std::map<string, double> maxValues; /// Max parameter values 268 279 269 280 vector<Node *> children; /// Vector of all direct children … … 273 284 void prepareParams(); 274 285 275 double getDistance();276 277 286 void cleanUp(); 278 287 288 /// Get part's rotation 279 289 Pt3D getRotation(); 280 290 291 /// Get the rotation of vector 281 292 Pt3D getVectorRotation(); 282 293 283 bool isPartSizeValid(); 284 285 bool hasPartSizeParam(); 294 bool isPartScaleValid(); 286 295 287 296 /** … … 362 371 363 372 public: 364 static std::map<string, double> minValues;365 static std::map<string, double> defaultValues;366 static std::map<string, double> maxValues;367 373 char joint = DEFAULT_JOINT; /// Set of all joints 368 Part::Shape part Type; /// The type of the part374 Part::Shape partShape; /// The type of the part 369 375 State *state = nullptr; /// The phenotypic state that inherits from ancestors 370 376 std::map<string, double> params; /// The map of all the node params 377 GenotypeParams genotypeParams; /// Parameters that affect the whole genotype 371 378 372 379 Node(Substring &genotype, Node *parent, GenotypeParams genotypeParams); … … 381 388 382 389 /** 383 * Calculate the effective s ize of the part (after applying all multipliers and params)384 * @return The effective s ize385 */ 386 void calculateS ize(Pt3D &scale);390 * Calculate the effective scale of the part (after applying all multipliers and params) 391 * @return The effective scales 392 */ 393 void calculateScale(Pt3D &scale); 387 394 388 395 /** … … 404 411 double getParam(const string &key); 405 412 double getParam(const string &key, double defaultValue); 413 414 /// Calculate distance between the part its parent 415 double calculateDistanceFromParent(); 406 416 }; 407 417 … … 439 449 440 450 441 static int precision; 442 static bool TURN_WITH_ROTATION; 451 static int precision; /// Number of decimal places for numbers in genotype 443 452 444 453 /** … … 450 459 ~fS_Genotype(); 451 460 461 /// Calculate the State field for all the nodes 452 462 void getState(bool calculateLocation); 453 463 … … 495 505 496 506 /** 497 * Check if s izes of all parts in genotype are valid507 * Check if scales of all parts in genotype are valid 498 508 \retval error_position 1-based 499 509 \retval 0 when all part sizes are valid
Note: See TracChangeset
for help on using the changeset viewer.