File: gencases.cc

package info (click to toggle)
simrisc 16.05.00-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,568 kB
  • sloc: cpp: 6,877; fortran: 665; makefile: 112; ansic: 112; sh: 107
file content (43 lines) | stat: -rw-r--r-- 1,255 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#define XERR
#include "loop.ih"

size_t g_caseIdx;           // -> loop.ih       if (caseIdx > 24842)
size_t g_err = 14;

    // by iterate.cc

void Loop::genCases(size_t iter, size_t nCases)
{
    CSVTable dataTable = headerData(iter);

    bool showAll = not d_options.specificAges() and d_options.lastCase() == 0;

                                        // perform 'nCases' simulations
    for (size_t caseIdx = 0; caseIdx != nCases; ++caseIdx)
    {
        g_caseIdx = caseIdx;

        g_log.caseIdx(caseIdx);
        caseInit();             // initialize the data for this case

        screening();        // no action unless screening rounds are specified

        postScreen();

//FBB        d_sumDeathAge += d_deathAge;
//FBB        d_totalCost += d_caseCost;

        if (dataTable.stream() and (showAll or caseIdx + 1 == nCases))
        {
            d_tumor.checkDeath(d_naturalDeathAge);
            writeData(dataTable, caseIdx);
        }
    }

    dataTable << hline();
}

// In the original womanloop function a test is performed whether the
// woman has died or not. This test is superfluous because if the woman enters
// postScreen with status PRESENT then in postScreen the status either changes
// to NATURAL_POST or SELF_POST.