![]() |
ALMaSS
1.2 (after EcoStack, March 2024)
The Animal, Landscape and Man Simulation System
|
A class to manage a range of pollen and nectar development curves based on indexed rates. More...
#include <PollenNectar.h>
Public Member Functions | |
PollenNectarDevelopmentData (string a_toleinputfile="default", string a_tovinputfile="default") | |
~PollenNectarDevelopmentData () | |
void | RecalculatePollenNectarCurvesForYear (void) |
Recalculate the pollen and nectar curves for a year for the habitat species. This function only be called once per year (the first day in a year). More... | |
void | ReadFlowerNumberCrop (void) |
Function to read the flower number for crops. More... | |
PollenNectarDevelopmentCurveSet * | tovGetPollenNectarCurve (TTypesOfVegetation a_tov_ref) |
int | tovGetPollenNectarCurveRef (TTypesOfVegetation a_tov_ref) |
bool | tovGetPollenNectarCurveSowingFlag (TTypesOfVegetation a_tov_ref) |
PollenNectarDevelopmentCurveSet * | GetPollenNectarCurve (int a_ref) |
void | updateHabitatFlowerResource (void) |
The function to update the development of flower resource for all the habitat speccies. More... | |
PollenNectarData | supplyPollenHabitatSpeciesCurrentDay (int a_curve_num) |
Supply the current pollen for the given species. More... | |
PollenNectarData | supplyNectarHabitatSpeciesCurrentDay (int a_curve_num) |
Supply the current nectar for the given species. More... | |
PollenNectarData | supplyPollenHabitatSpeciesGivenDay (int a_curve_num, int a_given_day) |
Supply the pollen for the given species for the given day after today. More... | |
PollenNectarData | supplyNectarHabitatSpeciesGivenDay (int a_curve_num, int a_given_day) |
Supply the current nectar for the given species for the given day after today. More... | |
Protected Attributes | |
Eigen::ArrayXd | m_year_temp = Eigen::ArrayXd::Zero(365) |
This is used to store one year temperature data. More... | |
std::map< int, PollenNectarDevelopmentCurveSet > | m_ResourceCurves |
This is the main data set, it contains the resource curves for each species. More... | |
std::map< int, std::vector< PollenNectarData > > | m_pollen_habitat_species |
This is the dictionary to store the pollen for every habitat species in a year. More... | |
std::map< int, std::vector< PollenNectarData > > | m_nectar_habitat_species |
This is the dictionary to store the nectar for every habitat species in a year. More... | |
vector< int > | m_tov_PollenCurveTable |
This is a look-up table, it contains for each tov the corresponding curve number to use. More... | |
vector< bool > | m_tov_PollenCurveTable_sowing_flag |
This is a look-up table for the the crops to indicate it starts to accumulate degree days from sowing time. More... | |
int | m_num_species_habitat |
This is used to store the number of species for habitat. More... | |
std::map< int, double > | m_flower_number_crop |
The array to store the flower numbers for crop species. More... | |
A class to manage a range of pollen and nectar development curves based on indexed rates.
PollenNectarDevelopmentData::PollenNectarDevelopmentData | ( | string | a_toleinputfile = "default" , |
string | a_tovinputfile = "default" |
||
) |
Reads in the number of pollen and nectar curves.
References cfg_FlowerPollenNectarScaler, cfg_GeneralColdWeatherAdjustFlower, cfg_pollen_nectar_on, g_letype, g_msg, g_Species, l_map_nectarpollen, l_map_tov_nectarpollen, PollenNectarDevelopmentCurveSet::m_curve_number, PollenNectarDevelopmentCurveSet::m_DDthreshold, PollenNectarDevelopmentCurveSet::m_ending_DD_flowering, PollenNectarDevelopmentCurveSet::m_flag_not_enough_data, m_flower_number_crop, PollenNectarDevelopmentCurveSet::m_MaxDDeg, PollenNectarDevelopmentCurveSet::m_MaxFlowerLength, PollenNectarDevelopmentCurveSet::m_MeanFlowerLength, PollenNectarDevelopmentCurveSet::m_MinFlowerLength, m_nectar_habitat_species, m_num_species_habitat, m_pollen_habitat_species, PollenNectarDevelopmentCurveSet::m_pollen_quality, m_ResourceCurves, PollenNectarDevelopmentCurveSet::m_starting_DD_flowering, PollenNectarDevelopmentCurveSet::m_StdFlowerLength, PollenNectarDevelopmentCurveSet::m_total_nectar_whole_flowering, PollenNectarDevelopmentCurveSet::m_total_pollen_whole_flowering, PollenNectarDevelopmentCurveSet::m_total_sugar_whole_flowering, m_tov_PollenCurveTable, m_tov_PollenCurveTable_sowing_flag, ReadFlowerNumberCrop(), TOP_Bombus, TOP_Osmia, tov_Undefined, LE_TypeClass::TranslateVegTypes(), CfgFloat::value(), CfgBool::value(), CfgStr::value(), and MapErrorMsg::Warn().
PollenNectarDevelopmentData::~PollenNectarDevelopmentData | ( | ) |
References m_ResourceCurves, and m_tov_PollenCurveTable.
|
inline |
References m_ResourceCurves.
Referenced by tovGetPollenNectarCurve().
void PollenNectarDevelopmentData::ReadFlowerNumberCrop | ( | void | ) |
Function to read the flower number for crops.
References g_msg, l_flower_number_crops, m_flower_number_crop, CfgStr::value(), and MapErrorMsg::Warn().
Referenced by PollenNectarDevelopmentData().
void PollenNectarDevelopmentData::RecalculatePollenNectarCurvesForYear | ( | void | ) |
Recalculate the pollen and nectar curves for a year for the habitat species. This function only be called once per year (the first day in a year).
References g_weather, Weather::GetTempAfterDays(), m_ResourceCurves, m_year_temp, and updateHabitatFlowerResource().
Referenced by Landscape::Tick().
PollenNectarData PollenNectarDevelopmentData::supplyNectarHabitatSpeciesCurrentDay | ( | int | a_curve_num | ) |
Supply the current nectar for the given species.
References Calendar::DayInYear(), g_date, m_nectar_habitat_species, and m_ResourceCurves.
Referenced by Landscape::CalHaibitatFlowerResource().
PollenNectarData PollenNectarDevelopmentData::supplyNectarHabitatSpeciesGivenDay | ( | int | a_curve_num, |
int | a_given_day | ||
) |
Supply the current nectar for the given species for the given day after today.
References Calendar::DayInYear(), g_date, m_nectar_habitat_species, and m_ResourceCurves.
Referenced by Landscape::CalHaibitatFlowerResource().
PollenNectarData PollenNectarDevelopmentData::supplyPollenHabitatSpeciesCurrentDay | ( | int | a_curve_num | ) |
Supply the current pollen for the given species.
References Calendar::DayInYear(), g_date, m_pollen_habitat_species, and m_ResourceCurves.
Referenced by Landscape::CalHaibitatFlowerResource().
PollenNectarData PollenNectarDevelopmentData::supplyPollenHabitatSpeciesGivenDay | ( | int | a_curve_num, |
int | a_given_day | ||
) |
Supply the pollen for the given species for the given day after today.
References Calendar::DayInYear(), g_date, m_pollen_habitat_species, and m_ResourceCurves.
Referenced by Landscape::CalHaibitatFlowerResource().
|
inline |
Uses the tov ref num to find the relevant curve set and return it as a pointer.
References GetPollenNectarCurve(), and m_tov_PollenCurveTable.
Referenced by LE::SetPollenNectarType().
|
inline |
Uses the tov ref num to find the relevant curve set and return it as a pointer.
References m_tov_PollenCurveTable.
Referenced by LE::SetPollenNectarType().
|
inline |
Uses the tov ref num to find the relevant curve set and return it as a pointer.
References m_tov_PollenCurveTable_sowing_flag.
Referenced by LE::CalculateFlowerResourceForCropSow(), and VegElement::DoDevelopment().
void PollenNectarDevelopmentData::updateHabitatFlowerResource | ( | void | ) |
The function to update the development of flower resource for all the habitat speccies.
References m_nectar_habitat_species, m_pollen_habitat_species, PollenNectarData::m_quality, PollenNectarData::m_quantity, and m_ResourceCurves.
Referenced by RecalculatePollenNectarCurvesForYear().
|
protected |
The array to store the flower numbers for crop species.
Referenced by PollenNectarDevelopmentData(), and ReadFlowerNumberCrop().
|
protected |
This is the dictionary to store the nectar for every habitat species in a year.
Referenced by PollenNectarDevelopmentData(), supplyNectarHabitatSpeciesCurrentDay(), supplyNectarHabitatSpeciesGivenDay(), and updateHabitatFlowerResource().
|
protected |
This is used to store the number of species for habitat.
Referenced by PollenNectarDevelopmentData().
|
protected |
This is the dictionary to store the pollen for every habitat species in a year.
Referenced by PollenNectarDevelopmentData(), supplyPollenHabitatSpeciesCurrentDay(), supplyPollenHabitatSpeciesGivenDay(), and updateHabitatFlowerResource().
|
protected |
This is the main data set, it contains the resource curves for each species.
Referenced by GetPollenNectarCurve(), PollenNectarDevelopmentData(), RecalculatePollenNectarCurvesForYear(), supplyNectarHabitatSpeciesCurrentDay(), supplyNectarHabitatSpeciesGivenDay(), supplyPollenHabitatSpeciesCurrentDay(), supplyPollenHabitatSpeciesGivenDay(), updateHabitatFlowerResource(), and ~PollenNectarDevelopmentData().
|
protected |
This is a look-up table, it contains for each tov the corresponding curve number to use.
Referenced by PollenNectarDevelopmentData(), tovGetPollenNectarCurve(), tovGetPollenNectarCurveRef(), and ~PollenNectarDevelopmentData().
|
protected |
This is a look-up table for the the crops to indicate it starts to accumulate degree days from sowing time.
Referenced by PollenNectarDevelopmentData(), and tovGetPollenNectarCurveSowingFlag().
|
protected |
This is used to store one year temperature data.
Referenced by RecalculatePollenNectarCurvesForYear().