![]() |
ALMaSS
1.2 (after EcoStack, March 2024)
The Animal, Landscape and Man Simulation System
|
#include <PesticideToxicity.h>
Public Member Functions | |
PesticideToxicity () | |
void | doToxicity (double a_mass, double a_para_index) |
The default function to calculate the toxicity effect. More... | |
void | setToxicityFuncPointer (void(PesticideToxicity::*a_toxicity_func)(double, double)) |
The function to set the toxicity function pointer. More... | |
void | setDecayFuncPointer (void(PesticideToxicity::*a_decay_func)(void)) |
The function to set the decay function pointer. More... | |
void | doOverspray (void) |
The function for the animal to be oversprayed when the pesticide application is happening where the animal is. More... | |
void | doContact (void) |
The function to calculate the pesticide contamination through contact. More... | |
virtual void | tick (int a_step_counter_in_a_day, double a_mass=1, double a_para_index=0) |
The function to update pesticide contamination every time step. More... | |
std::vector< double > | supplyPesticideVector (void) |
The function to return the pesticide amount array. More... | |
void | SetPesticideVector (std::vector< double > a_pest_amount_vec) |
double | supplyPesticide (PlantProtectionProducts a_type=ppp_1) |
The function to supply the pesticide residue for the given pesticide type, the default type is 0, i.e., single product. More... | |
double | supplyPestMortality (void) |
The function to supply the host's mortality rate caused by pest. More... | |
void | setHostAnimalPointer (TAnimal *animal) |
The function to set the host animal pointer. More... | |
virtual void | reset (void) |
Reset PesticideToxicity class, this should be called when the host animal is dead. More... | |
void | eatingFromStorePest (PesticideStore *a_store, double a_eating_amount, double a_total_amount) |
The function for eating from a store to add pesticide. More... | |
double | GetTotalPest (void) |
Return the total pesticide. More... | |
![]() | |
PesticideStore () | |
void | addPesticide (double eating_amount, double amount_per_square, double(Landscape::*a_supply_pest_func_pointer)(int, int, PlantProtectionProducts), int loc_x, int loc_y) |
The function to add pesticide based on the eating amount and the amount of food per square meter. More... | |
void | addPesticide (double a_mount, PlantProtectionProducts a_type) |
The function to add pesticide based on the given amount and the given type. More... | |
std::vector< double > * | supplyPesticide (void) |
The function to return the pesticide amount array. More... | |
double | supplyPesticide (PlantProtectionProducts a_type) |
The function to return the pesticide amount. More... | |
double | supplyTotalPesticide (void) |
The function to return the total pesticide amount. More... | |
void | doDecay (void) |
The default fuction to decay the pesticide body burden. More... | |
virtual void | tick (int a_step_counter_in_a_day) |
The function to update pesticide contamination every time step. More... | |
Private Attributes | |
TAnimal * | m_my_animal_host |
The pointer to the host animal. More... | |
double | m_total_pest_sum |
The summation of the total pesticide body burden. More... | |
double | m_pest_hazard |
The hazard of the pesticide. More... | |
void(PesticideToxicity::* | m_toxicity_func_pointer )(double, double) |
The function pointer to point the function for toxicity effect calculation. More... | |
void(PesticideToxicity::* | m_decay_func_pointer )(void) |
The function pointer to point the function for decay calculation. More... | |
double | m_my_animal_mortality |
The mortality rate of the host animal caused by pesticide body burden. More... | |
int | m_location_previous_x |
The x-coordinate is used to remember the location from the previous time-step. More... | |
int | m_location_previous_y |
The y-coordinate is used to remember the location from the previous time-step. More... | |
Additional Inherited Members | |
![]() | |
static void | setLandscapePointer (Landscape *a_landscape) |
The function to set the static landscape pointer. More... | |
![]() | |
std::vector< double > | m_pest_amount_vec |
The vector to store the pesticide amount for each pesticide. More... | |
![]() | |
static Landscape * | m_ALandscape = nullptr |
The static landscape pointer. More... | |
PesticideToxicity::PesticideToxicity | ( | ) |
void PesticideToxicity::doContact | ( | void | ) |
The function to calculate the pesticide contamination through contact.
References l_pest_NoPPPs, PesticideStore::m_ALandscape, m_location_previous_x, m_location_previous_y, m_my_animal_host, PesticideStore::m_pest_amount_vec, pest_contact_animal_ratio, TAnimal::Supply_m_Location_x(), TAnimal::Supply_m_Location_y(), Landscape::SupplyPesticidePlantSurface(), CfgInt::value(), and CfgFloat::value().
Referenced by tick().
void PesticideToxicity::doOverspray | ( | void | ) |
The function for the animal to be oversprayed when the pesticide application is happening where the animal is.
References g_rand_uni_fnc(), PesticideStore::m_ALandscape, m_my_animal_host, PesticideStore::m_pest_amount_vec, pest_animal_overspray_chance, pest_overspray_animal_rate, pest_overspray_animal_surface, TAnimal::Supply_m_Location_x(), TAnimal::Supply_m_Location_y(), Landscape::SupplySprayPesticideRate(), Landscape::SupplySprayPesticideType(), and CfgFloat::value().
Referenced by Osmia_Female::OnFarmEvent().
void PesticideToxicity::doToxicity | ( | double | a_mass, |
double | a_para_index | ||
) |
The default function to calculate the toxicity effect.
References l_pest_NoPPPs, m_my_animal_mortality, PesticideStore::m_pest_amount_vec, m_pest_hazard, m_total_pest_sum, pest_animal_effect_amount, pest_animal_killing_rate, CfgInt::value(), and CfgArray_Double::value().
Referenced by PesticideToxicity().
void PesticideToxicity::eatingFromStorePest | ( | PesticideStore * | a_store, |
double | a_eating_amount, | ||
double | a_total_amount | ||
) |
The function for eating from a store to add pesticide.
References PesticideStore::addPesticide(), l_pest_NoPPPs, PesticideStore::m_pest_amount_vec, PesticideStore::supplyPesticide(), and CfgInt::value().
|
inline |
|
virtual |
Reset PesticideToxicity class, this should be called when the host animal is dead.
Reimplemented from PesticideStore.
References l_pest_NoPPPs, m_location_previous_x, m_location_previous_y, m_my_animal_mortality, PesticideStore::m_pest_amount_vec, m_pest_hazard, m_total_pest_sum, and CfgInt::value().
Referenced by TAnimal::KillThis(), and PesticideToxicity().
|
inline |
|
inline |
The function to set the host animal pointer.
References m_my_animal_host.
Referenced by TAnimal::TAnimal().
|
inline |
References PesticideStore::m_pest_amount_vec.
|
inline |
|
inline |
The function to supply the pesticide residue for the given pesticide type, the default type is 0, i.e., single product.
References PesticideStore::m_pest_amount_vec.
|
inline |
|
inline |
The function to supply the host's mortality rate caused by pest.
References m_my_animal_mortality.
Referenced by Osmia_Female::BeginStep(), and Osmia_Female::st_Develop().
|
virtual |
The function to update pesticide contamination every time step.
References cfg_pest_animal_contact_on, doContact(), l_pest_enable_pesticide_engine, m_decay_func_pointer, m_toxicity_func_pointer, and CfgBool::value().
Referenced by Osmia_Female::BeginStep().
|
private |
The function pointer to point the function for decay calculation.
Referenced by PesticideToxicity(), setDecayFuncPointer(), and tick().
|
private |
The x-coordinate is used to remember the location from the previous time-step.
Referenced by doContact(), and reset().
|
private |
The y-coordinate is used to remember the location from the previous time-step.
Referenced by doContact(), and reset().
|
private |
The pointer to the host animal.
Referenced by doContact(), doOverspray(), and setHostAnimalPointer().
|
private |
The mortality rate of the host animal caused by pesticide body burden.
Referenced by doToxicity(), reset(), and supplyPestMortality().
|
private |
The hazard of the pesticide.
Referenced by doToxicity(), and reset().
|
private |
The summation of the total pesticide body burden.
Referenced by doToxicity(), GetTotalPest(), and reset().
|
private |
The function pointer to point the function for toxicity effect calculation.
Referenced by PesticideToxicity(), setToxicityFuncPointer(), and tick().