#define XERR
#include "incidence.ih"

void Incidence::setIncidence(StringVect &base, size_t idx,
                             bool setProbability)
{
    Params params( idx );

    bool ok = true;

    if (setProbability)
    {
        base.back() = "probability:";
        ok = Parser::proportion(base, params.d_prob);
    }

    base.back() = "lifetimeRisk:";
    ok = Parser::one(base, params.d_vsd[0]) and ok;

    base.back() = "meanAge:";
    ok = Parser::one(base, params.d_vsd[1]) and ok;

    base.back() = "stdDev:";
    ok = Parser::one(base, params.d_vsd[2]) and ok;

    if (ok)
        d_params.push_back(params);
}
