Changeset 372 for cpp/frams/genetics
- Timestamp:
- 04/22/15 04:14:59 (10 years ago)
- Location:
- cpp/frams/genetics
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/frams/genetics/f1/conv_f1.cpp
r348 r372 5 5 #include "conv_f1.h" 6 6 #include <common/nonstd_stl.h> 7 #include <common/ framsg.h>7 #include <common/hmessage.h> 8 8 #include <frams/util/multirange.h> 9 9 #include <frams/util/multimap.h> … … 63 63 if ((n1<0) || (n2<0) || (n1>=neuro_f1_to_f0.size()) || (n2>=neuro_f1_to_f0.size())) 64 64 { 65 if (final) FMprintf("GenoConvF1","addInput",FMLV_WARN,65 if (final) Hprintf("GenoConvF1","addInput",HMLV_WARN, 66 66 "illegal neuron connection %d <- %d (ignored)",n1,n2); 67 67 return 0; … … 178 178 else 179 179 { 180 FramMessage("GenoConv_F1","grow","Illegal neuron position (ignored)",1);180 Hmessage("GenoConv_F1","grow","Illegal neuron position (ignored)",1); 181 181 g=skipNeuro(g+1); 182 182 } -
cpp/frams/genetics/f4/conv_f4.cpp
r287 r372 6 6 7 7 #include "conv_f4.h" 8 #include <common/ framsg.h>8 #include <common/hmessage.h> 9 9 #include "../oper_fx.h" //for GENOPER_OK constant 10 10 … … 110 110 if (res) 111 111 { 112 FramMessage("f4_Model", "buildModelRec", "Error in building Model", 2);112 Hmessage("f4_Model", "buildModelRec", "Error in building Model", 2); 113 113 error = res; 114 114 break; … … 134 134 return cells->C[i]; 135 135 // none! 136 FramMessage("f4_Model", "getStick", "Not a single stick", 2);136 Hmessage("f4_Model", "getStick", "Not a single stick", 2); 137 137 return NULL; 138 138 } -
cpp/frams/genetics/f4/f4_general.cpp
r348 r372 7 7 #include "f4_general.h" 8 8 #include <common/nonstd_stl.h> 9 #include <common/ framsg.h>9 #include <common/hmessage.h> 10 10 #include <frams/model/model.h> // for min and max attributes 11 11 #include "../oper_fx.h" //for GENOPER_ constants … … 581 581 char buf[40]; 582 582 sprintf(buf, "unknown code '%c'", gcur->name); 583 FramMessage("f4_Cell", "onestep", buf, 2);583 Hmessage("f4_Cell", "onestep", buf, 2); 584 584 // fix: delete it 585 585 org->setRepairRemove(gcur->pos, gcur); -
cpp/frams/genetics/f4/oper_f4.cpp
r286 r372 8 8 #include "oper_f4.h" 9 9 #include <frams/util/sstring.h> 10 #include <common/ framsg.h>10 #include <common/hmessage.h> 11 11 12 12 #include <stdio.h> … … 51 51 mutation_method_names[index++] = "deleted a node"; 52 52 mutation_method_names[index++] = "modified a node"; 53 if (index != F4_COUNT + F4_ADD_COUNT - 1) FramMessage("Geno_f4", "Constructor", "Mutation names init error", 3);53 if (index != F4_COUNT + F4_ADD_COUNT - 1) Hmessage("Geno_f4", "Constructor", "Mutation names init error", 3); 54 54 } 55 55 -
cpp/frams/genetics/genman.cpp
r348 r372 6 6 #include <frams/vm/classes/genoobj.h> 7 7 #include GEN_CONFIG_FILE //configuration of active genetic operators 8 #include "common/ framsg.h"8 #include "common/hmessage.h" 9 9 #include "common/nonstd_math.h" 10 10 #include "common/stl-util.h" 11 #include <frams/ errmgr/errmanager.h>11 #include <frams/mhandlers/mhandlers.h> 12 12 13 13 … … 267 267 if (gf->mutate(gn, chg, method) == GENOPER_OK) 268 268 { 269 ErrorHandler eh(ErrorHandler::StoreFirstMessage); //mute testValidity()269 MessageHandlerToMemory eh(MessageHandlerBase::Enable | MessageHandlerToMemory::StoreFirstMessage); //mute testValidity() 270 270 Geno G(gn, gv.getFormat(), "", ""); 271 271 canvalidate = true; … … 284 284 if (!ok && (count - pcount > 100)) 285 285 { 286 FMprintf("GenMan", "Mutate", 2, "Tried 100x and failed: %s", g.getGene().c_str());286 Hprintf("GenMan", "Mutate", 2, "Tried 100x and failed: %s", g.getGene().c_str()); 287 287 return Geno("", -1, "", "GENOPER_OPFAIL: Mutate() tried 100x and failed"); 288 288 } … … 308 308 309 309 { 310 ErrorHandler eh(ErrorHandler::StoreFirstMessage); //mute testValidity()310 MessageHandlerToMemory eh(MessageHandlerBase::Enable | MessageHandlerToMemory::StoreFirstMessage); //mute testValidity() 311 311 bool canvalidate = true; 312 312 if (testValidity(g1v, canvalidate) > 0 && canvalidate == false) … … 333 333 if (g1n[0]) { gn = g1n; chg = chg1; } 334 334 else { gn = g2n; chg = chg2; } 335 ErrorHandler eh(ErrorHandler::StoreFirstMessage); //mute testValidity()335 MessageHandlerToMemory eh(MessageHandlerBase::Enable | MessageHandlerToMemory::StoreFirstMessage); //mute testValidity() 336 336 Geno G(gn, g1v.getFormat(), "", ""); 337 337 bool canvalidate = true; … … 351 351 if (!ok && (count - pcount > 100)) 352 352 { 353 FMprintf("GenMan", "CrossOver", 2, "Tried 100x and failed: %s and %s", g1.getGene().c_str(), g2.getGene().c_str());353 Hprintf("GenMan", "CrossOver", 2, "Tried 100x and failed: %s and %s", g1.getGene().c_str(), g2.getGene().c_str()); 354 354 return Geno("", -1, "", "GENOPER_OPFAIL: CrossOver() tried 100x and failed"); 355 355 } … … 500 500 l.chg = chg; 501 501 l.fit = 0; //temporarily. Will be set when the genotype dies 502 // FMprintf("GenMan","saveLink",0,"#%d: [%d] '%s' + '%s' -> '%s'",GenoLinkList.size(),count,parent1.c_str(),parent2.c_str(),child.c_str());502 //Hprintf("GenMan","saveLink",0,"#%d: [%d] '%s' + '%s' -> '%s'",GenoLinkList.size(),count,parent1.c_str(),parent2.c_str(),child.c_str()); 503 503 GenoLinkList.push_back(l); 504 504 } … … 533 533 float f1, f2; 534 534 int m; 535 FramMessage("GenMan", "Report", "The following genetic operators are available:", 0);535 Hmessage("GenMan", "Report", "The following genetic operators are available:", 0); 536 536 for (unsigned int i = 0; i < oper_fx_list.size(); i++) 537 537 { … … 549 549 } 550 550 // if (oper_fx_list[i]->similarity("","")!=GENOPER_NOOPER) l+=" similarity"; 551 FMprintf("GenMan", "Report", 0, "format f%c (%s):%s",551 Hprintf("GenMan", "Report", 0, "format f%c (%s):%s", 552 552 oper_fx_list[i]->supported_format, oper_fx_list[i]->name.c_str(), l.c_str()); 553 553 } -
cpp/frams/genetics/geno.cpp
r348 r372 250 250 } 251 251 isvalid = 0; 252 FMprintf("Geno", "validate", FMLV_WARN, "Wrong configuration? No genotype validators defined for genetic format f%c.", format);252 Hprintf("Geno", "validate", HMLV_WARN, "Wrong configuration? No genotype validators defined for genetic format f%c.", format); 253 253 } 254 254 -
cpp/frams/genetics/oper_fx.cpp
r348 r372 5 5 #include <ctype.h> //isupper() 6 6 #include "oper_fx.h" 7 #include <common/ framsg.h>7 #include <common/hmessage.h> 8 8 #include <common/nonstd_math.h> 9 9 #include <frams/util/rndutil.h> … … 173 173 } 174 174 else 175 FMprintf("GenoOperators", "linearMix", FMLV_WARN, "Cannot mix values of types '%c' and '%c'", type1, type2);175 Hprintf("GenoOperators", "linearMix", HMLV_WARN, "Cannot mix values of types '%c' and '%c'", type1, type2); 176 176 } 177 177 … … 250 250 { 251 251 if (s == NULL) 252 FramMessage("GenoOperators", "skipWS", "NULL reference!", FMLV_WARN);252 Hmessage("GenoOperators", "skipWS", "NULL reference!", HMLV_WARN); 253 253 else 254 254 while (isWS(*s)) s++;
Note: See TracChangeset
for help on using the changeset viewer.