void Snapshot::takeSnapshot(const int time, const Stats& stats) { _outFile << time; _outFile << (stats.getNrOfMacs()) << ','; for(size_t i=0; i<Mac::NSTATES; i++) _outFile << (stats.getNrOfMacs(Mac::State(i))) << ','; _outFile << (stats.getNrOfTgams()) << ','; for(size_t i=0; i<Tgam::NSTATES; i++) _outFile << (stats.getNrOfTgams(Tgam::State(i))) << ','; _outFile << (stats.getNrOfTcyts()) << ','; for(size_t i=0; i<Tcyt::NSTATES; i++) _outFile << (stats.getNrOfTcyts(Tcyt::State(i))) << ','; _outFile << (stats.getNrOfTregs()) << ','; for(size_t i=0; i<Treg::NSTATES; i++) _outFile << (stats.getNrOfTregs(Treg::State(i))) << ','; _outFile << stats.getTotIntMtb() << ',' << stats.getTotExtMtb() << ',' << stats.getTotNonRepExtMtb() << ',' << (stats.getTotIntMtb() + stats.getTotExtMtb()) << ',' << stats.getTotTNF() << ',' << stats.getTotCCL2() << ',' << stats.getTotCCL5() << ',' << stats.getTotCXCL9() << ',' << stats.getAreaTNF() << ',' << stats.getAreaCellDensity() << ',' << stats.getMDC() << ',' << stats.getN4() << ',' << stats.getTH0() << ',' << stats.getTH1() << ',' << stats.getN8() << ',' << stats.getT80() << ',' << stats.getT8() << ',' << stats.getTC() << ',' << stats.getTH0lung() << ',' << stats.getTH1lung() << ',' << stats.getT80lung() << ',' << stats.getT8lung() << ',' << stats.getTClung(); int startState = 1; // Skip the dead state: apoptosis doesn't occur for an already dead mac. static int totMacApoptosisTNF[Mac::NSTATES] = {0}; //Just temporary for Mohammed Fallahi int sumMacApoptosisTNF = 0; for(int i=startState; i<Mac::NSTATES; i++) //Keep a running sum of deaths { totMacApoptosisTNF[i]+=(stats.getMacApoptosisTNF((Mac::State)i)); sumMacApoptosisTNF+=totMacApoptosisTNF[i]; } _outFile << (stats.getTotNrSources()) << ','; for(size_t i=0; i<NAGENTS; i++) _outFile << (stats.getNrSources((AgentType)i)) << ','; _outFile << stats.getNrCaseated() << ',' << sumMacApoptosisTNF << ','; for(int i=startState; i<Mac::NSTATES; i++) _outFile<<totMacApoptosisTNF[i]<<','; _outFile << stats.getTcellApoptosisTNF(); _outFile << std::endl; }
void Tgam::updateStatistics(Stats& s) const { ++s.getNrOfAgents(TGAM); ++s.getNrOfTgams((Tgam::State)getState()); }