|
Stride Reference Manual
1.0
|
Class that keeps track of the 'state' of simulated world. More...
#include <Calendar.h>

Public Member Functions | |
| Calendar (const boost::property_tree::ptree &pt_config) | |
| Constructor. More... | |
| void | advanceDay () |
| Advance the internal calendar by one day. More... | |
| std::size_t | getDay () const |
| Get the current day of the month. More... | |
| std::size_t | getDayOfTheWeek () const |
| Get the current day of the week (0 (Sunday), ..., 6 (Saturday)) More... | |
| std::size_t | getMonth () const |
| Get the current month. More... | |
| std::size_t | getSimulationDay () const |
| Get the current day of the simulation. More... | |
| std::size_t | getYear () const |
| Get the current year. More... | |
| bool | isHoliday () const |
| Check if it's a holiday. More... | |
| bool | isSchoolHoliday () const |
| Check if it's a school holiday. More... | |
| bool | isWeekend () const |
| Check if it's the weekend. More... | |
Private Member Functions | |
| void | initializeHolidays (const boost::property_tree::ptree &pt_config) |
Private Attributes | |
| std::size_t | m_day |
| The current simulation day. More... | |
| boost::gregorian::date | m_date |
| The current simulated day. More... | |
| std::vector< boost::gregorian::date > | m_holidays |
| Vector of general holidays. More... | |
| std::vector< boost::gregorian::date > | m_school_holidays |
| Vector of school holidays. More... | |
Friends | |
| class | Hdf5Loader |
Class that keeps track of the 'state' of simulated world.
E.g. what day it is, holidays, quarantines, ...
Definition at line 36 of file Calendar.h.
| stride::Calendar::Calendar | ( | const boost::property_tree::ptree & | pt_config | ) |
Constructor.
Definition at line 33 of file Calendar.cpp.
References initializeHolidays(), and m_date.
| void stride::Calendar::advanceDay | ( | ) |
Advance the internal calendar by one day.
Definition at line 43 of file Calendar.cpp.
|
inline |
|
inline |
Get the current day of the week (0 (Sunday), ..., 6 (Saturday))
Definition at line 48 of file Calendar.h.
References m_date.
Referenced by isWeekend().
|
inline |
|
inline |
|
inline |
|
inline |
Check if it's a holiday.
Definition at line 60 of file Calendar.h.
References m_date, and m_holidays.
|
inline |
Check if it's a school holiday.
Definition at line 63 of file Calendar.h.
References m_date, and m_school_holidays.
|
inline |
Check if it's the weekend.
Definition at line 68 of file Calendar.h.
References getDayOfTheWeek(), and initializeHolidays().
|
private |
Definition at line 48 of file Calendar.cpp.
References stride::util::InstallDirs::getDataDir(), m_holidays, and m_school_holidays.
Referenced by Calendar(), and isWeekend().
|
friend |
Definition at line 81 of file Calendar.h.
|
private |
The current simulation day.
Definition at line 75 of file Calendar.h.
Referenced by advanceDay(), and getSimulationDay().
|
private |
The current simulated day.
Definition at line 76 of file Calendar.h.
Referenced by advanceDay(), Calendar(), getDay(), getDayOfTheWeek(), getMonth(), getYear(), isHoliday(), and isSchoolHoliday().
|
private |
Vector of general holidays.
Definition at line 77 of file Calendar.h.
Referenced by initializeHolidays(), and isHoliday().
|
private |
Vector of school holidays.
Definition at line 78 of file Calendar.h.
Referenced by initializeHolidays(), and isSchoolHoliday().