#include "tumor.h"
#include "../xerr/xerr.ih"

#include <algorithm>

#include <bobcat/exception>
#include <bobcat/csvtable>

#include "../options/options.h"
#include "../tumorinfo/tumorinfo.h"
#include "../growth/growth.h"
#include "../random/random.h"
#include "../log/log.h"

inline uint16_t Tumor::ageGroup() const
{
    return  d_selfDetectAge < 50 ? 0  :
            d_selfDetectAge < 70 ? 1  :
                         2;
}

// volume   = 1/6 pi * diam^3
// diam     = pow(6 / pi * volume, 1/3)

// static
inline double Tumor::volume(double diameter)
{
    return M_PI / 6 * pow(diameter, 3);
}

// static
inline double Tumor::diameter(double volume)
{
    return pow(6 / M_PI * volume, 1 / 3.);
}

extern size_t g_caseIdx;
extern size_t g_err;

#ifndef SPCH_
using namespace std;
using namespace FBB;
#endif
