Simpact Cyan
Population based event driven simulation using mNRM
|
This class allows you to pick random ages according to the data loaded from a CSV file. More...
#include <populationdistributioncsv.h>
Public Member Functions | |
PopulationDistributionCSV (GslRandomNumberGenerator *pRndGen) | |
Constructor of the class, which needs the random number generator to use. More... | |
bool_t | load (const std::string &csvFile) |
Load the age distribution from the specified file. More... | |
void | clear () |
Clears the previously loaded data. More... | |
double | pickAge (bool male) const |
This function generates the random age, for either a man or a woman. More... | |
Public Member Functions inherited from PopulationDistribution | |
PopulationDistribution (GslRandomNumberGenerator *pRndGen) | |
Constructor of the class, in which you need to specify a random number generator which can then be used internally. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from PopulationDistribution | |
GslRandomNumberGenerator * | getRandomNumberGenerator () |
This function can be used to obtain the random number generator specified in the constructor. More... | |
This class allows you to pick random ages according to the data loaded from a CSV file.
PopulationDistributionCSV::PopulationDistributionCSV | ( | GslRandomNumberGenerator * | pRndGen | ) |
Constructor of the class, which needs the random number generator to use.
void PopulationDistributionCSV::clear | ( | ) |
Clears the previously loaded data.
bool_t PopulationDistributionCSV::load | ( | const std::string & | csvFile | ) |
Load the age distribution from the specified file.
The file should look something like this:
"Start of age bin", "Number of men in bin", "Number of women in bin" ..., ..., ...
|
virtual |
This function generates the random age, for either a man or a woman.
Implements PopulationDistribution.