Simpact Cyan
Population based event driven simulation using mNRM
personaleventlisttesting.h
1 #ifndef PERSONALEVENTLISTTESTING_H
2 
3 #define PERSONALEVENTLISTTESTING_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;
15 class PopulationStateTesting;
17 
18 class PersonalEventListTesting : public PersonAlgorithmInfo
19 {
20 public:
21  PersonalEventListTesting(PersonBase *pPerson);
22  ~PersonalEventListTesting();
23 
24  void registerPersonalEvent(PopulationEvent *pEvt);
25  void processUnsortedEvents(PopulationAlgorithmTesting &alg, PopulationStateTesting &pop, double t0);
26  void advanceEventTimes(PopulationAlgorithmTesting &alg, const PopulationStateTesting &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 PersonalEventListTesting *personalEventList(PersonBase *pPerson);
36  void removeSecondaryEvent(PopulationEvent *pEvt);
37 #ifndef PERSONALEVENTLIST_EXTRA_DEBUGGING
38  void checkEarliestEvent() { }
39  void checkEvents() { }
40 #else
41  void checkEarliestEvent();
42  void checkEvents();
43 #endif // PERSONALEVENTLIST_EXTRA_DEBUGGING
44 
45  std::vector<PopulationEvent *> m_timedEventsPrimary;
46  std::vector<PopulationEvent *> m_untimedEventsPrimary;
47 
48  std::vector<PopulationEvent *> m_secondaryEvents;
49 
50  PopulationEvent *m_pEarliestEvent;
51  PersonBase *m_pPerson;
52 
53  int m_listIndex;
54 
55 #ifdef ALGORITHM_SHOW_EVENTS
56  friend class PopulationAlgorithmTesting;
57 #endif // ALGORITHM_SHOW_EVENTS
58 };
59 
60 #endif // PERSONALEVENTLISTTESTING_H
61 
Base class to be able to store algorithm-specific information in the PersonBase object for a person i...
Definition: populationinterfaces.h:144
This is the base class for events in population-based simulations.
Definition: populationevent.h:63
This is the base class for a person in a population-based simulation.
Definition: personbase.h:23
This class provides functions for a population-based simulation using the modified Next Reaction Meth...
Definition: populationalgorithmtesting.h:82