10#include "FuelLookup.h"
12#ifdef DEBUG_FWI_WEATHER
24using SurvivalMap = array<vector<float>, NUMBER_OF_FUELS>;
55#ifdef DEBUG_FWI_WEATHER
56 logging::check_fatal(time < 0 || time >= MAX_DAYS,
"Invalid weather time %f", time);
67 const FuelCodeSize& in_fuel)
const
75 [[nodiscard]]
constexpr Day
minDate()
const
83 [[nodiscard]]
constexpr Day
maxDate()
const
99 [[nodiscard]]
const vector<const FwiWeather*>*
getWeather()
111 FireWeather(
const set<const fuel::FuelType*>& used_fuels,
114 vector<const FwiWeather*>* weather_by_hour_by_day);
150 for (Day day = lhs.
minDate() +
static_cast<Day
>(1); day <= lhs.
maxDate(); ++day)
152 for (
auto hour = 0; hour < DAY_HOURS; ++hour)
154 const auto time =
static_cast<DurationSize
>(day) + hour / 24.0;
155 if (lhs.
at(time) != rhs.
at(time))
169[[nodiscard]]
constexpr bool operator!=(
const FireWeather& lhs,
const FireWeather& rhs)
171 return !(lhs == rhs);
A stream of weather that gets used by a Scenario every Iteration.
Definition FireWeather.h:29
FireWeather & operator=(FireWeather &&rhs) noexcept=default
Move assignment.
ThresholdSize survivalProbability(const DurationSize time, const FuelCodeSize &in_fuel) const
Probability of survival in given fuel at given time.
Definition FireWeather.h:66
constexpr size_t weightedDsr() const noexcept
Weighted Danger Severity Rating for the stream.
Definition FireWeather.h:91
const vector< const FwiWeather * > * getWeather()
Weather by hour by day.
Definition FireWeather.h:99
constexpr Day maxDate() const
Maximum date present in FireWeather.
Definition FireWeather.h:83
FireWeather(FireWeather &&rhs)=default
Move constructor.
virtual ~FireWeather()
Destructor.
Definition FireWeather.cpp:17
const SurvivalMap * survival_probability_
Probability of survival for fuels fuel at each time.
Definition FireWeather.h:123
Day min_date_
Minimum date present in stream.
Definition FireWeather.h:127
constexpr Day minDate() const
Minimum date present in FireWeather.
Definition FireWeather.h:75
const vector< const FwiWeather * > * weather_by_hour_by_day_
FwiWeather by hour by Day.
Definition FireWeather.h:119
Day max_date_
Maximum date present in stream.
Definition FireWeather.h:131
const FwiWeather * at(const DurationSize time) const
Get FwiWeather for given time.
Definition FireWeather.h:53
size_t weighted_dsr_
Weighted Danger Severity Rating for the stream.
Definition FireWeather.h:135
A Weather value with calculated FWI indices.
Definition FWI.h:209