pops-core
0.9
PoPS (Pest or Pathogen Spread) Model Core C++ library
|
#include <scheduling.hpp>
Public Member Functions | |
Scheduler (const Date &start, const Date &end, StepUnit simulation_unit, unsigned simulation_num_units) | |
Scheduler creates a vector of simulation steps based on start, end date, unit and number of units. More... | |
unsigned | get_num_steps () const |
Get number of simulation steps. More... | |
Step | get_step (unsigned index) const |
Get step based on index. More... | |
std::tuple< unsigned, StepUnit > | get_step_length () const |
Get length of simulation step as number of units and unit type. More... | |
std::vector< bool > | schedule_spread (const Season &season) const |
Schedule spread. More... | |
std::vector< bool > | schedule_action_yearly (int month, int day) const |
Schedule an action at certain date each year, e.g. More... | |
std::vector< bool > | schedule_action_end_of_year () const |
Schedule an action at the end of each year, e.g. More... | |
std::vector< bool > | schedule_action_end_of_simulation () const |
Schedule an action at the end of simulation. More... | |
std::vector< bool > | schedule_action_nsteps (unsigned n_steps) const |
Schedule action every N simulation steps,. More... | |
std::vector< bool > | schedule_action_monthly () const |
Schedule action at the end of each month. More... | |
unsigned | schedule_action_date (const Date &date) const |
Schedule action at a specific date (not repeated action). More... | |
void | debug_schedule (std::vector< bool > &schedule) const |
Prints schedule for debugging purposes. More... | |
void | debug_schedule (unsigned n) const |
void | debug_schedule () const |
Definition at line 94 of file scheduling.hpp.
|
inline |
Scheduler creates a vector of simulation steps based on start, end date, unit and number of units.
The steps can be e.g. 1 day, 3 months, 2 weeks. Step is scheduled if start date of an interval is within [start, end] even if end date of the step is outside. That means the entire interval is contained in the simulation steps even when only part of it was requested.
start | simulation start date |
end | simulation end date |
simulation_unit | simulation unit |
simulation_num_units | number of days/weeks/months in a simulation step |
Definition at line 111 of file scheduling.hpp.
|
inline |
Definition at line 324 of file scheduling.hpp.
|
inline |
Prints schedule for debugging purposes.
vector | of bools to print along the steps |
Definition at line 313 of file scheduling.hpp.
|
inline |
Definition at line 319 of file scheduling.hpp.
|
inline |
Get number of simulation steps.
Definition at line 152 of file scheduling.hpp.
|
inline |
Get step based on index.
Definition at line 160 of file scheduling.hpp.
|
inline |
Get length of simulation step as number of units and unit type.
Definition at line 168 of file scheduling.hpp.
|
inline |
Schedule action at a specific date (not repeated action).
Should be used within Treatments class.
date | date to schedule action |
Definition at line 301 of file scheduling.hpp.
|
inline |
Schedule an action at the end of simulation.
Definition at line 242 of file scheduling.hpp.
|
inline |
Schedule an action at the end of each year, e.g.
mortality.
Definition at line 224 of file scheduling.hpp.
|
inline |
Schedule action at the end of each month.
More precisely, whenever end of the month is within the step interval.
Definition at line 278 of file scheduling.hpp.
|
inline |
Schedule action every N simulation steps,.
Useful for e.g. export. If simulation step is 2 months and n_steps = 2, actions is scheduled every 4 months.
n_steps | schedule every N steps |
Definition at line 258 of file scheduling.hpp.
|
inline |
Schedule an action at certain date each year, e.g.
lethality.
This doesn't handle cases where there is change in year within interval, but that doesn't happen with current implementation
month | month |
day | day |
Definition at line 203 of file scheduling.hpp.
|
inline |
Schedule spread.
season | seasonality information |
Definition at line 178 of file scheduling.hpp.