Changeset 275
- Timestamp:
- 12/22/14 00:17:01 (10 years ago)
- Location:
- cpp/frams/genetics
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/frams/genetics/genman.cpp
r257 r275 288 288 } 289 289 mutchg += chg; 290 if (history) saveLink((const char*)g.getGene(), (const char*)gv.getGene(), chg);290 if (history) saveLink((const char*)g.getGene(), "", (const char*)gv.getGene(), chg); 291 291 SString mutinfo; 292 292 if (extmutinfo == 0) mutinfo = SString::sprintf("%.2f%% mutation of '%s'", 100 * chg, (const char*)g.getName()); else … … 356 356 // result in g1v 357 357 xochg += chg; 358 if (history) saveLink((const char*)g1.getGene(), (const char*)g 1v.getGene(), chg);358 if (history) saveLink((const char*)g1.getGene(), (const char*)g2.getGene(), (const char*)g1v.getGene(), chg); 359 359 SString xoinfo = SString::sprintf("Crossing over of '%s' (%.2f%%) and '%s' (%.2f%%)", 360 360 (const char*)g1.getName(), 100 * chg, (const char*)g2.getName(), 100 * (1 - chg)); … … 490 490 } 491 491 492 void GenMan::saveLink( string prz, string pot, float&chg)492 void GenMan::saveLink(const string parent1, const string parent2, const string child, const float chg) 493 493 { 494 494 GenoLink l; 495 495 l.count = count; 496 l.g1 = prz; 497 l.g2 = pot; 496 l.parent1 = parent1; 497 l.parent2 = parent2; 498 l.child = child; 498 499 l.chg = chg; 499 500 l.fit = 0; //temporarily. Will be set when the genotype dies 501 //FMprintf("GenMan","saveLink",0,"#%d: [%d] '%s' + '%s' -> '%s'",GenoLinkList.size(),count,parent1.c_str(),parent2.c_str(),child.c_str()); 500 502 GenoLinkList.push_back(l); 501 503 } -
cpp/frams/genetics/genman.h
r247 r275 19 19 { 20 20 int count; 21 string g1, g2;21 string parent1, parent2, child; 22 22 float chg; 23 23 float fit; … … 55 55 private: 56 56 vector<GenoOperators*> oper_fx_list; 57 void saveLink( string prz, string pot, float&chg);57 void saveLink(const string parent1, const string parent2, const string child, const float chg); 58 58 GenoOperators* getOper_f(char format); 59 59 SString HTMLize(const char *g, bool shorten);
Note: See TracChangeset
for help on using the changeset viewer.