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 #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_timedEventsPrimary;
45  std::vector<PopulationEvent *> m_untimedEventsPrimary;
46 
47  std::vector<PopulationEvent *> m_secondaryEvents;
48 
49  PopulationEvent *m_pEarliestEvent;
50  PersonBase *m_pPerson;
51 
52  int m_listIndex;
53 
54 #ifdef ALGORITHM_SHOW_EVENTS
55  friend class PopulationAlgorithmTesting;
56 #endif // ALGORITHM_SHOW_EVENTS
57 };
58 
59 #endif // PERSONALEVENTLISTTESTING_H
60 
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:61
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