Changeset 200
- Timestamp:
- 03/29/14 00:04:01 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/frams/genetics/genman.cpp
r197 r200 8 8 #include "common/framsg.h" 9 9 #include "common/nonstd_math.h" 10 #include "common/stl-util.h" 10 11 #include <frams/errmgr/errmanager.h> 11 12 … … 152 153 { 153 154 if (operformats.find(oper_fx_list[i]->supported_format) != -1) continue; 154 char tmp[10]; 155 SString id, name, type = "~"; 156 type += oper_fx_list[i]->name; 155 string type = string("~") + oper_fx_list[i]->name; 157 156 int dup = 0; 158 157 for (unsigned int j = i + 1; j < oper_fx_list.size(); j++) 159 158 if (oper_fx_list[i]->supported_format == oper_fx_list[j]->supported_format) 160 159 { 161 type += "~"; type += oper_fx_list[j]->name; dup++; 160 type += "~"; 161 type += oper_fx_list[j]->name; 162 dup++; 162 163 } 163 sprintf(tmp, "d 0 %d ", dup); 164 type = SString(tmp) + type; 165 sprintf(tmp, "%c", oper_fx_list[i]->supported_format); 166 id = "genoper_f"; id += tmp; 167 name = "Operators for f"; name += tmp; 164 type = ssprintf("d 0 %d ", dup) + type; 165 string id = ssprintf("genoper_f%c", oper_fx_list[i]->supported_format); 166 string name = ssprintf("Operators for f%c", oper_fx_list[i]->supported_format); 168 167 seloper[selopercount] = 0; 169 168 operformats += oper_fx_list[i]->supported_format; 170 169 //printf("%x %s %s %s\n",&seloper[selopercount],(const char*)id,(const char*)type,(const char*)name); 171 seloperpar.addProperty(&seloper[selopercount++], id , type, name, "", PARAM_READONLY*(dup == 0));170 seloperpar.addProperty(&seloper[selopercount++], id.c_str(), type.c_str(), name.c_str(), "", PARAM_READONLY*(dup == 0)); 172 171 } 173 172 … … 460 459 GenoOperators *gf = getOper_f(format); 461 460 if (!gf) return Geno(); 462 SString info = "The simplest genotype of format f"; info += format;461 string info = "The simplest genotype of format f"; info += format; 463 462 info += " for operators '"; info += gf->name; info += "'."; 464 return Geno(gf->getSimplest(), format, "Root", (const char*)info);463 return Geno(gf->getSimplest(), format, "Root", info.c_str()); 465 464 } 466 465 … … 477 476 { 478 477 GenoOperators *gf = getOper_f(format); 479 if (!gf) return "n/a"; else return gf->name ;478 if (!gf) return "n/a"; else return gf->name.c_str(); 480 479 } 481 480 … … 534 533 for (unsigned int i = 0; i < oper_fx_list.size(); i++) 535 534 { 536 SString l;535 string l; 537 536 if (oper_fx_list[i]->checkValidity("") != GENOPER_NOOPER) l += " checkValidity"; 538 537 if (oper_fx_list[i]->getSimplest()) … … 548 547 // if (oper_fx_list[i]->similarity("","")!=GENOPER_NOOPER) l+=" similarity"; 549 548 FMprintf("GenMan", "Report", 0, "format f%c (%s):%s", 550 oper_fx_list[i]->supported_format, (const char*)oper_fx_list[i]->name, (const char*)l);549 oper_fx_list[i]->supported_format, oper_fx_list[i]->name.c_str(), l.c_str()); 551 550 } 552 551 }
Note: See TracChangeset
for help on using the changeset viewer.