FireSTARR
Loading...
Searching...
No Matches
fs::sim::TestScenario Class Referencefinal

A Scenario run with constant fuel, weather, and topography. More...

Inheritance diagram for fs::sim::TestScenario:
Collaboration diagram for fs::sim::TestScenario:

Public Member Functions

 TestScenario (const TestScenario &rhs)=delete
 
 TestScenario (TestScenario &&rhs)=delete
 
TestScenariooperator= (const TestScenario &rhs)=delete
 
TestScenariooperator= (TestScenario &&rhs)=delete
 
 TestScenario (Model *model, const shared_ptr< topo::Cell > &start_cell, const topo::StartPoint &start_point, const int start_date, const DurationSize end_date, wx::FireWeather *weather)
 Constructor.
 
- Public Member Functions inherited from fs::sim::Scenario
constexpr size_t weightedDsr () const noexcept
 Weighted Danger Severity Rating.
 
 Scenario (Model *model, size_t id, wx::FireWeather *weather, wx::FireWeather *weather_daily, DurationSize start_time, const shared_ptr< topo::Perimeter > &perimeter, const topo::StartPoint &start_point, Day start_day, Day last_date)
 Constructor.
 
 Scenario (Model *model, size_t id, wx::FireWeather *weather, wx::FireWeather *weather_daily, DurationSize start_time, const shared_ptr< topo::Cell > &start_cell, const topo::StartPoint &start_point, Day start_day, Day last_date)
 Constructor.
 
 Scenario (Scenario &&rhs) noexcept
 Move constructor.
 
 Scenario (const Scenario &rhs)=delete
 
Scenariooperator= (Scenario &&rhs) noexcept
 Move assignment.
 
Scenariooperator= (const Scenario &rhs) const =delete
 
Scenarioreset_with_new_start (const shared_ptr< topo::Cell > &start_cell, util::SafeVector *final_sizes)
 Assign start Cell, reset thresholds and set SafeVector to output results to.
 
Scenarioreset (mt19937 *mt_extinction, mt19937 *mt_spread, util::SafeVector *final_sizes)
 Reset thresholds and set SafeVector to output results to.
 
void burn (const Event &event)
 Burn cell that Event takes place in.
 
void cancel (bool show_warning) noexcept
 
topo::Cell cell (const Idx row, const Idx column) const
 Get Cell for given row and column.
 
template<class P >
constexpr topo::Cell cell (const Position< P > &position) const
 Get Cell for given Location.
 
constexpr Idx rows () const
 Number of rows.
 
constexpr Idx columns () const
 Number of columns.
 
constexpr MathSize cellSize () const
 Cell width and height (m)
 
constexpr int64_t simulation () const
 Simulation number.
 
constexpr const topo::StartPointstartPoint () const
 StartPoint that provides sunrise/sunset times.
 
constexpr DurationSize startTime () const
 Simulation start time.
 
constexpr size_t id () const
 Identifier.
 
constexpr const Modelmodel () const
 Model this Scenario is running in.
 
constexpr DurationSize dayStart (const size_t for_day) const
 Sunrise time for given day.
 
constexpr DurationSize dayEnd (const size_t for_day) const
 Sunset time for given day.
 
const wx::FwiWeatherweather (const DurationSize time) const
 FwiWeather for given time.
 
const wx::FwiWeatherweather_daily (const DurationSize time) const
 
constexpr int nd (const DurationSize time) const
 Difference between date and the date of minimum foliar moisture content.
 
ThresholdSize extinctionThreshold (const DurationSize time) const
 Get extinction threshold for given time.
 
ThresholdSize spreadThresholdByRos (const DurationSize time) const
 Get spread threshold for given time.
 
constexpr bool isAtNight (const DurationSize time) const
 Whether or not time is after sunrise and before sunset.
 
MathSize minimumFfmcForSpread (const DurationSize time) const noexcept
 Minimum Fine Fuel Moisture Code for spread to be possible.
 
bool isSurrounded (const Location &location) const
 Whether or not the given Location is surrounded by cells that are burnt.
 
template<class P >
bool isSurrounded (const Position< P > &position) const
 
topo::Cell cell (const InnerPos &p) const noexcept
 Cell that InnerPos falls within.
 
Scenariorun (map< DurationSize, ProbabilityMap * > *probabilities)
 Run the Scenario.
 
void scheduleFireSpread (const Event &event)
 Schedule a fire spread Event.
 
MathSize currentFireSize () const
 Current fire size (ha)
 
bool canBurn (const topo::Cell &location) const
 Whether or not a Cell can burn.
 
bool hasBurned (const Location &location) const
 Whether or not Cell with the given hash can burn.
 
template<class P >
bool hasBurned (const Position< P > &position) const
 
void addEvent (Event &&event)
 Whether or not Location with given hash has burned already.
 
void evaluateNextEvent ()
 Evaluate next Event in the queue.
 
void endSimulation () noexcept
 End the simulation.
 
void addSaveByOffset (int offset)
 Add a save point for simulation data at the given offset.
 
template<class V >
void addSave (V time)
 Add a save point for simulation data at given time.
 
void saveObservers (const string &base_name) const
 Tell Observers to save their data with base file name.
 
void saveObservers (DurationSize time) const
 Tell Observers to save their data for the given time.
 
void saveIntensity (const string &dir, const string &base_name) const
 Save burn intensity information.
 
bool ran () const noexcept
 Whether or not this Scenario has run already.
 
bool survives (const DurationSize time, const topo::Cell &cell, const DurationSize time_at_location) const
 Whether or not the fire survives the conditions.
 
vector< DurationSize > savePoints () const
 List of what times the simulation will save.
 
void saveStats (DurationSize time) const
 Save state of Scenario at given time.
 
void registerObserver (IObserver *observer)
 Register an IObserver that will be notified when Cells burn.
 
void notify (const Event &event) const
 Notify IObservers that a Cell has burned.
 
void evaluate (const Event &event)
 Take whatever steps are necessary to process the given Event.
 
void clear () noexcept
 Clear the Event list and all other data.
 

Additional Inherited Members

- Static Public Member Functions inherited from fs::sim::Scenario
static size_t completed () noexcept
 Number of Scenarios that have completed running.
 
static size_t count () noexcept
 Number of Scenarios that have been initialized.
 
static size_t total_steps () noexcept
 Total number of spread events for all Scenarios.
 
- Protected Member Functions inherited from fs::sim::Scenario
string add_log (const char *format) const noexcept override
 
 Scenario (Model *model, size_t id, wx::FireWeather *weather, wx::FireWeather *weather_daily, DurationSize start_time, const shared_ptr< topo::Perimeter > &perimeter, const shared_ptr< topo::Cell > &start_cell, topo::StartPoint start_point, Day start_day, Day last_date)
 Constructor.
 
- Protected Member Functions inherited from fs::logging::SelfLogger
void log_output (const int level, const char *format,...) const noexcept
 
void log_extensive (const char *format,...) const noexcept
 
void log_verbose (const char *format,...) const noexcept
 
void log_debug (const char *format,...) const noexcept
 
void log_info (const char *format,...) const noexcept
 
void log_note (const char *format,...) const noexcept
 
void log_warning (const char *format,...) const noexcept
 
void log_error (const char *format,...) const noexcept
 
void log_check_fatal (bool condition, const char *format,...) const
 
void log_fatal (const char *format,...) const
 
- Protected Attributes inherited from fs::sim::Scenario
list< unique_ptr< IObserver, IObserver_deleter > > observers_ {}
 Observers to be notified when cells burn.
 
vector< DurationSize > save_points_
 List of times to save simulation.
 
vector< ThresholdSize > extinction_thresholds_ {}
 Thresholds used to determine if extinction occurs.
 
vector< ThresholdSize > spread_thresholds_by_ros_ {}
 Thresholds used to determine if spread occurs.
 
DurationSize current_time_
 Current time for this Scenario.
 
CellPointsMap points_
 Map of Cells to the PointSets within them.
 
BurnedData * unburnable_
 Contains information on cells that are not burnable.
 
set< Event, EventComparescheduler_
 Event scheduler used for ordering events.
 
unique_ptr< IntensityMapintensity_
 Map of what intensity each cell has burned at.
 
shared_ptr< topo::Perimeterperimeter_
 Initial intensity map based off perimeter.
 
map< topo::SpreadKey, SpreadInfospread_info_ {}
 Calculated SpreadInfo for SpreadKey for current time.
 
map< topo::Cell, DurationSize > arrival_ {}
 Map of when Cell had first Point arrive in it.
 
MathSize max_ros_
 Maximum rate of spread for current time.
 
shared_ptr< topo::Cellstart_cell_
 Cell that the Scenario starts from if no Perimeter.
 
wx::FireWeatherweather_
 Hourly weather to use for this Scenario.
 
wx::FireWeatherweather_daily_
 Weather stream to use for spread and extinction probability.
 
Modelmodel_
 Model this Scenario is being run in.
 
map< DurationSize, ProbabilityMap * > * probabilities_
 Map of ProbabilityMaps by time snapshot for them was taken.
 
util::SafeVectorfinal_sizes_
 Where to append the final size of this Scenario when run is complete.
 
topo::StartPoint start_point_
 Origin of fire.
 
size_t id_
 Identifier.
 
DurationSize start_time_
 Start time (decimal days)
 
DurationSize last_save_
 Which save point is the last one.
 
size_t current_time_index_ = numeric_limits<size_t>::max()
 Time index for current time.
 
int64_t simulation_
 Simulation number.
 
Day start_day_
 First day of simulation.
 
Day last_date_
 Last day of simulation.
 
bool ran_
 Whether or not this Scenario has completed running.
 
bool cancelled_ = false
 Whether this has been cancelled.
 
shared_ptr< LogPointslog_points_
 
size_t step_
 How many times point spread event has happened.
 
size_t oob_spread_
 How many times this scenario tried to spread out of bounds.
 

Detailed Description

A Scenario run with constant fuel, weather, and topography.

Constructor & Destructor Documentation

◆ TestScenario()

fs::sim::TestScenario::TestScenario ( Model * model,
const shared_ptr< topo::Cell > & start_cell,
const topo::StartPoint & start_point,
const int start_date,
const DurationSize end_date,
wx::FireWeather * weather )
inline

Constructor.

Parameters
modelModel running this Scenario
start_cellCell to start ignition in
start_pointStartPoint represented by start_cell
start_dateStart date of simulation
end_dateEnd data of simulation
weatherConstant weather to use for duration of simulation
Here is the call graph for this function:

The documentation for this class was generated from the following file: