File failed to load: https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/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 Class Reference

The class for base Aphid using subpopulation method. More...

#include <Aphid.h>

Inheritance diagram for Aphid:
SubPopulation TAnimal TALMaSSObject

Public Member Functions

 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. More...
 
virtual bool OnFarmEvent (FarmToDo event)
 Must be reimplemented if used in descendent classes. Sets the action on a management event. More...
 
virtual void calPopuDensity (void)
 Function to calculate the weighted population density for the cell. More...
 
virtual void calSuitability (void)
 Function to calculate the suitability for the cell. More...
 
void calSuitabilityShared (void)
 
virtual void doReproduction (void)
 
virtual void doMovement (void)
 
virtual double calCellRelatedMortalityWeight (void)
 This function is used to calculate the cell realted weight to multiply with the temperature and age based mortality rate. In this base class, it always return 1. More...
 
virtual double calBioticMortalityRate (int a_life_stage)
 The function to calculate the biotic mortalit rate. More...
 
double calBioticMortalityRateShared (int a_life_stage)
 
void killAllPopulation ()
 The function to kill all aphids in the cell due to e.g. pesticide applications. More...
 
virtual void killByPredator (double a_num)
 The function to kill the aphids by the given number. More...
 
void killPopulationByProportion (double a_proportion)
 The function to kill the aphids by the given proportion. More...
 
virtual void BeginStep (void)
 BeingStep behaviour - must be implemented in descendent classes. More...
 
- Public Member Functions inherited from SubPopulation
 SubPopulation (int p_x, int p_y, Landscape *p_L, SubPopulation_Population_Manager *p_NPM, bool a_empty_flag, int a_index_x, int a_index_y, double *p_suitability=NULL, double *p_weight_density=NULL, int number=-1, int a_SpeciesID=999, TTypesOfLandscapeElement p_winter_landscape_host=tole_Foobar, TTypesOfLandscapeElement p_summer_landscape_host=tole_Foobar, bool p_farm_flag=false)
 Subpopulation constructor. More...
 
virtual ~SubPopulation ()=default
 
unsigned getSpeciesID ()
 A typical interface function - this one returns the SpeciesID number as an unsigned integer. More...
 
void setSpeciesID (unsigned a_spID)
 A typical interface function - this one returns the SpeciesID number as an unsigned integer. More...
 
double getNumforOneLifeStage (int source_type)
 Return the number of animals in a specific life stage in the cell. More...
 
double getTotalSubpopulation (void)
 Return totalpopulation in the cell. More...
 
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. More...
 
void addAnimalNumGivenStage (int source_type, blitz::Array< double, 1 > *a_animal_num_array)
 Add animal number for the given life stage. More...
 
void removeAnimalNumGivenStage (int source_type)
 Function to remove one life stage completely. More...
 
double removeAnimalPortionGivenStageColumn (int source_type, int a_column, double a_prop)
 Remove propotion of animals for the given species and age. More...
 
void addAnimalFromAnotherCell (int source_type, int a_column, double a_num)
 Add the number of animal at the given source and column that moved from another grid. More...
 
blitz::Array< double, 1 > getArrayForOneLifeStage (int life_stage)
 Get the numbers of the given life stage at different ages. More...
 
virtual void Step ()
 Step behaviour - must be implemented in descendent classes. More...
 
virtual void doDevelopment ()
 
virtual void doDropingWings ()
 For some specices, they drop the wings at some situation. More...
 
virtual void doMortality ()
 
blitz::Array< double, 1 > getFlyingArray (int ind)
 Supply the flying array for flying. More...
 
double getFlyingNum (int ind)
 Supply the number of winged ones that want to fly away,. More...
 
void setWinterHostPeriod (int start_month, int end_month)
 Set the available period for winter landscape host. More...
 
void setSummerHostPeriod (int start_month, int end_month)
 Set the available period for summer landscape host. More...
 
virtual void setParasitoidNum (double a_num)
 The function to set the parasitoid number. More...
 
virtual void setParasitoidEggNum (double a_num)
 The function to set the parasitoid egg number. More...
 
virtual void giveBirthParasitoidEgg (double a_egg_num)
 The function to give birth of parasitiod eggs. More...
 
virtual void killByParasitoid ()
 The function to kill subpopulation by parasitoid. More...
 
virtual void hatchParasitoidEggs ()
 The function to hatch parasitoid eggs. More...
 
double getPrasitoidNum ()
 The function to supply the parasitoid number. More...
 
double getPrasitoidEggNum ()
 
int supplySuitability ()
 
void setFlyLocalMovFlag (bool a_flag)
 The function to set the flag to enable local movement triged by landing activity. More...
 
bool isNewlyLanded ()
 Supply whether it is newly landed grid. More...
 
bool isFarm ()
 The function to return whether it is part of farm. More...
 
- Public Member Functions inherited from TAnimal
 TAnimal (int x, int y, Landscape *L)
 The TAnimal constructor saving the x,y, location and the landscape pointer. More...
 
 TAnimal (int x, int y)
 The TAnimal constructor saving the x,y used if landscape is already set. More...
 
void SetGuardMapIndex (int a_index_x, int a_index_y)
 Set the guard map index, this is used to avoid two animals operating in the same location when using multithread. More...
 
unsigned SupplyFarmOwnerRef () const
 Get the current location farm ref if any. More...
 
AnimalPosition SupplyPosition () const
 Returns the objects location and habitat type and veg type. More...
 
APoint SupplyPoint () const
 Returns the objects location in ALMaSS coordinates. More...
 
int SupplyPolygonRef () const
 Returns the polygon reference where the object is located. More...
 
TTypesOfLandscapeElement SupplyPolygonType () const
 Returns the polygon type where the object is located. More...
 
int Supply_m_Location_x () const
 Returns the ALMaSS x-coordinate. More...
 
int Supply_m_Location_y () const
 Returns the ALMaSS y-coordinate. More...
 
int SupplyGuardCellX () const
 Returns the x-index to the guard cell. More...
 
int SupplyGuardCellY () const
 Returns the y-index to the guard cell. More...
 
int SupplyAge () const
 Returns the animals age in days. More...
 
void SetAge (int a_age)
 Sets the animals age in days. More...
 
virtual void KillThis ()
 Sets all parameters ready for object destruction. More...
 
virtual void CopyMyself ()
 Used to copy the object details to another in descendent classes. More...
 
void SetX (const int a_x)
 Sets the x-coordinate. More...
 
void SetY (const int a_y)
 Sets the y-coordinate. More...
 
virtual void ReinitialiseObject (int a_x, int a_y, Landscape *a_l_ptr)
 
virtual void ReinitialiseObject (int a_x, int a_y)
 Used to re-use an object - must be implemented in descendent classes. More...
 
virtual int WhatState ()
 Returns the objects current state number. More...
 
virtual void Dying ()
 A wrapped for KillThis - ideally should not be used. More...
 
void CheckManagement ()
 Used to start a check for any management related effects at the objects current location. More...
 
void CheckManagementXY (int a_x, int a_y)
 Used to start a check for any management related effects at x,y. More...
 
- Public Member Functions inherited from TALMaSSObject
int GetCurrentStateNo () const
 Returns the current state number. More...
 
void SetCurrentStateNo (int a_num)
 Sets the current state number. More...
 
bool GetStepDone () const
 Returns the step done indicator flag. More...
 
void SetStepDone (bool a_bool)
 Sets the step done indicator flag. More...
 
virtual void EndStep ()
 EndStep behaviour - must be implemented in descendent classes. More...
 
void ReinitialiseObjectBase ()
 Used to initialise an object. More...
 
 TALMaSSObject ()
 The constructor for TALMaSSObject. More...
 
virtual ~TALMaSSObject ()=default
 The destructor for TALMaSSObject. More...
 

Private Attributes

void(Aphid::* m_cal_suitability_func_pointer )(void)
 The function pointer for suitability calculations. More...
 
double(Aphid::* m_cal_biotic_mortality_func_pointer )(int)
 The function pointer for biotic mortality rate calculation. More...
 
std::vector< double > m_history_density_vec
 The array to store the previous density in the past days. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from TAnimal
static void SetSimulationWidth (int a_value)
 Sets the simulation width. More...
 
static void SetSimulationHeight (int a_value)
 Sets the simulation height. More...
 
static void SetDayInYear (int a_value)
 Sets the day in year attribute. More...
 
static void SetOurLandscape (Landscape *a_value)
 Sets the landscape pointer. More...
 
static void SetTempToday (double a_value)
 Sets the temperature today attribute. More...
 
- Static Public Member Functions inherited from TALMaSSObject
static void OnArrayBoundsError ()
 Used for debugging only, tests basic object properties. More...
 
- Protected Member Functions inherited from TAnimal
void CorrectWrapRound ()
 Corrects wrap around co-ordinate problems. More...
 
- Protected Attributes inherited from SubPopulation
int m_index_x
 Variable to store the index of x in the population manager. More...
 
int m_index_y
 Variable to store the index of y in the population manager. More...
 
SubPopulation_Population_Managerm_OurPopulationManager
 This is a time saving pointer to the correct population manager object. More...
 
double * m_popu_density
 Variable to store the weighted population density pointer. More...
 
double * m_suitability
 Variable to store the suitability pointer. More...
 
double m_whole_population_in_cell
 Variable to track the whole population in the current cell. More...
 
blitz::Array< double, 1 > m_population_each_life_stage
 Array to hold the population number for each life stage. More...
 
blitz::Array< double, 2 > m_animal_num_array
 Variables to record numbers of the animals at different life stages and age in canlander days. More...
 
blitz::Array< double, 2 > m_temp_animal_num_array
 Tempraral variables for manipulting the animal number array. More...
 
blitz::Array< double, 1 > m_temp_droping_wings_array
 Array used for droping wings. More...
 
blitz::Array< double, 1 > m_died_number_each_life_stage
 Array used for mortality. More...
 
blitz::Array< double, 2 > m_flying_array
 Array used to store the number of winged adults willing to fly away. More...
 
blitz::Array< double, 2 > m_local_moving_array
 Array used to store the number of adults willing for local movement. More...
 
TTypesOfLandscapeElement m_winter_landscape_host
 The flag to show whether it is a winter landscape type host. More...
 
TTypesOfLandscapeElement m_summer_landscape_host
 The flag to show whether it is a summer landscape type host. More...
 
std::vector< int > m_winter_landscape_host_period
 The staring and ending month for the winter landscape host. More...
 
std::vector< int > m_summer_landscape_host_period
 The starting and ending month for the summer landscape host. More...
 
bool m_farm_flag
 The flag to show whether it is part of farm. More...
 
double m_parasitoid_num
 The variable to record the number of parasitoid. More...
 
double m_parasitoid_egg_num
 The variable to recourd the number of parasitoid egg. More...
 
bool m_landing_local_move_flag
 landing_enable_local_movement_flag More...
 
- Protected Attributes inherited from TAnimal
int m_Location_x
 The objects ALMaSS x coordinate. More...
 
int m_Location_y
 The objects ALMaSS y coordinate. More...
 
int m_guard_cell_x
 The index x to the guard cell. More...
 
int m_guard_cell_y
 The index y to the guard cell. More...
 
int m_AgeDays {0}
 To hold the age in days. More...
 
PesticideToxicity m_my_pesticide
 
- Protected Attributes inherited from TALMaSSObject
int m_CurrentStateNo
 The basic state number for all objects - '-1' indicates death. More...
 
bool m_StepDone
 Indicates whether the iterative step code is done for this timestep. More...
 
- Static Protected Attributes inherited from TAnimal
static Landscapem_OurLandscape = nullptr
 A pointer to the landscape object shared with all TAnimal objects. More...
 
static int m_SimulationWidth = 0
 A static member for the simulation width because it is often used by descendent classes. More...
 
static int m_SimulationHeight = 0
 A static member for the simulation height because it is often used by descendent classes. More...
 
static double m_TemperatureToday = 0.0
 A holder for the temperature today shared with all TAnimal objects. More...
 
static int m_DayInYear = 0
 A holder for the day in year shared with all TAnimal objects. More...
 

Detailed Description

The class for base Aphid using subpopulation method.

Constructor & Destructor Documentation

◆ 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.

68  : SubPopulation(p_x, p_y, p_L, p_NPM, a_empty_flag, a_index_x, a_index_y, p_suitability, p_weight_density, -1, a_SpeciesID, p_winter_landscape_host, p_summer_landscape_host, p_farm_flag)
69 {
72  /*
73  if (strcmp(cfg_AphidSpeciesName.value(), "Pea aphid")==0){
74  m_cal_suitability_func_pointer = &Aphid::calSuitabilityPeaAphid;
75  m_cal_biotic_mortality_func_pointer = &Aphid::calBioticMortalityRatePeaAphid;
76  }
77 
78  if (strcmp(cfg_AphidSpeciesName.value(), "English grain aphid")==0){
79  m_cal_suitability_func_pointer = &Aphid::calSuitabilityPeaAphid;
80  m_cal_biotic_mortality_func_pointer = &Aphid::calBioticMortalityRatePeaAphid;
81  }
82  */
83 
84  int temp_running_species = m_OurPopulationManager->m_running_species_number;
85  m_history_density_vec.resize(cfg_AphidDensityHistoryDayNumVec.value()[temp_running_species]);
86  for (int i=0; i<cfg_AphidDensityHistoryDayNumVec.value()[temp_running_species]; i++){
88  }
89 }

References calBioticMortalityRateShared(), calSuitabilityShared(), cfg_AphidDensityHistoryDayNumVec, m_cal_biotic_mortality_func_pointer, m_cal_suitability_func_pointer, m_history_density_vec, SubPopulation::m_OurPopulationManager, and CfgArray_Int::value().

Member Function Documentation

◆ BeginStep()

void Aphid::BeginStep ( void  )
virtual

BeingStep behaviour - must be implemented in descendent classes.

Reimplemented from SubPopulation.

457  {
458  CheckManagement();
459 }

References TAnimal::CheckManagement().

◆ calBioticMortalityRate()

double Aphid::calBioticMortalityRate ( int  a_life_stage)
virtual

The function to calculate the biotic mortalit rate.

Reimplemented from SubPopulation.

174  {
175  return (this->*m_cal_biotic_mortality_func_pointer)(a_life_stage);
176 }

References m_cal_biotic_mortality_func_pointer.

◆ calBioticMortalityRateShared()

double Aphid::calBioticMortalityRateShared ( int  a_life_stage)
178  {
179  if (a_life_stage == toa_Egg){
180  return 0;
181  }
182 
183  else{
184  return cfg_AphidPredatorsMortalityVec.value()[m_OurPopulationManager->m_running_species_number];
185  }
186 }

References cfg_AphidPredatorsMortalityVec, SubPopulation::m_OurPopulationManager, toa_Egg, and CfgArray_Double::value().

Referenced by Aphid().

◆ calCellRelatedMortalityWeight()

double Aphid::calCellRelatedMortalityWeight ( void  )
virtual

This function is used to calculate the cell realted weight to multiply with the temperature and age based mortality rate. In this base class, it always return 1.

Reimplemented from SubPopulation.

401  {
402  double dendepmort = (1.0 - 1/(cfg_APhidIndependentSurvivorVec.value()[m_OurPopulationManager->m_running_species_number]*(1+cfg_AphidDensityMortalityStrengthVec.value()[m_OurPopulationManager->m_running_species_number]*m_history_density_vec[0])));
403  if (dendepmort < 0.0) dendepmort = 0.0; else if (dendepmort > 1.0) dendepmort = 1.0;
404  return dendepmort;
405 }

References cfg_AphidDensityMortalityStrengthVec, cfg_APhidIndependentSurvivorVec, m_history_density_vec, SubPopulation::m_OurPopulationManager, and CfgArray_Double::value().

◆ calPopuDensity()

void Aphid::calPopuDensity ( void  )
virtual

Function to calculate the weighted population density for the cell.

Reimplemented from SubPopulation.

91  {
92  *m_popu_density = -1;
93  //double current_biomass = m_OurLandscape->SupplyVegBiomass(m_Location_x, m_Location_y);
94  //double current_biomass = m_OurLandscape->SupplyGreenBiomassTotal(m_Location_x, m_Location_y);
96  //check no-grow winter host
98  current_biomass = cfg_AphidNoGrowWinterHostGreenBiomass.value();
99  }
100  if (!m_farm_flag){
101  current_biomass *= (cfg_AphidNoncropBiomassWeightVec.value()[m_OurPopulationManager->m_running_species_number]*m_weight_biomass);
102  }
104  if(current_biomass > 0)
105  *m_popu_density = m_raw_popu_density/current_biomass;
106 
107  //copy the densities first
108  for (int i=0; i<cfg_AphidDensityHistoryDayNumVec.value()[m_OurPopulationManager->m_running_species_number]-1; i++){
110  }
112 }

References cfg_AphidDensityHistoryDayNumVec, cfg_AphidNoGrowWinterHostGreenBiomass, cfg_AphidNoncropBiomassWeightVec, SubPopulation::m_farm_flag, m_history_density_vec, TAnimal::m_Location_x, TAnimal::m_Location_y, TAnimal::m_OurLandscape, SubPopulation::m_OurPopulationManager, SubPopulation::m_popu_density, SubPopulation::m_whole_population_in_cell, SubPopulation::m_winter_landscape_host, Landscape::SupplyInterestedGreenBiomassTotal(), SubPopulation_Population_Manager::supplySizeSubpopulationCell(), Landscape::SupplyVegType(), SubPopulation_Population_Manager::supplyWinterHostOn(), tole_Foobar, tov_NoGrowth, CfgFloat::value(), CfgArray_Int::value(), and CfgArray_Double::value().

◆ calSuitability()

void Aphid::calSuitability ( void  )
virtual

Function to calculate the suitability for the cell.

Reimplemented from SubPopulation.

189  {
191 }

References m_cal_suitability_func_pointer.

◆ calSuitabilityShared()

void Aphid::calSuitabilityShared ( void  )
Note
This is to avoid suitability being zero for winter host without growing.
115  {
116  *m_suitability = 0;
117  //first summer host
119  *m_suitability = 1;
120  }
123  //if(m_OurPopulationManager->isSummerHostTov(current_veg_type) && (m_OurLandscape->SupplyGreenBiomassProp(m_Location_x, m_Location_y)>0)){
124  if(m_OurPopulationManager->isSummerHostToc(current_crop_type)){
125  *m_suitability = 1;
126  }
127  }
128 
129 
130 
133  //if(m_OurPopulationManager->isWinterHostTov(current_veg_type) && (m_OurLandscape->SupplyGreenBiomassProp(m_Location_x, m_Location_y)>0)){
134  if(m_OurPopulationManager->isWinterHostToc(current_crop_type)){
135  *m_suitability = 1;
136  }
137  }
138 
139  /*
140  *m_suitability = 1;
141  if(m_summer_landscape_host==tole_Foobar){
142  if(!m_farm_flag){
143  *m_suitability = 0;
144  }
145  else{
146  TTypesOfVegetation current_veg_type = m_OurLandscape->SupplyVegType(m_Location_x, m_Location_y);
147  if(!(m_OurPopulationManager->isSummerHostTov(current_veg_type))){
148  *m_suitability = 0;
149  }
150  }
151 
152  }
153  else{
154  int current_month = m_OurLandscape->SupplyMonth();
155  vector<int> temp_period = m_OurPopulationManager->supplySummerTolePeriod(m_summer_landscape_host);
156  if (current_month < temp_period.at(0) || current_month > temp_period.at(1)){
157  *m_suitability = 0;
158  }
159  }
160  */
161 
162  //no biomass, no suitability
164  if (propgreen< 0.1) *m_suitability *= (propgreen*10);
165 
166  //check winter host
169  *m_suitability = 1;
170  }
171 
172 }

References SubPopulation::m_farm_flag, TAnimal::m_Location_x, TAnimal::m_Location_y, TAnimal::m_OurLandscape, SubPopulation::m_OurPopulationManager, SubPopulation::m_suitability, SubPopulation::m_summer_landscape_host, SubPopulation::m_winter_landscape_host, Landscape::SupplyCropType(), Landscape::SupplyGreenBiomassProp(), SubPopulation_Population_Manager::supplySummerHostOn(), SubPopulation_Population_Manager::supplyWinterHostOn(), and tole_Foobar.

Referenced by Aphid().

◆ doMovement()

void Aphid::doMovement ( void  )
virtual

Reimplemented from SubPopulation.

324  {
325 
326  //local movement
327  vector<int> temp_local_move_stages = m_OurPopulationManager->supplyVecLocMoveLifeStages();
328  int move_index = 0;
329  for (int move_index_in_vec = 0; move_index_in_vec < temp_local_move_stages.size(); move_index_in_vec++){
330  move_index = temp_local_move_stages[move_index_in_vec];
331  if(m_population_each_life_stage(move_index) > 0){
332  int index_x = g_vector_x[g_random_fnc(8)];
333  int index_y = g_vector_y[g_random_fnc(8)];
334  int land_index_x = m_index_x + index_x;
335  int land_index_y = m_index_y + index_y;
336  if(!(land_index_x<0 || land_index_x>=m_OurPopulationManager->supplyCellNumX() || land_index_y<0 || land_index_y>=m_OurPopulationManager->supplyCellNumY())){
337  if(m_OurPopulationManager->getSuitabilityInCell(land_index_x, land_index_y)>0 && (m_OurPopulationManager->getTotalSubpopulationInCell(land_index_x, land_index_y)< m_whole_population_in_cell)){
338  Eigen::VectorXd temp_move_array = m_animal_num_array.row(move_index)*cfg_AphidLocalMovementFractionVec.value()[m_OurPopulationManager->m_running_species_number];
339  m_OurPopulationManager->supplySubPopulationPointer(land_index_x, land_index_y)->addAnimalNumGivenStage(move_index, temp_move_array);
340  temp_move_array.array() *= -1;
341  addAnimalNumGivenStage(move_index, temp_move_array);
342  }
343  }
344  }
345  }
346 }

References SubPopulation::addAnimalNumGivenStage(), cfg_AphidLocalMovementFractionVec, g_random_fnc(), SubPopulation_Population_Manager::getSuitabilityInCell(), SubPopulation_Population_Manager::getTotalSubpopulationInCell(), SubPopulation::m_animal_num_array, SubPopulation::m_index_x, SubPopulation::m_index_y, SubPopulation::m_OurPopulationManager, SubPopulation::m_population_each_life_stage, SubPopulation::m_whole_population_in_cell, SubPopulation_Population_Manager::supplyCellNumX(), SubPopulation_Population_Manager::supplyCellNumY(), SubPopulation_Population_Manager::supplySubPopulationPointer(), SubPopulation_Population_Manager::supplyVecLocMoveLifeStages(), and CfgArray_Double::value().

◆ doReproduction()

void Aphid::doReproduction ( void  )
virtual

Reimplemented from SubPopulation.

193  {
194  int temp_max_num_col = m_OurPopulationManager->supplyMaxColNum();
195  for (int i = toa_Aptera; i<m_OurPopulationManager->supplyLifeStageNum(); i++){
196  if(i==toa_Male) continue; //male doesn't produce anything
197  if (i==toa_Aptera || i == toa_Alate){
198  double temp_re_number_total_wing = 0.0;
199  double temp_re_number_total_unwing = 0.0;
200  double temp_re_number = 0.0;
201  double temp_re_prop = 0.0;
202 
205  //if(!m_farm_flag) a_growth_stage = 50;
206  //double a_density = m_whole_population_in_cell/m_OurLandscape->SupplyVegCover(m_Location_x, m_Location_y)/m_OurPopulationManager->supplySizeSubpopulationCell();
207  //double current_biomass = m_OurLandscape->SupplyGreenBiomassTotal(m_Location_x, m_Location_y);
209  //double current_biomass = m_OurLandscape->SupplyGreenBiomassProp(m_Location_x, m_Location_y);
210  double a_density = *m_popu_density;
212  double current_month = m_OurLandscape->SupplyMonth();
215  //int temp_re_number = cfg_AphidReproductionNymphNum.value() * getNumforOneLifeStage(toa_Aptera);
216  for(int j=0; j<temp_max_num_col; j++){
217  double temp_mother_num = m_animal_num_array(i,j);
218  if(temp_mother_num<1) continue;
219  int next_life = m_OurPopulationManager->calOffspringStage(i, &temp_re_number,m_OurPopulationManager->supplyAgeInDayDegree(i,j), a_density, a_growth_stage, &temp_re_prop,( m_winter_landscape_host != tole_Foobar));
220  //Adjust fecundity for certain crop growth stages;
221  // Grain Aphid
222  //Increase fecundity when heading starts;
223  if( m_OurPopulationManager->m_running_species_number == toas_EG){
224  if (m_farm_flag && VegHeight >= 65 && green_biomass >= 500 ) {
225  if (!((green_biomass + DeadBiomass) > 850 && (green_biomass / (DeadBiomass + green_biomass)) < 0.8)){
226  temp_re_number *= 1.3;
227  }
228  }
229  //Adjust fecundity and alate prop after GS 73
230  if (m_farm_flag && VegHeight >=65 && (green_biomass+DeadBiomass) > 850 && (green_biomass/(DeadBiomass+green_biomass)) < 0.8) {
231  temp_re_number *= (green_biomass / (DeadBiomass + green_biomass));
232  temp_re_prop = 0.90;
233 
234  }
235  //Decrease alate prop on cereals before GS 73
236  if (m_farm_flag && VegHeight < 65 && (green_biomass + DeadBiomass) < 850 && (green_biomass / (DeadBiomass + green_biomass)) > 0.8) {
237  temp_re_prop /= 5;
238  }
239  }
240  // Pea aphid
241  // Adjust fecundity and alate production when green biomass decreases
242  if (m_OurPopulationManager->m_running_species_number == toas_PEA) {
243  if (m_farm_flag && (green_biomass / (DeadBiomass + green_biomass)) < 0.95) {
244  temp_re_number *= (green_biomass / (DeadBiomass + green_biomass));
245  temp_re_prop *= 2;
246  if (temp_re_prop >= 1) temp_re_prop = 1;
247  }
248  }
249  //Increase alate prop in spring - ALL APHIDS
250  if (!m_farm_flag && (current_month == 4 || current_month == 5)) {
251  temp_re_prop = 0.7;
252  }
253 
254 
256  if (temp_re_number > 0)
257  {
258  //sexual ones
259  if (next_life == toa_Nymph_M || next_life == toa_Nymph_F){
260  addAnimalNumGivenStageColumn(next_life, m_OurPopulationManager->supplyNewestIndex(next_life), temp_mother_num*temp_re_number);
261  //m_OurPopulationManager->updateWholePopulationArray(toa_Nymph, temp_re_number);
262  //check if it is the first time
266  }
267  }
268 
269  if (next_life == toa_Nymph || next_life == toa_Nymph_W){
270  //winged ones asexaual
271  if(temp_re_prop > 0){
272  addAnimalNumGivenStageColumn(toa_Nymph_W, m_OurPopulationManager->supplyNewestIndex(int(toa_Nymph_W)), temp_mother_num*temp_re_number*temp_re_prop);
273  //m_OurPopulationManager->updateWholePopulationArray(toa_Nymph, temp_re_number);
274  //check if it is the first time
278  }
279  }
280  if(temp_re_prop>=0 && temp_re_prop<=1){
281  //if(temp_re_prop ==0 && m_landing_local_move_flag){
282  // temp_re_number *=10;
283  //}
284  addAnimalNumGivenStageColumn(toa_Nymph, m_OurPopulationManager->supplyNewestIndex(int(toa_Nymph)), temp_mother_num*temp_re_number*(1-temp_re_prop));
285  //m_OurPopulationManager->updateWholePopulationArray(toa_Nymph, temp_re_number);
286  //check if it is the first time
290  }
291  }
292  else{
293  cout<<"NEGATIVE: "<<temp_re_prop<<endl;
294  }
295  }
296  }
297  }
298  }
299  //laying eggs
300  if (i==toa_Female){
301  if(m_farm_flag) return;
302  //int temp_egg_number = cfg_AphidEggNumPerDay.value() * getNumforOneLifeStage(toa_Female);
303  double temp_egg_number = 0;
304  double temp_egg_number_total = 0;
305  for(int j=0; j<temp_max_num_col; j++){
306  double temp_mother_num = m_animal_num_array(i,j);
307  if(temp_mother_num<1) continue;
308  int temp_age= m_OurPopulationManager->supplyAgeInDay(i,j)-1;
309  if (temp_age<0) temp_age = 0;
310  int next_life = m_OurPopulationManager->calOffspringStage(toa_Female, &temp_egg_number, temp_age);
311  if(temp_egg_number>0){
312  temp_egg_number_total += temp_mother_num*temp_egg_number;
313  }
314  }
315 
316  if (temp_egg_number_total > 0){
317  addAnimalNumGivenStageColumn(toa_Egg, 0, temp_egg_number_total);
318  //m_OurPopulationManager->updateWholePopulationArray(toa_Egg, temp_egg_number);
319  }
320  }
321  }
322 }

References SubPopulation::addAnimalNumGivenStageColumn(), SubPopulation_Population_Manager::calOffspringStage(), SubPopulation::m_animal_num_array, SubPopulation::m_farm_flag, TAnimal::m_Location_x, TAnimal::m_Location_y, TAnimal::m_OurLandscape, SubPopulation::m_OurPopulationManager, SubPopulation::m_popu_density, SubPopulation::m_winter_landscape_host, SubPopulation_Population_Manager::setFirstFlagLifeStage(), SubPopulation_Population_Manager::setOldIndex(), SubPopulation_Population_Manager::supplyAgeInDay(), SubPopulation_Population_Manager::supplyAgeInDayDegree(), Landscape::SupplyDeadBiomass(), SubPopulation_Population_Manager::supplyFirstFlagLifeStage(), Landscape::SupplyGreenBiomass(), Landscape::SupplyGreenBiomassProp(), Landscape::SupplyInterestedGreenBiomassTotal(), SubPopulation_Population_Manager::supplyLifeStageNum(), SubPopulation_Population_Manager::supplyMaxColNum(), Landscape::SupplyMonth(), SubPopulation_Population_Manager::supplyNewestIndex(), Landscape::SupplyPolyRef(), Landscape::SupplyVegGrowthStage(), Landscape::SupplyVegHeight(), Landscape::SupplyVegType(), SubPopulation_Population_Manager::supplyWinterHostOn(), toa_Alate, toa_Aptera, toa_Egg, toa_Female, toa_Male, toa_Nymph, toa_Nymph_F, toa_Nymph_M, toa_Nymph_W, toas_EG, toas_PEA, tole_Foobar, and tov_NoGrowth.

◆ killAllPopulation()

void Aphid::killAllPopulation ( )

The function to kill all aphids in the cell due to e.g. pesticide applications.

427  {
428  //cout<<"Killling allllllllllll"<<endl;
430  m_animal_num_array.fill(0);
432  for(int i = toa_Egg; i<= toa_Male; i++){
433  if (m_population_each_life_stage(i) <=0) continue;
434  double kill_num = floor(-1*m_population_each_life_stage(i));
435  //m_OurPopulationManager->updateWholePopulationArray(i, kill_num);
436  }
438  }
439 }

References SubPopulation::m_animal_num_array, SubPopulation::m_population_each_life_stage, SubPopulation::m_whole_population_in_cell, toa_Egg, and toa_Male.

Referenced by OnFarmEvent().

◆ killByPredator()

void Aphid::killByPredator ( double  a_num)
virtual

The function to kill the aphids by the given number.

348  {
349 /*
350  //There are more than enough to kill, kill the required number
351  double killed_num = 0;
352  int start_killing_index = g_random_fnc(toa_WingedFemale);
353  int kill_index = 0;
354  double survival_rate = 0;
355 
356  //start with the random index until killed enough
357  for (int i=0; i<toa_WingedFemale; i++){
358  kill_index = start_killing_index + i;
359  if(kill_index>=toa_WingedFemale) kill_index -= toa_WingedFemale;
360  //the number can be killed
361  double existing_num = m_population_each_life_stage(kill_index)/m_cell_size;
362  //we have enough to kill
363  if(existing_num>=a_num){
364  killed_num = a_num;
365  }
366  //not enough, kill the existing number and move to the next life stage
367  else{
368  killed_num = existing_num;
369  }
370  //calculate the survival rate
371  survival_rate = 1-(killed_num/m_population_each_life_stage(kill_index));
372  //kill the population
373  m_animal_num_array.row(kill_index).array() *= survival_rate;
374  m_population_each_life_stage(kill_index) -= killed_num;
375  m_whole_population_in_cell -= killed_num;
376  m_raw_popu_density = m_whole_population_in_cell/m_OurPopulationManager->supplySizeSubpopulationCell();
377  a_num -= killed_num;
378  //killed enough, stop
379  if(a_num<=0){
380  break;
381  }
382  }
383 */
384  if (m_whole_population_in_cell > a_num+1)
385  {
386  const double surviverate = 1.0-(a_num / m_whole_population_in_cell); // if 100 in cell and kill 20, rate = 20/100 = 0.2
387  m_animal_num_array *= surviverate;
389  m_population_each_life_stage *= surviverate;
390  //m_raw_popu_density = m_whole_population_in_cell / m_OurPopulationManager->supplySizeSubpopulationCell();
391  }
392  else {
393  m_animal_num_array.setZero();
396  //m_raw_popu_density = 0.0;
397  }
398 
399 }

References SubPopulation::m_animal_num_array, SubPopulation::m_population_each_life_stage, and SubPopulation::m_whole_population_in_cell.

◆ killPopulationByProportion()

void Aphid::killPopulationByProportion ( double  a_proportion)

The function to kill the aphids by the given proportion.

441  {
442  double temp_survive_rate = 1-a_proportion;
443  //only do this if there are aphids
445  m_animal_num_array *= temp_survive_rate;
446  m_whole_population_in_cell *= temp_survive_rate;
447  for(int i = toa_Egg; i<= toa_Male; i++){
448  if (m_population_each_life_stage(i) <=0) continue;
449  double kill_num = floor(-1*m_population_each_life_stage(i));
450  //update the whole population array, this is only used for displaying the population for qt
451  //m_OurPopulationManager->updateWholePopulationArray(i, kill_num);
452  }
453  m_population_each_life_stage *= temp_survive_rate;
454  }
455 }

References SubPopulation::m_animal_num_array, SubPopulation::m_population_each_life_stage, SubPopulation::m_whole_population_in_cell, toa_Egg, and toa_Male.

Referenced by OnFarmEvent().

◆ OnFarmEvent()

bool Aphid::OnFarmEvent ( FarmToDo  )
virtual

Must be reimplemented if used in descendent classes. Sets the action on a management event.

Reimplemented from TAnimal.

407  {
408 
409  bool result = false;
410 
411  switch (event) {
412  //harvest, kill all
413  case harvest:
414  result = true;
416  break;
417  //insecticide, kill by proportion
418  case insecticide_treat:
419  case biocide:
420  result = true;
422  break;
423  }
424  return result;
425 }

References biocide, cfg_AphidMortalityByPesticideVec, harvest, insecticide_treat, killAllPopulation(), killPopulationByProportion(), SubPopulation::m_OurPopulationManager, and CfgArray_Double::value().

Member Data Documentation

◆ m_cal_biotic_mortality_func_pointer

double(Aphid::* Aphid::m_cal_biotic_mortality_func_pointer) (int)
private

The function pointer for biotic mortality rate calculation.

Referenced by Aphid(), and calBioticMortalityRate().

◆ m_cal_suitability_func_pointer

void(Aphid::* Aphid::m_cal_suitability_func_pointer) (void)
private

The function pointer for suitability calculations.

Referenced by Aphid(), and calSuitability().

◆ m_history_density_vec

std::vector<double> Aphid::m_history_density_vec
private

The array to store the previous density in the past days.

Referenced by Aphid(), calCellRelatedMortalityWeight(), and calPopuDensity().


The documentation for this class was generated from the following files:
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
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
SubPopulation::SubPopulation
SubPopulation(int p_x, int p_y, Landscape *p_L, SubPopulation_Population_Manager *p_NPM, bool a_empty_flag, int a_index_x, int a_index_y, double *p_suitability=NULL, double *p_weight_density=NULL, int number=-1, int a_SpeciesID=999, TTypesOfLandscapeElement p_winter_landscape_host=tole_Foobar, TTypesOfLandscapeElement p_summer_landscape_host=tole_Foobar, bool p_farm_flag=false)
Subpopulation constructor.
Definition: SubPopulation.cpp:49
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
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_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
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
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::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
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
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
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
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
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
SubPopulation::m_suitability
double * m_suitability
Variable to store the suitability pointer.
Definition: SubPopulation.h:77
biocide
Definition: Treatment.h:116
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
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
cfg_AphidMortalityByPesticideVec
CfgArray_Double cfg_AphidMortalityByPesticideVec("APHID_MORTALITY_BY_PESTICIDE_VEC", CFG_CUSTOM, 4, vector< double >{0.95, 0.95, 0.95, 0.95})
CfgArray_Int::value
std::vector< int > value() const
Definition: Configurator.h:201
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
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
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
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
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
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