Changeset 1006 for cpp/frams/genetics/fS/fS_general.h
- Timestamp:
- 07/14/20 16:04:46 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/frams/genetics/fS/fS_general.h
r1000 r1006 27 27 const char NEURON_END = ']'; 28 28 const char NEURON_SEPARATOR = ';'; 29 const SString NEURON_INTERNAL_SEPARATOR(" _");29 const SString NEURON_INTERNAL_SEPARATOR("'"); 30 30 #define NEURON_I_W_SEPARATOR ':' 31 31 //@} … … 69 69 const char CUBOID = 'C'; 70 70 const char CYLINDER = 'R'; 71 const std::unordered_map<Part::Shape, char> SHAPE TYPE_TO_GENE = {71 const std::unordered_map<Part::Shape, char> SHAPE_TO_GENE = { 72 72 {Part::Shape::SHAPE_ELLIPSOID, ELLIPSOID}, 73 73 {Part::Shape::SHAPE_CUBOID, CUBOID}, … … 76 76 77 77 // This map is inverse to SHAPE_TO_SYMBOL. Those two should be compatible 78 const std::unordered_map<char, Part::Shape> GENE_TO_SHAPE TYPE= {78 const std::unordered_map<char, Part::Shape> GENE_TO_SHAPE = { 79 79 {ELLIPSOID, Part::Shape::SHAPE_ELLIPSOID}, 80 80 {CUBOID, Part::Shape::SHAPE_CUBOID}, 81 81 {CYLINDER, Part::Shape::SHAPE_CYLINDER}, 82 82 }; 83 const int SHAPE_COUNT = 3; // This should be the count of SHAPE TYPE_TO_GENE and GENE_TO_SHAPETYPE83 const int SHAPE_COUNT = 3; // This should be the count of SHAPE_TO_GENE and GENE_TO_SHAPE 84 84 85 85 const char DEFAULT_JOINT = 'a'; … … 100 100 }; 101 101 102 extern const std::map<string, double> defaultValues;103 104 102 /** @name Number of tries of performing a mutation before GENOPER_FAIL is returned */ 105 103 #define mutationTries 20 … … 198 196 MultiRange toMultiRange() 199 197 { 200 MultiRange range; 201 range.add(start, start + len - 1); 202 return range; 198 int end = start + len - 1; 199 return MultiRange(IRange(start, end)); 203 200 } 204 201 }; … … 244 241 { 245 242 public: 243 int start, end; 246 244 std::map<int, double> inputs; 247 245 … … 274 272 Part *part; /// A part object built from node. Used in building the Model 275 273 int partCodeLen; /// The length of substring that directly describes the corresponding part 274 std::map<string, double> defaultValues; 276 275 GenotypeParams genotypeParams; 277 278 276 279 277 vector<Node *> children; /// Vector of all direct children 280 278 std::map<char, int> modifiers; /// Vector of all modifiers 281 279 vector<fS_Neuron *> neurons; /// Vector of all the neurons 280 281 void prepareParams(); 282 282 283 283 double getDistance(); … … 398 398 399 399 /** 400 * Change the value of the size parameter by given multiplier401 * Do not change the value if any of the size restrictions is not satisfied402 * @param paramKey403 * @param multiplier404 * @param ensureCircleSection405 * @return True if the parameter value was change, false otherwise406 */407 bool mutateSizeParam(string paramKey, bool ensureCircleSection);408 409 /**410 400 * Counts all the nodes in subtree 411 401 * @return node count … … 521 511 * @param a reference to a model that will contain a built model 522 512 */ 523 void buildModel(Model &model);513 Model buildModel(bool using_checkpoints); 524 514 525 515 /**
Note: See TracChangeset
for help on using the changeset viewer.