Loading [MathJax]/extensions/ams.js
ALMaSS  1.2 (after EcoStack, March 2024)
The Animal, Landscape and Man Simulation System
All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Aphid.h
Go to the documentation of this file.
1 /*
2 *******************************************************************************************************
3 Copyright (c) 2021, Xiaodong Duan, Aarhus University
4 All rights reserved.
5 
6 Redistribution and use in source and binary forms, with or without modification, are permitted provided
7 that the following conditions are met:
8 
9 Redistributions of source code must retain the above copyright notice, this list of conditions and the
10 following disclaimer.
11 Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
12 the following disclaimer in the documentation and/or other materials provided with the distribution.
13 
14 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
15 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
16 FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
17 BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
18 BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
19 BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
20 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
21 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
22 ********************************************************************************************************
23 */
32 //---------------------------------------------------------------------------
33 #ifndef AphidH
34 #define AphidH
35 //---------------------------------------------------------------------------
36 
37 //---------------------------------------------------------------------------
39 //------------------------------------------------------------------------------
40 
45 enum Aphid_Object : int
46 {
47  toa_Egg = 0,
59 };
60 
62 enum Aphid_Species : int
63 {
64  toas_EG = 0, //english grain aphid
65  toas_PEA, //pea aphid
66  toas_BB, //black bean aphid
67  toas_PP, //potato aphid
69 };
70 
71 
76 class Aphid : public SubPopulation
77 {
78 private:
84  std::vector<double> m_history_density_vec;
85 
86 public:
88  Aphid(int p_x, int p_y, int p_w, int p_h, Landscape *p_L, Aphid_Population_Manager *p_NPM, bool a_empty_flag, double *p_suitability, double *p_weight_density, int number, int a_index_x, int a_index_y, int a_SpeciesID = 919, TTypesOfLandscapeElement p_winter_landscape_host = tole_Foobar, TTypesOfLandscapeElement p_summer_landscape_host = tole_Foobar, bool p_farm_flag = false);
89  virtual bool OnFarmEvent(FarmToDo event);
90 
91  virtual void calPopuDensity(void);
92  virtual void calSuitability(void);
93  void calSuitabilityShared(void);
94  virtual void doReproduction(void);
95  virtual void doMovement(void);
96  virtual double calCellRelatedMortalityWeight(void);
97  virtual double calBioticMortalityRate(int a_life_stage);
98  double calBioticMortalityRateShared(int a_life_stage);
100  void killAllPopulation();
102  virtual void killByPredator(double a_num);
104  void killPopulationByProportion(double a_proportion);
105  virtual void BeginStep(void);
106 };
107 
108 #endif
toa_Alate
Definition: Aphid.h:53
SubPopulation::m_popu_density
double * m_popu_density
Variable to store the weighted population density pointer.
Definition: SubPopulation.h:75
toas_EG
Definition: Aphid.h:64
toas_count
Definition: Aphid.h:68
Landscape::SupplyGreenBiomass
double SupplyGreenBiomass(int a_polyref)
Returns the green biomass of the vegetation using the polygon reference number a_polyref.
Definition: Landscape.h:1612
harvest
Definition: Treatment.h:94
SubPopulation::m_winter_landscape_host
TTypesOfLandscapeElement m_winter_landscape_host
The flag to show whether it is a winter landscape type host.
Definition: SubPopulation.h:96
SubPopulation_Population_Manager::supplyWinterHostOn
bool supplyWinterHostOn(void)
Definition: SubPopulation_Population_Manager.h:350
Aphid::doMovement
virtual void doMovement(void)
Definition: Aphid.cpp:324
toa_count
Definition: Aphid.h:58
insecticide_treat
Definition: Treatment.h:83
SubPopulation_Population_Manager::supplySummerHostOn
bool supplySummerHostOn(void)
Definition: SubPopulation_Population_Manager.h:349
Landscape::SupplyVegType
TTypesOfVegetation SupplyVegType(int a_x, int a_y)
Returns the vegetation type of the polygon using the polygon reference number a_polyref or coordinate...
Definition: Landscape.h:1925
Aphid_Species
Aphid_Species
Definition: Aphid.h:62
SubPopulation::addAnimalNumGivenStageColumn
void addAnimalNumGivenStageColumn(int source_type, int a_column, double a_num)
Add animal number for the given life stage at specific column (age) in the animal number array.
Definition: SubPopulation.cpp:100
cfg_AphidMaxWindSpeed
CfgFloat cfg_AphidMaxWindSpeed
The maximum speed that allows an aphid to fly.
cfg_AphidNoGrowWinterHostGreenBiomass
CfgFloat cfg_AphidNoGrowWinterHostGreenBiomass("APHID_NO_GROW_WINTER_HOST_GREEN_BIOMASS", CFG_CUSTOM, 1000)
Green biomass for no-grow winter host.
Landscape::SupplyGreenBiomassProp
double SupplyGreenBiomassProp(int a_polyref)
Returns the green biomass as a proportion of biomass of the vegetation using the polygon reference nu...
Definition: Landscape.h:1632
tole_Foobar
Definition: LandscapeFarmingEnums.h:183
toa_Male
Definition: Aphid.h:55
Aphid::calSuitabilityShared
void calSuitabilityShared(void)
Definition: Aphid.cpp:115
SubPopulation_Population_Manager::supplyVecLocMoveLifeStages
std::vector< int > supplyVecLocMoveLifeStages()
Supply the vector of life stages that can do local movement.
Definition: SubPopulation_Population_Manager.h:321
CfgStr
String configurator entry class.
Definition: Configurator.h:173
Aphid::Aphid
Aphid(int p_x, int p_y, int p_w, int p_h, Landscape *p_L, Aphid_Population_Manager *p_NPM, bool a_empty_flag, double *p_suitability, double *p_weight_density, int number, int a_index_x, int a_index_y, int a_SpeciesID=919, TTypesOfLandscapeElement p_winter_landscape_host=tole_Foobar, TTypesOfLandscapeElement p_summer_landscape_host=tole_Foobar, bool p_farm_flag=false)
Aphid constructor.
Definition: Aphid.cpp:68
SubPopulation_Population_Manager::getTotalSubpopulationInCell
double getTotalSubpopulationInCell(int x_indx, int y_indx)
Supply the total subpopulation size in the given cell.
Definition: SubPopulation_Population_Manager.cpp:324
CfgFloat::value
double value() const
Definition: Configurator.h:142
FarmToDo
FarmToDo
Definition: Treatment.h:31
Landscape::SupplyMonth
int SupplyMonth(void)
Passes a request on to the associated Calendar class function, returns m_month + 1 (the calendar mont...
Definition: Landscape.h:2272
SubPopulation_Population_Manager::getSuitabilityInCell
double getSuitabilityInCell(int x_indx, int y_indx)
Supply the suitability in the given cell.
Definition: SubPopulation_Population_Manager.h:238
toa_Nymph_F
Definition: Aphid.h:50
Aphid::OnFarmEvent
virtual bool OnFarmEvent(FarmToDo event)
Must be reimplemented if used in descendent classes. Sets the action on a management event.
Definition: Aphid.cpp:407
Aphid::m_cal_suitability_func_pointer
void(Aphid::* m_cal_suitability_func_pointer)(void)
The function pointer for suitability calculations.
Definition: Aphid.h:80
SubPopulation::m_OurPopulationManager
SubPopulation_Population_Manager * m_OurPopulationManager
This is a time saving pointer to the correct population manager object.
Definition: SubPopulation.h:73
SubPopulation_Population_Manager::supplyFirstFlagLifeStage
bool supplyFirstFlagLifeStage(int life_stage)
The function to supply the flag of first for the given life stage.
Definition: SubPopulation_Population_Manager.h:276
cfg_AphidPredatorsMortalityVec
CfgArray_Double cfg_AphidPredatorsMortalityVec("APHID_PREDATORS_MORTALITY_VEC", CFG_CUSTOM, 4, vector< double >{0.025, 0.025, 0.02, 0.02})
Landscape::SupplyDeadBiomass
double SupplyDeadBiomass(int a_polyref)
Returns the dead biomass of the vegetation using the polygon reference number a_polyref or based on t...
Definition: Landscape.h:1652
SubPopulation_Population_Manager::supplySubPopulationPointer
SubPopulation * supplySubPopulationPointer(int indx, int indy)
Supply the pointer of the subpopulation object in the given cell.
Definition: SubPopulation_Population_Manager.cpp:338
SubPopulation_Population_Manager::supplySizeSubpopulationCell
double supplySizeSubpopulationCell()
Supply the size of aphid subpopulation cell.
Definition: SubPopulation_Population_Manager.h:228
Aphid_Population_Manager
The class to handle all Aphid population related matters in the whole landscape.
Definition: Aphid_Population_Manager.h:98
Aphid::calBioticMortalityRate
virtual double calBioticMortalityRate(int a_life_stage)
The function to calculate the biotic mortalit rate.
Definition: Aphid.cpp:174
Landscape::SupplyVegGrowthStage
double SupplyVegGrowthStage(int a_polyref)
Returns the vegetation growth stage of the vegetation using the polygon reference number a_polyref or...
Definition: Landscape.h:1642
toa_Nymph_M
Definition: Aphid.h:51
Aphid::killPopulationByProportion
void killPopulationByProportion(double a_proportion)
The function to kill the aphids by the given proportion.
Definition: Aphid.cpp:441
Aphid::calBioticMortalityRateShared
double calBioticMortalityRateShared(int a_life_stage)
Definition: Aphid.cpp:178
TTypesOfLandscapeElement
TTypesOfLandscapeElement
Values that represent the types of landscape polygon that are represented in ALMaSS.
Definition: LandscapeFarmingEnums.h:57
Landscape
The landscape class containing all environmental and topographical data.
Definition: Landscape.h:142
toa_Nymph_W
Definition: Aphid.h:49
Aphid::m_history_density_vec
std::vector< double > m_history_density_vec
The array to store the previous density in the past days.
Definition: Aphid.h:84
SubPopulation::m_index_y
int m_index_y
Variable to store the index of y in the population manager.
Definition: SubPopulation.h:71
MapErrorMsg
Definition: MapErrorMsg.h:43
TAnimal::m_Location_y
int m_Location_y
The objects ALMaSS y coordinate.
Definition: PopulationManager.h:366
TAnimal::m_OurLandscape
static Landscape * m_OurLandscape
A pointer to the landscape object shared with all TAnimal objects.
Definition: PopulationManager.h:342
TAnimal::CheckManagement
void CheckManagement()
Used to start a check for any management related effects at the objects current location.
Definition: PopulationManager.cpp:1591
Aphid::m_cal_biotic_mortality_func_pointer
double(Aphid::* m_cal_biotic_mortality_func_pointer)(int)
The function pointer for biotic mortality rate calculation.
Definition: Aphid.h:82
Aphid::calPopuDensity
virtual void calPopuDensity(void)
Function to calculate the weighted population density for the cell.
Definition: Aphid.cpp:91
SubPopulation::addAnimalNumGivenStage
void addAnimalNumGivenStage(int source_type, blitz::Array< double, 1 > *a_animal_num_array)
Add animal number for the given life stage.
Definition: SubPopulation.cpp:121
Aphid::killAllPopulation
void killAllPopulation()
The function to kill all aphids in the cell due to e.g. pesticide applications.
Definition: Aphid.cpp:427
toa_WingedFemale
Definition: Aphid.h:56
SubPopulation::m_summer_landscape_host
TTypesOfLandscapeElement m_summer_landscape_host
The flag to show whether it is a summer landscape type host.
Definition: SubPopulation.h:98
toa_Nymph
Definition: Aphid.h:48
CfgArray_Double
Definition: Configurator.h:208
SubPopulation::m_suitability
double * m_suitability
Variable to store the suitability pointer.
Definition: SubPopulation.h:77
Aphid::BeginStep
virtual void BeginStep(void)
BeingStep behaviour - must be implemented in descendent classes.
Definition: Aphid.cpp:457
biocide
Definition: Treatment.h:116
toas_BB
Definition: Aphid.h:66
toa_Female
Definition: Aphid.h:54
SubPopulation_Population_Manager::supplyAgeInDay
int supplyAgeInDay(int lifestage_index, int column_index)
The function to return the age in days given an element in the subpopulation table.
Definition: SubPopulation_Population_Manager.cpp:990
SubPopulation_Population_Manager::supplyLifeStageNum
int supplyLifeStageNum()
Supply the number of life stage.
Definition: SubPopulation_Population_Manager.h:242
tov_NoGrowth
Definition: LandscapeFarmingEnums.h:197
CfgArray_Double::value
std::vector< double > value() const
Definition: Configurator.h:219
SubPopulation_Population_Manager::supplyMaxColNum
int supplyMaxColNum()
Supply the maximum number of column in the development array.
Definition: SubPopulation_Population_Manager.h:244
SubPopulation::m_animal_num_array
blitz::Array< double, 2 > m_animal_num_array
Variables to record numbers of the animals at different life stages and age in canlander days.
Definition: SubPopulation.h:83
TTypesOfCrops
TTypesOfCrops
Definition: LandscapeFarmingEnums.h:781
toa_WingedMale
Definition: Aphid.h:57
toas_PEA
Definition: Aphid.h:65
Landscape::SupplyVegHeight
double SupplyVegHeight(int a_polyref)
Returns the height of the vegetation using the polygon reference number a_polyref or based on the x,...
Definition: Landscape.h:1527
Aphid::calCellRelatedMortalityWeight
virtual double calCellRelatedMortalityWeight(void)
This function is used to calculate the cell realted weight to multiply with the temperature and age b...
Definition: Aphid.cpp:401
cfg_AphidMortalityByPesticideVec
CfgArray_Double cfg_AphidMortalityByPesticideVec("APHID_MORTALITY_BY_PESTICIDE_VEC", CFG_CUSTOM, 4, vector< double >{0.95, 0.95, 0.95, 0.95})
cfg_AphidSpeciesName
CfgStr cfg_AphidSpeciesName
This variable decides which aphid species to run. The default one is the English grain aphid.
Aphid
The class for base Aphid using subpopulation method.
Definition: Aphid.h:76
CfgFloat
Double configurator entry class.
Definition: Configurator.h:126
CfgArray_Int::value
std::vector< int > value() const
Definition: Configurator.h:201
g_msg
MapErrorMsg * g_msg
Definition: MapErrorMsg.cpp:41
SubPopulation_Population_Manager::supplyCellNumY
int supplyCellNumY()
Supply number of subpopulation in y coordinate.
Definition: SubPopulation_Population_Manager.h:222
SubPopulation::m_farm_flag
bool m_farm_flag
The flag to show whether it is part of farm.
Definition: SubPopulation.h:104
CFG_CUSTOM
Definition: Configurator.h:70
g_random_fnc
int g_random_fnc(const int a_range)
Definition: ALMaSS_Random.cpp:74
cfg_APhidIndependentSurvivorVec
CfgArray_Double cfg_APhidIndependentSurvivorVec("APHID_INDEPENDENT_SURVIVOR_VEC", CFG_CUSTOM, 4, vector< double >{0.9, 0.9, 0.9, 0.9})
SubPopulation_Population_Manager::supplyAgeInDayDegree
double supplyAgeInDayDegree(int lifestage_index, int column_index)
Definition: SubPopulation_Population_Manager.h:308
SubPopulation_Population_Manager::setFirstFlagLifeStage
void setFirstFlagLifeStage(int life_stage, bool pvalue)
The function to set the flag indicating whether a given lifestage is the first time of existing.
Definition: SubPopulation_Population_Manager.h:274
SubPopulation
The class for base animal using subpopulation method.
Definition: SubPopulation.h:56
Aphid::calSuitability
virtual void calSuitability(void)
Function to calculate the suitability for the cell.
Definition: Aphid.cpp:189
cfg_AphidDensityHistoryDayNumVec
CfgArray_Int cfg_AphidDensityHistoryDayNumVec("APHID_DENSITY_HISTORY_DAY_NUM_VEC", CFG_CUSTOM, 4, vector< int >{4, 4, 4, 4})
SubPopulation::m_whole_population_in_cell
double m_whole_population_in_cell
Variable to track the whole population in the current cell.
Definition: SubPopulation.h:79
cfg_AphidNoncropBiomassWeightVec
CfgArray_Double cfg_AphidNoncropBiomassWeightVec("APHID_NONCROP_BIOMASS_WEIGHT_VEC", CFG_CUSTOM, 4, vector< double >{0.2, 0.2, 0.2, 0.2})
cfg_AphidDensityMortalityStrengthVec
CfgArray_Double cfg_AphidDensityMortalityStrengthVec("APHID_DENSITY_MORTALITY_STRENGTH_VEC", CFG_CUSTOM, 4, vector< double >{0.012, 0.012, 0.02, 0.02})
Landscape::SupplyInterestedGreenBiomassTotal
double SupplyInterestedGreenBiomassTotal(int a_polyref)
Returns the interested green biomass of the vegetation+weeds using the polygon reference number a_pol...
Definition: Landscape.h:1607
Aphid::doReproduction
virtual void doReproduction(void)
Definition: Aphid.cpp:193
Aphid::killByPredator
virtual void killByPredator(double a_num)
The function to kill the aphids by the given number.
Definition: Aphid.cpp:348
Landscape::SupplyCropType
TTypesOfCrops SupplyCropType(int a_x, int a_y)
Returns the crop type of the polygon using the polygon reference number a_polyref or coordinates a_x,...
Definition: Landscape.h:1931
SubPopulation::m_index_x
int m_index_x
Variable to store the index of x in the population manager.
Definition: SubPopulation.h:69
CfgArray_Int
Array_Int configurator entry class.
Definition: Configurator.h:189
TAnimal::m_Location_x
int m_Location_x
The objects ALMaSS x coordinate.
Definition: PopulationManager.h:362
cfg_AphidLocalMovementFractionVec
CfgArray_Double cfg_AphidLocalMovementFractionVec("APHID_LOCAL_MOVEMENT_FRACTION_VEC", CFG_CUSTOM, 4, vector< double >{0.025, 0.025, 0.1, 0.1})
SubPopulation_Population_Manager::supplyCellNumX
int supplyCellNumX()
Supply number of subpopulation in x coordinate.
Definition: SubPopulation_Population_Manager.h:220
SubPopulation_Population_Manager::calOffspringStage
virtual int calOffspringStage(int current_stage, double *offspring_num=NULL, double a_age=1, double a_density=-1, double a_growth_stage=0, double *a_propotion=NULL, bool winter_host_flag=false)
Calculate the offspring life stage.
Definition: SubPopulation_Population_Manager.cpp:1117
Landscape::SupplyPolyRef
int SupplyPolyRef(int a_x, int a_y)
Get the in map polygon reference number from the x, y location.
Definition: Landscape.h:2157
SubPopulation_Population_Manager::setOldIndex
void setOldIndex(int life_stage, int p_value)
The function to set the oldest index for the given life stage.
Definition: SubPopulation_Population_Manager.cpp:701
Aphid_Object
Aphid_Object
Enumerator for aphid object types.
Definition: Aphid.h:45
toas_PP
Definition: Aphid.h:67
SubPopulation::m_population_each_life_stage
blitz::Array< double, 1 > m_population_each_life_stage
Array to hold the population number for each life stage.
Definition: SubPopulation.h:81
toa_Aptera
Definition: Aphid.h:52
SubPopulation_Population_Manager::supplyNewestIndex
int supplyNewestIndex(int life_stage_index)
Definition: SubPopulation_Population_Manager.h:248
toa_Egg
Definition: Aphid.h:47