Simpact Cyan
Population based event driven simulation using mNRM
eventconception.h
1 #ifndef EVENTCONCEPTION_H
2 
3 #define EVENTCONCEPTION_H
4 
5 #include "simpactevent.h"
6 #include "hazardfunctionexp.h"
7 
9 
10 class EventConception : public SimpactEvent
11 {
12 public:
13  EventConception(Person *pPerson1, Person *pPerson2, double relationshipFormationTime);
14  ~EventConception();
15 
16  std::string getDescription(double tNow) const;
17  void writeLogs(double tNow) const;
18  void fire(State *pState, double t);
19 
20  static void processConfig(ConfigSettings &config, GslRandomNumberGenerator *pRndGen);
21  static void obtainConfig(ConfigWriter &config);
22 private:
23  double calculateInternalTimeInterval(const State *pState, double t0, double dt);
24  double solveForRealTimeInterval(const State *pState, double Tdiff, double t0);
25  bool isUseless();
26 
27  class HazardFunctionConception : public HazardFunctionExp
28  {
29  public:
30  HazardFunctionConception(const Person *pMan, const Person *pWoman, double WSF, double tRef);
31  ~HazardFunctionConception();
32 
33  static double m_alphaBase;
34  static double m_alphaAgeMan;
35  static double m_alphaAgeWoman;
36  static double m_alphaWSF;
37  static double m_beta;
38  };
39 
40  double m_WSF;
41  double m_relationshipFormationTime;
42 
43  static double m_tMax;
44  static ProbabilityDistribution *m_pWSFProbDist;
45 
46  static double getTMax(const Person *pPerson1, const Person *pPerson2);
47 };
48 
49 #endif // EVENTCONCEPTION_H
This class both describes the simulation state and contains the core algorithm (as shown on the main ...
Definition: state.h:40
Helper class to read configuration settings, more advanced than ConfigReader.
Definition: configsettings.h:20
This class allows you to generate random numbers, and uses the GNU Scientific Library for this...
Definition: gslrandomnumbergenerator.h:16
Abstract base class for probability distribution implementations so that they can be used interchange...
Definition: probabilitydistribution.h:15
Helper class for time dependent exponential hazards.
Definition: hazardfunctionexp.h:15