Simpact Cyan
Population based event driven simulation using mNRM
personaleventlist.h
1 #ifndef PERSONALEVENTLIST_H
2 
3 #define PERSONALEVENTLIST_H
4 
5 #include "booltype.h"
6 #include "populationevent.h"
7 #include "populationinterfaces.h"
8 #include <vector>
9 #include <list>
10 #include <set>
11 
12 //#define PERSONALEVENTLIST_EXTRA_DEBUGGING
13 
14 class PersonBase;
17 
18 class PersonalEventList : public PersonAlgorithmInfo
19 {
20 public:
21  PersonalEventList(PersonBase *pPerson);
22  ~PersonalEventList();
23 
24  void registerPersonalEvent(PopulationEvent *pEvt);
25  void processUnsortedEvents(PopulationAlgorithmAdvanced &alg, PopulationStateAdvanced &pop, double t0);
26  void advanceEventTimes(PopulationAlgorithmAdvanced &alg, const PopulationStateAdvanced &pop, double t1);
27  void adjustingEvent(PopulationEvent *pEvt);
28  void removeTimedEvent(PopulationEvent *pEvt);
29 
30  PopulationEvent *getEarliestEvent();
31 
32  void setListIndex(int i) { m_listIndex = i; }
33  int getListIndex() const { return m_listIndex; }
34 private:
35  static PersonalEventList *personalEventList(PersonBase *pPerson);
36 #ifndef PERSONALEVENTLIST_EXTRA_DEBUGGING
37  void checkEarliestEvent() { }
38  void checkEvents() { }
39 #else
40  void checkEarliestEvent();
41  void checkEvents();
42 #endif // PERSONALEVENTLIST_EXTRA_DEBUGGING
43 
44  std::vector<PopulationEvent *> m_timedEvents;
45  std::vector<PopulationEvent *> m_untimedEvents;
46 
47  PopulationEvent *m_pEarliestEvent;
48  PersonBase *m_pPerson;
49 
50  int m_listIndex;
51 
52 #ifdef STATE_SHOW_EVENTS
53  friend class PopulationAlgorithmAdvanced;
54 #endif // STATE_SHOW_EVENTS
55 };
56 
57 #endif // PERSONALEVENTLIST_H
58 
Base class to be able to store algorithm-specific information in the PersonBase object for a person i...
Definition: populationinterfaces.h:144
This class provides functions for a population-based simulation using the modified Next Reaction Meth...
Definition: populationalgorithmadvanced.h:82
This is the base class for events in population-based simulations.
Definition: populationevent.h:61
This is the base class for a person in a population-based simulation.
Definition: personbase.h:23
Population state to be used when simulating with the population based algorithm in PopulationAlgorith...
Definition: populationstateadvanced.h:22