本文整理汇总了C++中Gene::RestoreGenes方法的典型用法代码示例。如果您正苦于以下问题:C++ Gene::RestoreGenes方法的具体用法?C++ Gene::RestoreGenes怎么用?C++ Gene::RestoreGenes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gene
的用法示例。
在下文中一共展示了Gene::RestoreGenes方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RestoreHost
void Host::RestoreHost(const string& sline)
{
stringstream ssline(sline);
ssline >> lociKIR;
ssline >> lociMHC;
ssline >>age;
ssline >> tuning;
ssline >> dead;
ssline >> mutationRateHost;
ssline >> inhibitoryKIRs;
ssline >> activatingKIRs;
int totalInfections;
ssline >> totalInfections;
/*use the streamstring from the position after "totalInfections"
*for that I copy the rest of the line into a string, and then reassign the streamstring with the content of
*for "restLine. For it to work, I have to clear the string first!
*/
string restLine;
getline(ssline,restLine);
ssline.clear();
ssline.str(restLine);
string infectionString;
int type; double inf_time; double immune_time; double clearance_time;
for(int i=0; i<totalInfections; i++)
{
Infection dummyInfection;
infectionString = dummyInfection.RestoreInfection(ssline);
infections.push_back(dummyInfection);
ssline.clear();
ssline.str(infectionString);
}
string geneString;
//cout <<"mhc string>>>>>"<<ssline.str() <<endl;
for(int i=0; i<lociMHC*TWO; i++)
{
Gene mhc;
geneString = mhc.RestoreGenes(ssline);
mhcGenes.push_back(mhc);
ssline.clear();
ssline.str(geneString);
}
string kirString;
for(int i=0; i<lociKIR*TWO; i++)
{
//cout <<"kir string>>>>>"<<ssline.str() <<endl;
KIRGene kir;
kirString = kir.RestoreGenes(ssline);
kirGenes.push_back(kir);
ssline.clear();
ssline.str(kirString);
}
}