pops-core
0.9
PoPS (Pest or Pathogen Spread) Model Core C++ library
|
Go to the documentation of this file.
24 #ifndef POPS_CONFIG_HPP
25 #define POPS_CONFIG_HPP
103 scheduler_ =
Scheduler(date_start_, date_end_, step_unit_, step_num_units_);
120 schedules_created_ =
true;
125 if (!schedules_created_)
126 throw std::logic_error(
127 "Schedules were not created before calling scheduler()");
133 if (!schedules_created_)
134 throw std::logic_error(
135 "Schedules were not created before calling spread_schedule()");
136 return spread_schedule_;
141 if (!schedules_created_)
142 throw std::logic_error(
143 "Schedules were not created before calling mortality_schedule()");
144 return mortality_schedule_;
150 throw std::logic_error(
151 "lethal_schedule() not available when use_lethal_temperature is false");
152 if (!schedules_created_)
153 throw std::logic_error(
154 "Schedules were not created before calling lethal_schedule()");
155 return lethal_schedule_;
161 throw std::logic_error(
162 "spread_rate_schedule() not available when use_spreadrates is false");
163 if (!schedules_created_)
164 throw std::logic_error(
165 "Schedules were not created before calling spread_rate_schedule()");
166 return spread_rate_schedule_;
172 throw std::logic_error(
173 "quarantine_schedule() not available when use_quarantine is false");
174 if (!schedules_created_)
175 throw std::logic_error(
176 "Schedules were not created before calling quarantine_schedule()");
177 return quarantine_schedule_;
182 if (!schedules_created_)
183 throw std::logic_error(
184 "Schedules were not created before calling output_schedule()");
185 return output_schedule_;
190 if (!schedules_created_)
191 throw std::logic_error(
192 "Schedules were not created before calling num_mortality_steps()");
199 throw std::logic_error(
200 "num_lethal() not available when use_lethal_temperature is false");
201 if (!schedules_created_)
202 throw std::logic_error(
203 "Schedules were not created before calling num_lethal()");
210 throw std::logic_error(
211 "rate_num_steps() not available when use_spreadrates is false");
212 if (!schedules_created_)
213 throw std::logic_error(
214 "Schedules were not created before calling rate_num_steps()");
221 throw std::logic_error(
222 "quarantine_num_steps() not available when use_quarantine is false");
223 if (!schedules_created_)
224 throw std::logic_error(
225 "Schedules were not created before calling quarantine_num_steps()");
234 template<
typename... Args>
237 date_start_ =
Date(std::forward<Args>(args)...);
245 template<
typename... Args>
248 date_end_ =
Date(std::forward<Args>(args)...);
268 return step_num_units_;
279 season_start_month_ = start;
280 season_end_month_ = end;
285 season_start_month_ = std::stoi(start);
286 season_end_month_ = std::stoi(end);
290 Date date_start_{
"0-01-01"};
291 Date date_end_{
"0-01-02"};
293 int season_start_month_{1};
294 int season_end_month_{12};
297 unsigned step_num_units_{1};
299 Scheduler scheduler_{date_start_, date_end_, step_unit_, step_num_units_};
300 bool schedules_created_{
false};
302 std::vector<bool> spread_schedule_;
303 std::vector<bool> output_schedule_;
304 std::vector<bool> mortality_schedule_;
305 std::vector<bool> lethal_schedule_;
306 std::vector<bool> spread_rate_schedule_;
307 std::vector<bool> quarantine_schedule_;
312 #endif // POPS_CONFIG_HPP
unsigned num_mortality_steps()
Representation and manipulation of a date for the simulation.
void set_date_end(Args &&... args)
unsigned step_num_units() const
int lethal_temperature_month
void set_date_start(Args &&... args)
unsigned mortality_frequency_n
std::string quarantine_frequency
bool movement_stochasticity
void set_step_num_units(unsigned step_num_units)
StepUnit step_unit_enum_from_string(const std::string &text)
Get step enum from string.
double leaving_scale_coefficient
const std::vector< bool > & spread_schedule() const
void set_step_unit(StepUnit step_unit)
std::vector< bool > schedule_from_string(const Scheduler &scheduler, const std::string &frequency, unsigned n=0)
Get output (export) schedule based on frequency string ("year", "month", "week", "day",...
std::string anthro_direction
std::vector< unsigned > movement_schedule
void set_season_start_end_month(int start, int end)
std::vector< bool > schedule_spread(const Season &season) const
Schedule spread.
const std::vector< bool > & lethal_schedule() const
const std::vector< bool > & quarantine_schedule() const
bool use_overpopulation_movements
unsigned get_number_of_scheduled_actions(const std::vector< bool > &action_schedule)
Returns how many actions are scheduled.
void set_step_unit(const std::string &text)
bool establishment_stochasticity
std::string mortality_frequency
Holds beginning and end of a season and decides what is in season.
const std::vector< bool > & mortality_schedule() const
double establishment_probability
const Scheduler & scheduler() const
std::string natural_direction
std::string anthro_kernel_type
void set_season_start_end_month(const std::string &start, const std::string &end)
unsigned output_frequency_n
unsigned spreadrate_frequency_n
double dispersal_percentage
const std::vector< bool > & spread_rate_schedule() const
std::string output_frequency
bool generate_stochasticity
const Date & date_end() const
bool use_anthropogenic_kernel
double percent_natural_dispersal
const std::vector< bool > & output_schedule() const
unsigned quarantine_frequency_n
bool use_lethal_temperature
std::string spreadrate_frequency
std::vector< bool > schedule_action_yearly(int month, int day) const
Schedule an action at certain date each year, e.g.
double leaving_percentage
StepUnit
Enum for step unit.
double lethal_temperature
std::string natural_kernel_type
double overpopulation_percentage
const Date & date_start() const
StepUnit step_unit() const
unsigned rate_num_steps()
unsigned quarantine_num_steps()