25class WorldConstructor;
28typedef std::vector<std::shared_ptr<const Hft> >
HftList;
57 World(
const std::string instruction_filename,
70 World(
const std::shared_ptr<const Parameters> params,
71 const std::shared_ptr<const HftList> hftlist);
238 const std::shared_ptr<const Parameters>
params;
Helper class to hold an absolute simulation day.
Definition: date.h:19
Central class to construct and own megafauna habitats and populations.
Definition: world.h:45
void simulate_day(const Date &date, const bool do_herbivores)
Iterate through all simulation units and perform simulation for this day.
Definition: world.h:186
bool simulation_units_checked
Whether the habitat counts per aggregation unit have been checked.
Definition: world.h:223
void simulate_day(const Date &date, const SimDayOptions &opts=SimDayOptions())
Iterate through all simulation units and perform simulation for this day.
Definition: world.cpp:169
void create_simulation_unit(std::shared_ptr< Habitat > habitat)
Compose a new simulation from an external habitat and new populations.
Definition: world.cpp:76
static InsfileContent read_instruction_file(const std::string &filename)
Helper function to initialize World::InsfileContent object.
Definition: world.cpp:156
int days_since_last_establishment
Number of days since extinct populations were re-established.
Definition: world.h:242
std::list< SimulationUnit > sim_units
List of all the simulation units in the world.
Definition: world.h:264
const bool is_activated() const
Whether this World object is in SimMode::Simulate mode.
Definition: world.h:122
struct Fauna::World::InsfileContent insfile
~World()
Default destructor.
const std::unique_ptr< Output::Aggregator > output_aggregator
Collects output data per time interval and aggregation unit.
Definition: world.h:252
const std::unique_ptr< WorldConstructor > world_constructor
Helper class to construct various elements of the megafauna world.
Definition: world.h:267
std::unique_ptr< Output::WriterInterface > output_writer
Output writer as selected by Parameters::output_format.
Definition: world.h:255
const Parameters & get_params() const
Get global simulation parameters.
Definition: world.cpp:110
const std::list< SimulationUnit > & get_sim_units() const
List of all the simulation units in the world.
Definition: world.h:119
std::unique_ptr< Fauna::Date > last_date
The date from the last call to simulate_day()
Definition: world.h:249
const HftList & get_hfts() const
Get the immutable list of herbivore functional types.
Definition: world.cpp:101
Output::WriterInterface * construct_output_writer() const
Create Output::WriterInterface implementation according to params.
Definition: world.cpp:30
const SimMode mode
Whether this object is going to simulate or just lint an instruction file.
Definition: world.h:213
int get_habitat_count_per_agg_unit() const
Get the number of habitats per aggregation unit.
Definition: world.cpp:119
World()
Constructor: Create deactivated World object.
Definition: world.cpp:70
SimMode
Mode of the whole simulation program: What is it started for?
Definition: world.h:36
@ Simulate
Default mode: We want to simulate herbivores.
@ Lint
Only check (“lint”) the instruction file, don’t perform simulations.
std::vector< std::shared_ptr< const Hft > > HftList
List of pointers to Hft objects.
Definition: world.h:28
Interface class for all classes that implement writing output.
Definition: writer_interface.h:20
Parameters for the herbivory module.
Definition: parameters.h:65
All simulation instructions from the TOML instruction file.
Definition: world.h:234
const std::shared_ptr< const Parameters > params
Global, immutable set of simulation parameters.
Definition: world.h:238
const std::shared_ptr< const HftList > hftlist
Global, immutable list of herbivore functional types.
Definition: world.h:236
Options passed to simulate_day()
Definition: world.h:125
bool do_herbivores
Whether to perform herbivore simulations.
Definition: world.h:131
bool reset_date
Whether to reset the simulation so we start from the beginning.
Definition: world.h:145
SimDayOptions()
Constructor.
Definition: world.h:127