Changeset 797 for cpp/frams/genetics/fH/fH_general.cpp
- Timestamp:
- 06/06/18 01:45:18 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/frams/genetics/fH/fH_general.cpp
r780 r797 1 // This file is a part of Framsticks SDK. http://www.framsticks.com/ 2 // Copyright (C) 1999-2018 Maciej Komosinski and Szymon Ulatowski. 3 // See LICENSE.txt for details. 4 1 5 #include <string> 2 6 #include <limits> … … 13 17 // Methods for loading handles 14 18 15 const char *fH_part_names[ PART_PROPS_COUNT] = { "dn", "fr", "ing", "as" };16 17 const char *fH_joint_names[ JOINT_PROPS_COUNT] = { "stif", "rotstif", "stam" };19 const char *fH_part_names[FH_PART_PROPS_COUNT] = { "dn", "fr", "ing", "as" }; 20 21 const char *fH_joint_names[FH_JOINT_PROPS_COUNT] = { "stif", "rotstif", "stam" }; 18 22 19 23 void fH_Handle::loadProperties(Param par) … … 106 110 107 111 Part p; 108 for (int i = 0; i < PART_PROPS_COUNT; i++)112 for (int i = 0; i < FH_PART_PROPS_COUNT; i++) 109 113 { 110 114 stickmut.addProperty(&p.properties().getParamTab()[p.properties().findId(fH_part_names[i]) + p.properties().getGroupCount()], -1); … … 112 116 113 117 Joint j; 114 for (int i = 0; i < JOINT_PROPS_COUNT; i++)118 for (int i = 0; i < FH_JOINT_PROPS_COUNT; i++) 115 119 { 116 120 stickmut.addProperty(&j.properties().getParamTab()[j.properties().findId(fH_joint_names[i]) + j.properties().getGroupCount()], -1); … … 119 123 120 124 Neuro n; 121 neuronmut.addProperty(&n.properties().getParamTab()[n.properties().findId( PE_NEURO_DET) + n.properties().getGroupCount()], -1);125 neuronmut.addProperty(&n.properties().getParamTab()[n.properties().findId(FH_PE_NEURO_DET) + n.properties().getGroupCount()], -1); 122 126 123 127 Param tmp(f0_neuroconn_paramtab, NULL); 124 connectionmut.addProperty(&tmp.getParamTab()[tmp.findId( PE_CONN_WEIGHT) + tmp.getGroupCount()], -1);128 connectionmut.addProperty(&tmp.getParamTab()[tmp.findId(FH_PE_CONN_WEIGHT) + tmp.getGroupCount()], -1); 125 129 126 130 stickparamtab = ParamObject::makeParamTab((ParamInterface *)&stickmut, 0, 0, stickmut.firstMutableIndex()); … … 343 347 { 344 348 Param par(tab, obj); 345 double partprops[ PART_PROPS_COUNT];346 for (int i = 0; i < PART_PROPS_COUNT; i++)349 double partprops[FH_PART_PROPS_COUNT]; 350 for (int i = 0; i < FH_PART_PROPS_COUNT; i++) 347 351 { 348 352 partprops[i] = par.getDouble(2 * getDimensions() + i); … … 357 361 { 358 362 par.select(child->obj); 359 for (int i = 0; i < PART_PROPS_COUNT; i++)363 for (int i = 0; i < FH_PART_PROPS_COUNT; i++) 360 364 { 361 365 partprops[i] += par.getDouble(2 * getDimensions() + i); … … 364 368 } 365 369 366 for (int i = 0; i < PART_PROPS_COUNT; i++)370 for (int i = 0; i < FH_PART_PROPS_COUNT; i++) 367 371 { 368 372 partprops[i] /= stickscount; … … 522 526 msg += det + "\" does not exist"; 523 527 logMessage("fH_Builder", "developBrain", LOG_ERROR, msg.c_str()); 528 delete currneu->neuron; 524 529 return -1; 525 530 } … … 601 606 if (!beginneu) 602 607 { 603 logMessage("fH_Builder", "developBrain", LOG_WARN, "There are no available neurons with outputs, connection could not be established"); 608 // due to often appearance of connection genes in fB encoding, this 609 // log message is commented 610 // logMessage("fH_Builder", "developBrain", LOG_DEBUG, "There are no available neurons with outputs, connection could not be established"); 604 611 continue; 605 612 } … … 628 635 if (!endneu) 629 636 { 630 logMessage("fH_Builder", "developBrain", LOG_WARN, "There are no available neurons with free inputs, connection could not be established"); 637 // due to often appearance of connection genes in fB encoding, this 638 // log message is commented 639 // logMessage("fH_Builder", "developBrain", LOG_DEBUG, "There are no available neurons with free inputs, connection could not be established"); 631 640 continue; 632 641 }
Note: See TracChangeset
for help on using the changeset viewer.