Simpact Cyan
Population based event driven simulation using mNRM
populationdistributioncsv.h
Go to the documentation of this file.
1 #ifndef POPULATIONDISTRIBUTIONCSV_H
2 
3 #define POPULATIONDISTRIBUTIONCSV_H
4 
10 #include "booltype.h"
11 
13 
18 {
19 public:
24 
31  bool_t load(const std::string &csvFile);
32 
34  void clear();
35 
36  double pickAge(bool male) const;
37 private:
38  DiscreteDistribution *m_pMaleDist;
39  DiscreteDistribution *m_pFemaleDist;
40 };
41 
42 #endif // POPULATIONDISTRIBUTIONCSV_H
Type to return true/false with error description.
Definition: booltype.h:25
PopulationDistributionCSV(GslRandomNumberGenerator *pRndGen)
Constructor of the class, which needs the random number generator to use.
Definition: populationdistributioncsv.cpp:6
double pickAge(bool male) const
This function generates the random age, for either a man or a woman.
Definition: populationdistributioncsv.cpp:57
Helper class to generate random numbers based on some kind of discrete distribution.
Definition: discretedistribution.h:20
This class allows you to pick random ages according to the data loaded from a CSV file...
Definition: populationdistributioncsv.h:17
bool_t load(const std::string &csvFile)
Load the age distribution from the specified file.
Definition: populationdistributioncsv.cpp:17
Base class for picking random numbers according to some kind of age distribution. ...
Definition: populationdistribution.h:13
This class allows you to generate random numbers, and uses the GNU Scientific Library for this...
Definition: gslrandomnumbergenerator.h:16
void clear()
Clears the previously loaded data.
Definition: populationdistributioncsv.cpp:46