for (virus_map::iterator iter=pop.begin(); iter!=pop.end(); ++iter) {
- fprintf(output,"%d\t%.6e",iter->second,iter->first.energy);
+ //fprintf(output,"%d\t%.6e",iter->second,iter->first.energy);
+ fprintf(output,"%d\t%d\t%.6e",generation,iter->second,iter->first.energy);
ms = iter->first.mutated_sites;
for (std::set<unsigned int>::iterator ms_iter=ms.begin(); ms_iter!=ms.end(); ++ms_iter) fprintf(output,"\t%d",*ms_iter);
+ /*
+ fprintf(output,"\t");
+ std::set<unsigned int>::iterator ms_iter=ms.begin();
+ if (ms_iter != ms.end())
+ fprintf(output,"%d",*ms_iter);
+ ++ms_iter;
+ for (; ms_iter!=ms.end(); ++ms_iter)
+ fprintf(output,",%d",*ms_iter);
+ */
+
fprintf(output,"\n");
}
Population P(H, r.n, r.mu, r.initPop, r.initFrac);
// print epitopes
+ /*
std::cout << "-----------\n";
for (unsigned ep=0; ep<H.penalty.size(); ++ep) {
for (unsigned i=0; i<H.epitopeWT[ep].size(); ++i) {
std::cout << "\n";
}
fflush(stdout);
+ */
unsigned int i;
for (i=0; i<r.g; ++i) {
void importEpitope(RunParameters &r) {
- std::ifstream input(r.epitopeInfile.c_str()); // <infile>.st
+ std::ifstream input(r.epitopeInfile.c_str()); // <infile>.ep
if (!input) { perror((std::string("ERROR in importEpitope: ") + r.epitopeInfile).c_str()); exit(1); }
std::string readStr;
std::stringstream readStrStrm(std::string(readStr,pos0,posBar-pos0));
while (readStrStrm >> word) {
- std::cout << word << " ";
+ std::cout << word << " "; // XXX
std::istringstream i(word);
if (i >> site)
tmpEp.push_back(site);
tmpEp.clear(); // reset temp epitope
readStrStrm.str(""); readStrStrm.clear(); // reset stream
- std::cout << "| ";
+ std::cout << "| "; // XXX
readStrStrm.str(std::string(readStr,posBar+1,posEnd/*-posBar-1*/));
while (readStrStrm >> word) {
- std::cout << word << " ";
+ std::cout << word << " "; // XXX
std::istringstream i(word);
if (i >> site)
tmpEp.push_back(site);
r.numEpitopes++;
- std::cout << "\n";
+ std::cout << "\n"; // XXX
}