Пример #1
0
void TTest::perform(const int index, Stats& stats)
{

  // This can happen when we do one last t-test at the end of
  // a simulation and we've already done one recently enough
  // that we don't have any samples for this one.
  // If there is only one sample should we skip that also?
  if (_stat2.getNrSamples() == 0)
    {
      return;
    }

  if (_stat1.getNrSamples() == 0)
    {
      _stat1 = _stat2;
    }

  // If no bacteria it always clearance, regardless of the type of t-test used.
  if (stats.getTotExtMtb() + stats.getTotIntMtb() == 0)
    {
      stats.setStatus(index, GR_CLEARANCE);
      return;
    }

  double v = degreesOfFreedom();

  evaluate(index, stats, v);

  _stat1 = _stat2;
  _stat2.reset();
}
Пример #2
0
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;

}