Changeset 821 for cpp/frams/genetics/fL
- Timestamp:
- 10/10/18 01:13:05 (6 years ago)
- Location:
- cpp/frams/genetics/fL
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/frams/genetics/fL/fL_general.cpp
r803 r821 488 488 std::string message = "Error in parsing parameters at line: " + std::to_string(linenumber); 489 489 logMessage("fL_Builder", "processLine", LOG_ERROR, message.c_str()); 490 delete obj;490 if (obj != this) delete obj; 491 491 return begin + 1; 492 492 } … … 1339 1339 } 1340 1340 1341 int fL_Builder::countSticksInSequence(std::list<fL_Word *> sequence)1341 int fL_Builder::countSticksInSequence(std::list<fL_Word *> *sequence) 1342 1342 { 1343 1343 int count = 0; 1344 for (std::list<fL_Word *>::iterator it = sequence .begin(); it != sequence.end(); it++)1344 for (std::list<fL_Word *>::iterator it = sequence->begin(); it != sequence->end(); it++) 1345 1345 { 1346 1346 if ((*it)->builtin && (*it)->name == "S") -
cpp/frams/genetics/fL/fL_general.h
r803 r821 482 482 * @return number of sticks in sequence 483 483 */ 484 int countSticksInSequence(std::list<fL_Word *> sequence);484 int countSticksInSequence(std::list<fL_Word *> *sequence); 485 485 486 486 /** -
cpp/frams/genetics/fL/fL_matheval.cpp
r797 r821 116 116 registerOperator(meqless, 1, Associativity::LEFT, "<="); 117 117 registerOperator(mequal, 1, Associativity::RIGHT, "="); 118 registerOperator(mnotequal, 1, Associativity::RIGHT, " ~");118 registerOperator(mnotequal, 1, Associativity::RIGHT, "<>"); 119 119 registerOperator(mand, 0, Associativity::LEFT, "&"); 120 120 registerOperator(mor, 0, Associativity::LEFT, "|"); -
cpp/frams/genetics/fL/fL_oper.cpp
r803 r821 64 64 } 65 65 66 if (builder.countSticksInSequence( builder.genotype) == 0)66 if (builder.countSticksInSequence(&builder.genotype) == 0) 67 67 { 68 68 return GENOPER_OPFAIL; … … 142 142 SString det; 143 143 NeuroClass *cls = getRandomNeuroClass(); 144 //we do not check if this class145 144 det = cls->getName(); 146 145 Geno_fH::mutateNeuronProperties(det); … … 418 417 int ruleid = 0; 419 418 std::list<fL_Word *> *list = selectRandomSequence(creature, numpars, ruleid); 420 if (ruleid == -1 && creature->countSticksInSequence( (*list)) == 1)419 if (ruleid == -1 && creature->countSticksInSequence(list) == 1) 421 420 { 422 421 if (list->size() > 1) … … 540 539 } 541 540 int chgtype = roulette(chgoperations, FL_CHG_COUNT); 542 if (creature->countSticksInSequence( (*list)) == 1 && tmp == -1) // if sequence is axiom541 if (creature->countSticksInSequence(list) == 1 && tmp == -1) // if sequence is axiom 543 542 { 544 543 fL_Word *worddef = randomWordDefinition(creature, roulette(addtypes, FL_ADD_COUNT - 1));
Note: See TracChangeset
for help on using the changeset viewer.