Simpact Cyan
Population based event driven simulation using mNRM
simpactevent.h
1 #ifndef SIMPACTEVENT_H
2 
3 #define SIMPACTEVENT_H
4 
5 #include "populationevent.h"
6 #include "simpactpopulation.h"
7 #include "person.h"
8 #include "configsettings.h"
9 #include "configwriter.h"
10 #include "logsystem.h"
11 
12 // This just provides some casts towards Person instead of PersonBase
13 class SimpactEvent : public PopulationEvent
14 {
15 public:
16  SimpactEvent() : PopulationEvent() { }
17  SimpactEvent(Person *pPerson) : PopulationEvent(pPerson) { }
18  SimpactEvent(Person *pPerson1, Person *pPerson2) : PopulationEvent(pPerson1, pPerson2) { }
19  ~SimpactEvent() { }
20 
21  Person *getPerson(int idx) const { return static_cast<Person*>(PopulationEvent::getPerson(idx)); }
22 
23  // This is called right before an event is fired (will fire at 'fireTime')
24  virtual void writeLogs(double fireTime) const = 0;
25 
26  static void writeEventLogStart(bool noExtraInfo, const std::string &eventName, double t,
27  const Person *pPerson1, const Person *pPerson2);
28 };
29 
30 #endif // SIMPACTEVENT_H
31 
PersonBase * getPerson(int idx) const
Returns a person that was specified when the event was constructed, where idx can range from 0 to Pop...
Definition: populationevent.cpp:83
This is the base class for events in population-based simulations which use the Population class...
Definition: populationevent.h:61