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 
12 
17 {
18 public:
23 
30  bool load(const std::string &csvFile);
31 
33  void clear();
34 
35  double pickAge(bool male) const;
36 private:
37  DiscreteDistribution *m_pMaleDist;
38  DiscreteDistribution *m_pFemaleDist;
39 };
40 
41 #endif // POPULATIONDISTRIBUTIONCSV_H
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:62
bool load(const std::string &csvFile)
Load the age distribution from the specified file.
Definition: populationdistributioncsv.cpp:17
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:16
Base class for picking random numbers according to some kind of age distribution. ...
Definition: populationdistribution.h:15
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:51