![]() |
FireSTARR
|
Map of the percentage of simulations in which a Cell burned in each intensity category. More...
#include <ProbabilityMap.h>
Public Member Functions | |
ProbabilityMap (const ProbabilityMap &rhs) noexcept=delete | |
ProbabilityMap (ProbabilityMap &&rhs) noexcept=delete | |
ProbabilityMap & | operator= (const ProbabilityMap &rhs) noexcept=delete |
ProbabilityMap & | operator= (ProbabilityMap &&rhs) noexcept=delete |
ProbabilityMap (const string dir_out, DurationSize time, DurationSize start_time, int min_value, int low_max, int med_max, int max_value, const data::GridBase &grid_info) | |
Constructor. | |
ProbabilityMap * | copyEmpty () const |
Create a copy of this that is empty. | |
void | setPerimeter (const topo::Perimeter *const perimeter) |
Assign perimeter to use for marking cells as initial perimeter. | |
void | addProbabilities (const ProbabilityMap &rhs) |
Combine results from another ProbabilityMap into this one. | |
void | addProbability (const IntensityMap &for_time) |
Add in an IntensityMap to the appropriate probability grid based on each cell burn intensity. | |
vector< MathSize > | getSizes () const |
List of sizes of IntensityMaps that have been added. | |
util::Statistics | getStatistics () const |
Generate Statistics on sizes of IntensityMaps that have been added. | |
size_t | numSizes () const noexcept |
Number of sizes that have been added. | |
void | show () const |
Output Statistics to log. | |
void | saveSizes (const string &base_name) const |
Save list of sizes. | |
void | saveAll (const tm &start_time, DurationSize time, const bool is_interim) const |
Save total, low, moderate, and high maps, and output information to log. | |
void | saveTotal (const string &base_name, const bool is_interim) const |
Save map representing all intensities. | |
void | saveTotalCount (const string &base_name) const |
Save map representing all intensities occurrence. | |
void | saveHigh (const string &base_name) const |
Save map representing high intensities. | |
void | saveModerate (const string &base_name) const |
Save map representing moderate intensities. | |
void | saveLow (const string &base_name) const |
Save map representing low intensities. | |
void | reset () |
Clear maps and return to initial state. | |
Static Public Member Functions | |
static void | deleteInterim () |
Private Member Functions | |
bool | record_if_interim (const char *filename) const |
Make note of any interim files for later deletion. | |
template<class R > | |
string | saveToProbabilityFile (const data::GridMap< size_t > &grid, const string &dir, const string &base_name, const R divisor) const |
Save probability file and record filename if interim. | |
Private Attributes | |
const string | dir_out_ |
Directory to write outputs to. | |
data::GridMap< size_t > | all_ |
Map representing all intensities. | |
data::GridMap< size_t > | high_ |
Map representing high intensities. | |
data::GridMap< size_t > | med_ |
Map representing moderate intensities. | |
data::GridMap< size_t > | low_ |
Map representing low intensities. | |
vector< MathSize > | sizes_ {} |
List of sizes for perimeters that have been added. | |
const DurationSize | time_ |
Time in simulation this ProbabilityMap represents. | |
const DurationSize | start_time_ |
Start time of simulation. | |
mutex | mutex_ |
Mutex for parallel access. | |
IntensitySize | min_value_ |
Lower bound of 'low' intensity range. | |
IntensitySize | max_value_ |
Upper bound of 'high' intensity range. | |
const IntensitySize | low_max_ |
Upper bound of 'low' intensity range. | |
const IntensitySize | med_max_ |
Upper bound of 'moderate' intensity range. | |
const topo::Perimeter * | perimeter_ |
Initial ignition grid to apply to outputs. | |
Map of the percentage of simulations in which a Cell burned in each intensity category.
fs::sim::ProbabilityMap::ProbabilityMap | ( | const string | dir_out, |
DurationSize | time, | ||
DurationSize | start_time, | ||
int | min_value, | ||
int | low_max, | ||
int | med_max, | ||
int | max_value, | ||
const data::GridBase & | grid_info ) |
Constructor.
dir_out | Directory to save outputs to |
time | Time in simulation this ProbabilityMap represents |
start_time | Start time of simulation |
min_value | Lower bound of 'low' intensity range |
low_max | Upper bound of 'low' intensity range |
med_max | Upper bound of 'moderate' intensity range |
max_value | Upper bound of 'high' intensity range |
grid_info | GridBase to use for extent of this |
void fs::sim::ProbabilityMap::addProbabilities | ( | const ProbabilityMap & | rhs | ) |
Combine results from another ProbabilityMap into this one.
rhs | ProbabilityMap to combine from |
void fs::sim::ProbabilityMap::addProbability | ( | const IntensityMap & | for_time | ) |
Add in an IntensityMap to the appropriate probability grid based on each cell burn intensity.
for_time | IntensityMap to add results from |
ProbabilityMap * fs::sim::ProbabilityMap::copyEmpty | ( | ) | const |
Create a copy of this that is empty.
|
static |
Delete interim output files
|
nodiscard |
List of sizes of IntensityMaps that have been added.
|
nodiscard |
Generate Statistics on sizes of IntensityMaps that have been added.
|
nodiscardnoexcept |
Number of sizes that have been added.
void fs::sim::ProbabilityMap::saveAll | ( | const tm & | start_time, |
DurationSize | time, | ||
const bool | is_interim ) const |
Save total, low, moderate, and high maps, and output information to log.
start_time | Start time of simulation |
time | Time for these maps |
void fs::sim::ProbabilityMap::saveHigh | ( | const string & | base_name | ) | const |
Save map representing high intensities.
base_name | Base file name to save to |
void fs::sim::ProbabilityMap::saveLow | ( | const string & | base_name | ) | const |
Save map representing low intensities.
base_name | Base file name to save to |
void fs::sim::ProbabilityMap::saveModerate | ( | const string & | base_name | ) | const |
Save map representing moderate intensities.
base_name | Base file name to save to |
void fs::sim::ProbabilityMap::saveSizes | ( | const string & | base_name | ) | const |
Save list of sizes.
base_name | Base name of file to save into |
|
inlineprivate |
Save probability file and record filename if interim.
void fs::sim::ProbabilityMap::saveTotal | ( | const string & | base_name, |
const bool | is_interim ) const |
Save map representing all intensities.
base_name | Base file name to save to |
void fs::sim::ProbabilityMap::saveTotalCount | ( | const string & | base_name | ) | const |
Save map representing all intensities occurrence.
base_name | Base file name to save to |
void fs::sim::ProbabilityMap::setPerimeter | ( | const topo::Perimeter *const | perimeter | ) |
Assign perimeter to use for marking cells as initial perimeter.
perimeter | Ignition grid to store for marking in outputs |