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
SubPopulation_Population_Manager.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 SubPopulation_Population_ManagerH
34 #define SubPopulation_Population_ManagerH
35 //---------------------------------------------------------------------------
36 
37 //---------------------------------------------------------------------------
38 
39 class SubPopulation;
41 
47 {
48  public:
50  int x;
52  int y;
54  int w;
56  int h;
58  int species;
64  bool empty_flag;
69  int index_x;
70  int index_y;
71 };
72 
78 {
79 private:
81  blitz::Array<double, 1> m_total_num_each_stage;
83  double m_size_cell;
84 
86  std::vector<std::vector<int>> m_index_next_life_stage;
88  blitz::Array<double, 1> m_lowest_temperature_die;
90  blitz::Array<double, 1> m_highest_temperature_die;
92  blitz::Array<double, 1> m_optimal_temperature;
93  friend class Subpopulation;
94 
95 protected:
97  blitz::Array<double, 2> m_development_degree_day;
107  int m_sub_w;
109  int m_sub_h;
111  blitz::Array<double, 2> m_cell_popu_density;
113  blitz::Array<double, 2> m_cell_suitability;
115  blitz::Array<SubPopulation*, 2> m_the_subpopulation_array;
117  blitz::Array<double, 4> m_short_move_mask;
119  blitz::Array<double, 4> m_long_move_mask;
135  blitz::Array<int,1> m_wind_speed_lookup_table;
152  blitz::Array<double, 2> m_accumu_degree_days;
154  blitz::Array<int, 2> m_index_new_old;
158  blitz::Array<double, 1> m_lowest_temp_dev;
160  blitz::Array<double, 2> m_life_circle_path;
164  blitz::Array<bool, 1> m_first_flag_life_stage;
166  blitz::Array<double, 1> m_current_flying_array;
168  blitz::Array<double, 1> m_current_landing_array;
170  std::vector <TTypesOfLandscapeElement> m_winter_hosts_tole;
172  std::vector <std::vector<int>> m_winter_hosts_tole_period;
174  std::map <int, int> m_winter_hosts_tole_period_map;
176  std::vector <TTypesOfVegetation> m_winter_hosts_tov;
178  std::vector <TTypesOfLandscapeElement> m_summer_hosts_tole;
180  std::vector <std::vector<int>> m_summer_hosts_tole_period;
182  std::map <int, int> m_summer_hosts_tole_period_map;
184  std::vector <TTypesOfVegetation> m_summer_hosts_tov;
186  blitz::Array<double, 2> m_current_mortality_array;
188  blitz::Array<double, 2> m_wind_direction_array;
189 
191  blitz::Array<blitz::Array<double, 2>, 2> m_landing_masks;
192 
194  std::vector<int> m_flying_life_stage_array;
196  std::vector<int> m_landing_life_stage_array;
202  std::vector<std::vector<SubPopulation*>> m_vec_subpopulation_pointers_polygon;
207 
208 
209 
210 
211 public:
212  SubPopulation_Population_Manager(Landscape* L, string DevReproFile ="", int a_sub_w=10, int a_sub_h=10, int a_num_life_stage=5, int a_max_long_dist = 1000, int a_peak_long_dist = 100, float a_scale_wind_speed = 1.1, float a_max_wind_speed = 16, int a_wind_direc_num = 8, int a_wind_speed_step_size = 2, int a_max_alive_day = 300);
214  virtual ~SubPopulation_Population_Manager (void);
216  double supplyAllPopulationGivenStage(int index);
218  double supplyTotalPopulationInCell(int x_indx, int y_indx);
224  double supplyCellWidth(){return m_sub_w;}
226  double supplyCellHeight(){return m_sub_h;}
232  virtual void subpopuBaseOutputProbe();
234  double getTotalSubpopulationInCell(int x_indx, int y_indx);
236  double getSubpopulationInCellLifeStage( int x_indx, int y_indx, int a_life_stage);
238  double getSuitabilityInCell(int x_indx, int y_indx) {return m_cell_suitability(y_indx, x_indx);}
240  SubPopulation* supplySubPopulationPointer(int indx, int indy);
246  int supplyNextLifeStage(int life_circle_index, int life_stage_index) {return m_life_circle_path(life_circle_index, life_stage_index);}
247  std::vector<int> supplyOldEnoughIndex(int life_stage_index) {return m_index_next_life_stage.at(life_stage_index);}
248  int supplyNewestIndex(int life_stage_index) { return m_index_new_old(life_stage_index, 0);}
249  virtual unsigned GetLiveArraySize(int a_listindex);
251  void readDevReproFile(string inputfile);
253  void relocatePopulation(void);
254  virtual void DoLast();
255  virtual void DoFirst();
257  virtual void calLongMovementMask(void);
259  void doDevelopment();
261  void addNewDay();
263  //virtual int calNextStage(int current_stage);
265  virtual int calNextStage(int current_stage, double density = 1);
267  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);
269  virtual void updateDevelopmentSeason(){};
271  void updateWholePopulationArray(int a_listindex, double number);
272  void updateWholePopulationArray(blitz::Array<double, 1> a_array);
274  void setFirstFlagLifeStage(int life_stage, bool pvalue) {m_first_flag_life_stage(life_stage) = pvalue;}
276  bool supplyFirstFlagLifeStage(int life_stage) {return m_first_flag_life_stage(life_stage);}
278  void setOldIndex(int life_stage, int p_value);
280  void doFlying(int ind, int index_x, int index_y);
282  void doLocalMovement(int index_x, int index_y, double proportion);
292  virtual unsigned supplyDevelopmentSeason () {return 0;};
294  virtual void updateMortalityArray (void);
296  double supplyMortality(int a_life_stage, int a_age) {return m_current_mortality_array(a_life_stage, a_age);}
298  blitz::Array<double, 2> supplyMortalityWholeArray(void) {return m_current_mortality_array;}
300  blitz::Array<double, 1> supplyMortalityStageArray(int a_life_stage) {return m_current_mortality_array(a_life_stage, blitz::Range::all());}
302  double calLandingCurve(double a_dis, double a_peak, double a_furthest);
304  virtual void initialisePopulation();
305  SubPopulation* CreateObjects(TAnimal *pvo, struct_SubPopulation* data, int number);
307  int supplyAgeInDay(int lifestage_index, int column_index);
308  double supplyAgeInDayDegree(int lifestage_index, int column_index) {return m_accumu_degree_days(lifestage_index, column_index);}
309  virtual void SupplyLocXY(unsigned index_x, unsigned index_y, int & x, int & y)
310  {
311  int indx = index_x;
312  int indy = index_y;
313  x = m_the_subpopulation_array(indy, indx)->Supply_m_Location_x();
314  y = m_the_subpopulation_array(indy, indx)->Supply_m_Location_y();
315  }
324  virtual unsigned GetPopulationSize(int a_listindex) {
325  return supplyAllPopulationGivenStage(a_listindex);
326  }
327 
329  virtual bool isEnoughNextLifeStage(int a_life_stage);
334 
336  virtual void doParasitoidDevelopment(){;};
338  virtual void doSpecicesLastThing(){;}
340  void updateWholePopulation();
342  virtual void SetNoProbesAndSpeciesSpecificFunctions(int a_pn);
344  virtual void readHosts(string a_file_name);
345 
347  virtual void writeCalibrationFiles(void){;};
348 
351 
352 
354  #ifdef APHID_DEBUG
355  double m_num_killed_by_parasitoid;
356  double m_num_parasitoid;
357  double m_num_parasitoid_egg;
358  double m_num_new_parasitoid_egg_daily;
359  #endif
360 
361 protected:
362  virtual void Run(int NoTSteps);
363 };
364 
365 #endif
Population_Manager_Base
Base class for all population managers.
Definition: PopulationManager.h:554
SubPopulation_Population_Manager::supplyWinterTolePeriod
std::vector< int > supplyWinterTolePeriod(TTypesOfLandscapeElement a_tole)
The function to supply the available period vector for the given winter tole host.
Definition: SubPopulation_Population_Manager.h:331
SubPopulation_Population_Manager::getSubpopulationInCellLifeStage
double getSubpopulationInCellLifeStage(int x_indx, int y_indx, int a_life_stage)
Supply the subpopulation size at the given life stage in the given cell.
Definition: SubPopulation_Population_Manager.cpp:331
SubPopulation_Population_Manager::m_long_move_mask_x_num_half
int m_long_move_mask_x_num_half
Variable to record the dimension of the short distance movement mask. - x.
Definition: SubPopulation_Population_Manager.h:143
cfg_Subpopu_Density_Threshold
CfgFloat cfg_Subpopu_Density_Threshold("SUBPOPU_DENSITY_THRESHOLD", CFG_CUSTOM, 1000)
SubPopulation_Population_Manager
The class to handle all subpopulation-based ainimal population related matters in the whole landscape...
Definition: SubPopulation_Population_Manager.h:77
SubPopulation_Population_Manager::supplyAllPopulationGivenStage
double supplyAllPopulationGivenStage(int index)
Supply the population size at the given life stage for the who landscape.
Definition: SubPopulation_Population_Manager.cpp:342
M_PI
#define M_PI
Definition: sunset.h:33
SubPopulation_Population_Manager::m_max_short_distance
double m_max_short_distance
The longest distance that the specieces can move for short distance dispersal.
Definition: SubPopulation_Population_Manager.h:137
SubPopulation_Population_Manager::m_the_subpopulation_array
blitz::Array< SubPopulation *, 2 > m_the_subpopulation_array
Vector to store the all the pointers for the subpopulation object.
Definition: SubPopulation_Population_Manager.h:115
Landscape::SupplyNumberOfPolygons
unsigned int SupplyNumberOfPolygons(void)
Returns the number of polygons in the landscape.
Definition: Landscape.h:2127
WARN_FILE
Definition: MapErrorMsg.h:37
SubPopulation_Population_Manager::m_total_num_each_stage
blitz::Array< double, 1 > m_total_num_each_stage
Array to hold the total number of alive animals under different life stages in the whole landscape.
Definition: SubPopulation_Population_Manager.h:81
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
SubPopulation_Population_Manager::m_max_alive_days
int m_max_alive_days
The longest alive day among all the life stages.
Definition: SubPopulation_Population_Manager.h:156
SubPopulation_Population_Manager::supplyWinterHostOn
bool supplyWinterHostOn(void)
Definition: SubPopulation_Population_Manager.h:350
SubPopulation_Population_Manager::updateWholePopulationArray
void updateWholePopulationArray(int a_listindex, double number)
The function to update the whole population array in the whole landscape.
Definition: SubPopulation_Population_Manager.cpp:227
SubPopulation_Population_Manager::m_max_flying_wind_speed
float m_max_flying_wind_speed
The larget wind speed for winged adults to fly.
Definition: SubPopulation_Population_Manager.h:127
Landscape::SupplyTemp
double SupplyTemp(void)
Passes a request on to the associated Weather class function, the temperature for the current day.
Definition: Landscape.h:1993
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_Population_Manager::supplyNextLifeStage
int supplyNextLifeStage(int life_circle_index, int life_stage_index)
Supply the next life stage index for a given life stage and a given life path.
Definition: SubPopulation_Population_Manager.h:246
Landscape::SupplyElementType
TTypesOfLandscapeElement SupplyElementType(int a_polyref)
Returns the landscape type of the polygon using the polygon reference number a_polyref or coordinates...
Definition: Landscape.h:1732
g_landscape_p
Landscape * g_landscape_p
SubPopulation_Population_Manager::m_wind_direction_array
blitz::Array< double, 2 > m_wind_direction_array
The array to hold the wind directions.
Definition: SubPopulation_Population_Manager.h:188
SubPopulation_Population_Manager::SetNoProbesAndSpeciesSpecificFunctions
virtual void SetNoProbesAndSpeciesSpecificFunctions(int a_pn)
Sets up probe and species specifics.
Definition: SubPopulation_Population_Manager.cpp:1000
SubPopulation_Population_Manager::supplyDevelopmentSeason
virtual unsigned supplyDevelopmentSeason()
The function to supply the development season.
Definition: SubPopulation_Population_Manager.h:292
struct_SubPopulation::x
int x
x-coord
Definition: SubPopulation_Population_Manager.h:50
SubPopulation_Population_Manager::m_flying_life_stage_array
std::vector< int > m_flying_life_stage_array
The vector to store the life stages that can fly.
Definition: SubPopulation_Population_Manager.h:194
SubPopulation_Population_Manager::addNewDay
void addNewDay()
Add new day to the newest and oldest array.
Definition: SubPopulation_Population_Manager.cpp:628
CfgStr::value
char * value() const
Definition: Configurator.h:182
Landscape::SupplyWind
double SupplyWind(void)
Passes a request on to the associated Weather class function, the wind speed for the current day.
Definition: Landscape.h:2061
SubPopulation_Population_Manager::writeCalibrationFiles
virtual void writeCalibrationFiles(void)
Write probe files for calibration.
Definition: SubPopulation_Population_Manager.h:347
Landscape::SupplyWindDirection
int SupplyWindDirection(void)
Passes a request on to the associated Weather class function, the wind direction in 4 directions for ...
Definition: Landscape.h:2067
SubPopulation_Population_Manager::supplyMortality
double supplyMortality(int a_life_stage, int a_age)
The function to supply the mortality rate for the given life stage and the age.
Definition: SubPopulation_Population_Manager.h:296
SubPopulation_Population_Manager::m_long_move_mask_x_num_half_array
blitz::Array< int, 1 > m_long_move_mask_x_num_half_array
Array to store the number of cells for longest flying at different windspeed.
Definition: SubPopulation_Population_Manager.h:146
struct_SubPopulation::starting_popu_density
double * starting_popu_density
Starting weighted population density for the subpopulation.
Definition: SubPopulation_Population_Manager.h:68
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::m_current_landing_array
blitz::Array< double, 1 > m_current_landing_array
Temporal array for the landing subpopulation.
Definition: SubPopulation_Population_Manager.h:168
CfgStr
String configurator entry class.
Definition: Configurator.h:173
SubPopulation_Population_Manager::calLandingCurve
double calLandingCurve(double a_dis, double a_peak, double a_furthest)
The function to calculate the landing curve along the wind direction.
Definition: SubPopulation_Population_Manager.cpp:896
Population_Manager_Base::m_ListNames
const char * m_ListNames[32]
A list of life-stage names.
Definition: PopulationManager.h:628
SubPopulation_Population_Manager::m_wind_speed_lookup_table
blitz::Array< int, 1 > m_wind_speed_lookup_table
The look up table for wind speed index in the flying mask.
Definition: SubPopulation_Population_Manager.h:135
SubPopulation_Population_Manager::m_cell_suitability
blitz::Array< double, 2 > m_cell_suitability
Array for suitable value in each subpopulation cell.
Definition: SubPopulation_Population_Manager.h:113
SubPopulation_Population_Manager::m_num_life_stage
int m_num_life_stage
The number of life stages for the animal.
Definition: SubPopulation_Population_Manager.h:103
struct_SubPopulation::empty_flag
bool empty_flag
Indicator show whether it is an empty subpopulation.
Definition: SubPopulation_Population_Manager.h:64
SubPopulation_Population_Manager::readDevReproFile
void readDevReproFile(string inputfile)
Function to read the development time and lifestage.
Definition: SubPopulation_Population_Manager.cpp:414
SubPopulation_Population_Manager::m_lowest_temperature_die
blitz::Array< double, 1 > m_lowest_temperature_die
The lowest temperature that will cause the species die.
Definition: SubPopulation_Population_Manager.h:88
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
SubPopulation_Population_Manager::m_mul_hosts_flag
bool m_mul_hosts_flag
Flag to show whether it has both winter and summer host.
Definition: SubPopulation_Population_Manager.h:105
struct_SubPopulation::NPM
SubPopulation_Population_Manager * NPM
SubPopulation_Population_Manager pointer.
Definition: SubPopulation_Population_Manager.h:62
SubPopulation_Population_Manager::m_long_move_mask_x_num
int m_long_move_mask_x_num
Variable to record the dimension of the long distance movement mask. - x.
Definition: SubPopulation_Population_Manager.h:139
CfgFloat::value
double value() const
Definition: Configurator.h:142
struct_SubPopulation
Used for creation of a new struct_SubPopulation object.
Definition: SubPopulation_Population_Manager.h:46
SubPopulation_Population_Manager::m_summer_host_on
bool m_summer_host_on
The flag to enable summer host.
Definition: SubPopulation_Population_Manager.h:204
FarmManager::TranslateVegCodes
TTypesOfVegetation TranslateVegCodes(std::string &str)
Converts strings to tov_
Definition: Farm.cpp:2180
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::DoLast
virtual void DoLast()
Definition: SubPopulation_Population_Manager.cpp:478
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
SubPopulation_Population_Manager::m_cell_popu_density
blitz::Array< double, 2 > m_cell_popu_density
Array for weighted population density in each subpopulation cell.
Definition: SubPopulation_Population_Manager.h:111
SubPopulation_Population_Manager::m_peak_long_distance
int m_peak_long_distance
The distance for the peak amount of landing.
Definition: SubPopulation_Population_Manager.h:123
SubPopulation_Population_Manager::DoFirst
virtual void DoFirst()
Definition: SubPopulation_Population_Manager.cpp:691
SubPopulation_Population_Manager::isEnoughNextLifeStage
virtual bool isEnoughNextLifeStage(int a_life_stage)
The funcition to check whether it is read for the next life stage.
Definition: SubPopulation_Population_Manager.cpp:624
SubPopulation_Population_Manager::m_wind_direction_num
int m_wind_direction_num
The number of wind directions.
Definition: SubPopulation_Population_Manager.h:131
SubPopulation_Population_Manager::supplyCellHeight
double supplyCellHeight()
Supply the height of a subpopulation cell.
Definition: SubPopulation_Population_Manager.h:226
struct_SubPopulation::L
Landscape * L
Landscape pointer.
Definition: SubPopulation_Population_Manager.h:60
struct_SubPopulation::w
int w
area width
Definition: SubPopulation_Population_Manager.h:54
SubPopulation_Population_Manager::m_summer_hosts_tole_period_map
std::map< int, int > m_summer_hosts_tole_period_map
The map to store the index for the summer host period.
Definition: SubPopulation_Population_Manager.h:182
SubPopulation_Population_Manager::doSpecicesLastThing
virtual void doSpecicesLastThing()
The special last thing for the drived species.
Definition: SubPopulation_Population_Manager.h:338
Population_Manager_Base::m_ListNameLength
int m_ListNameLength
the number of life-stages simulated in the population manager
Definition: PopulationManager.h:626
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
SubPopulation_Population_Manager::CreateObjects
SubPopulation * CreateObjects(TAnimal *pvo, struct_SubPopulation *data, int number)
Definition: SubPopulation_Population_Manager.cpp:976
SubPopulation_Population_Manager::m_long_move_mask_y_num
int m_long_move_mask_y_num
Variable to record the dimension of the long distance movement mask. - y.
Definition: SubPopulation_Population_Manager.h:141
tos_Egg
Definition: SubPopulation.h:43
SubPopulation_Population_Manager::doLocalMovement
void doLocalMovement(int index_x, int index_y, double proportion)
The function for local movement.
Definition: SubPopulation_Population_Manager.cpp:844
SubPopulation_Population_Manager::supplyNumFlyingLifeStages
int supplyNumFlyingLifeStages()
Supply the number of life stages that can fly.
Definition: SubPopulation_Population_Manager.h:319
SubPopulation_Population_Manager::readHosts
virtual void readHosts(string a_file_name)
The fuction to read the host lists for aphid.
Definition: SubPopulation_Population_Manager.cpp:1006
SubPopulation_Population_Manager::supplyNumLocMovLifeStages
int supplyNumLocMovLifeStages()
Supply the number of life stages thah can do local movement.
Definition: SubPopulation_Population_Manager.h:323
SubPopulation_Population_Manager::isSummerHostTole
bool isSummerHostTole(TTypesOfLandscapeElement a_ele)
Test whether it is a summer host tole.
Definition: SubPopulation_Population_Manager.cpp:810
SubPopulation_Population_Manager::m_index_new_old
blitz::Array< int, 2 > m_index_new_old
Array for index of the newest and oldest life stages.
Definition: SubPopulation_Population_Manager.h:154
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
CfgBool::value
bool value() const
Definition: Configurator.h:164
Population_Manager_Base::m_TheLandscape
Landscape * m_TheLandscape
holds an internal pointer to the landscape
Definition: PopulationManager.h:624
SubPopulation_Population_Manager::calLongMovementMask
virtual void calLongMovementMask(void)
Function to calculate the movement mask.
Definition: SubPopulation_Population_Manager.cpp:488
SubPopulation_Population_Manager::supplySizeSubpopulationCell
double supplySizeSubpopulationCell()
Supply the size of aphid subpopulation cell.
Definition: SubPopulation_Population_Manager.h:228
SubPopulation_Population_Manager::m_max_long_distance
int m_max_long_distance
The longest distance that the specieces can fly for long distance dispersal.
Definition: SubPopulation_Population_Manager.h:121
SubPopulation_Population_Manager::m_winter_hosts_tole_period
std::vector< std::vector< int > > m_winter_hosts_tole_period
The vector to store the exsiting period for winter host tole.
Definition: SubPopulation_Population_Manager.h:172
SubPopulation_Population_Manager::doFlying
void doFlying(int ind, int index_x, int index_y)
The function to fly the winged adults.
Definition: SubPopulation_Population_Manager.cpp:708
SubPopulation_Population_Manager::m_winter_hosts_tole
std::vector< TTypesOfLandscapeElement > m_winter_hosts_tole
The vector to hold winter host landscape type.
Definition: SubPopulation_Population_Manager.h:170
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
tov_DKLegume_Beans
Definition: LandscapeFarmingEnums.h:358
SubPopulation_Population_Manager::isWinterHostTole
bool isWinterHostTole(TTypesOfLandscapeElement a_ele)
Test whether it is a winter host tole.
Definition: SubPopulation_Population_Manager.cpp:800
Population_Manager_Base::SimH
int SimH
stores the simulation height
Definition: PopulationManager.h:614
SubPopulation_Population_Manager::m_wind_speed_step_size
int m_wind_speed_step_size
The sampling step size for wind speed.
Definition: SubPopulation_Population_Manager.h:129
SubPopulation_Population_Manager::isWinterHostTov
bool isWinterHostTov(TTypesOfVegetation a_ele)
Test whether it is a winter host tov.
Definition: SubPopulation_Population_Manager.cpp:820
SubPopulation_Population_Manager::SupplyLocXY
virtual void SupplyLocXY(unsigned index_x, unsigned index_y, int &x, int &y)
A stub for identifying an individual at a location.
Definition: SubPopulation_Population_Manager.h:309
Landscape::SetSpeciesFunctions
void SetSpeciesFunctions(TTypesOfPopulation a_species)
This is the jumping off point for any landscape related species setup, it creates function pointers t...
Definition: Landscape.cpp:7821
SubPopulation_Population_Manager::Subpopulation
friend class Subpopulation
Definition: SubPopulation_Population_Manager.h:93
SubPopulation_Population_Manager::calNextStage
virtual int calNextStage(int current_stage, double density=1)
Return the next life stage for the given life stage.
Definition: SubPopulation_Population_Manager.cpp:659
SubPopulation_Population_Manager::m_winter_hosts_tov
std::vector< TTypesOfVegetation > m_winter_hosts_tov
The vector to hold winter host vegetation type.
Definition: SubPopulation_Population_Manager.h:176
CfgBool
Bool configurator entry class.
Definition: Configurator.h:155
SubPopulation_Population_Manager::updateDevelopmentSeason
virtual void updateDevelopmentSeason()
The function to update the development season.
Definition: SubPopulation_Population_Manager.h:269
struct_SubPopulation::species
int species
species ID
Definition: SubPopulation_Population_Manager.h:58
SubPopulation_Population_Manager::supplySummerTolePeriod
std::vector< int > supplySummerTolePeriod(TTypesOfLandscapeElement a_tole)
The function to supply the available period vector for the given summer tole host.
Definition: SubPopulation_Population_Manager.h:333
TAnimal
The base class for all ALMaSS animal classes. Includes all the functionality required to be handled b...
Definition: PopulationManager.h:200
struct_SubPopulation::index_y
int index_y
Definition: SubPopulation_Population_Manager.h:70
SubPopulation_Population_Manager::m_sub_h
int m_sub_h
Variable to record the height of the subpopulation cell.
Definition: SubPopulation_Population_Manager.h:109
MapErrorMsg::Warn
void Warn(MapErrorState a_level, std::string a_msg1, std::string a_msg2)
Definition: MapErrorMsg.cpp:69
Landscape::SupplyDayInYear
int SupplyDayInYear(void)
Passes a request on to the associated Calendar class function, the day in the year.
Definition: Landscape.h:2267
Landscape::SupplyVegBiomass
double SupplyVegBiomass(int a_polyref)
Returns the biomass of the vegetation using the polygon reference number a_polyref or based on the x,...
Definition: Landscape.h:1542
SubPopulation_Population_Manager::supplyMortalityStageArray
blitz::Array< double, 1 > supplyMortalityStageArray(int a_life_stage)
The function to supply the 1D base morality rate array for the given life stage.
Definition: SubPopulation_Population_Manager.h:300
SubPopulation_Population_Manager::m_long_move_mask_y_num_half_array
blitz::Array< int, 1 > m_long_move_mask_y_num_half_array
Definition: SubPopulation_Population_Manager.h:147
tole_PermPastureTussocky
Definition: LandscapeFarmingEnums.h:67
SubPopulation_Population_Manager::m_summer_hosts_tov
std::vector< TTypesOfVegetation > m_summer_hosts_tov
The vector to hold sumber host vegetation type.
Definition: SubPopulation_Population_Manager.h:184
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::m_local_moving_life_stage_array
std::vector< int > m_local_moving_life_stage_array
The vector to store the life stags that can move locally.
Definition: SubPopulation_Population_Manager.h:198
SubPopulation_Population_Manager::supplyLifeStageNum
int supplyLifeStageNum()
Supply the number of life stage.
Definition: SubPopulation_Population_Manager.h:242
TTypesOfPopulation
TTypesOfPopulation
An enum to hold all the possible types of population handled by a Population_Manager class.
Definition: PopulationManager.h:57
SubPopulation_Population_Manager::m_summer_hosts_tole
std::vector< TTypesOfLandscapeElement > m_summer_hosts_tole
The vector to hold summer host landscape type.
Definition: SubPopulation_Population_Manager.h:178
SubPopulation_Population_Manager::m_vec_subpopulation_pointers_polygon
std::vector< std::vector< SubPopulation * > > m_vec_subpopulation_pointers_polygon
The vector used to store the pointers of all the subpopulation objects in each polygon.
Definition: SubPopulation_Population_Manager.h:202
SubPopulation_Population_Manager::m_summer_hosts_tole_period
std::vector< std::vector< int > > m_summer_hosts_tole_period
The vector to store the exsiting period for summer host tole.
Definition: SubPopulation_Population_Manager.h:180
SubPopulation_Population_Manager::m_index_next_life_stage
std::vector< std::vector< int > > m_index_next_life_stage
The array to store the index for the ones go to the next life stage or die. -1 means nothing.
Definition: SubPopulation_Population_Manager.h:86
SubPopulation_Population_Manager::~SubPopulation_Population_Manager
virtual ~SubPopulation_Population_Manager(void)
SubPopulation_Manager Destructor.
Definition: SubPopulation_Population_Manager.cpp:212
SubPopulation_Population_Manager::GetPopulationSize
virtual unsigned GetPopulationSize(int a_listindex)
Must be re-implemented in descendent classes.
Definition: SubPopulation_Population_Manager.h:324
SubPopulation_Population_Manager::m_life_circle_path
blitz::Array< double, 2 > m_life_circle_path
The life circle array. It could have more than one life circle paths.
Definition: SubPopulation_Population_Manager.h:160
Population_Manager_Base::SimW
int SimW
stores the simulation width
Definition: PopulationManager.h:616
SubPopulation_Population_Manager::m_long_move_mask
blitz::Array< double, 4 > m_long_move_mask
Long distance movement mask.
Definition: SubPopulation_Population_Manager.h:119
SubPopulation_Population_Manager::m_short_move_mask_y_num
int m_short_move_mask_y_num
Variable to record the dimension of the short distance movement mask. - y.
Definition: SubPopulation_Population_Manager.h:150
SubPopulation_Population_Manager::supplyMaxColNum
int supplyMaxColNum()
Supply the maximum number of column in the development array.
Definition: SubPopulation_Population_Manager.h:244
SubPopulation_Population_Manager::m_highest_temperature_die
blitz::Array< double, 1 > m_highest_temperature_die
The highest temperature that will cause the species die.
Definition: SubPopulation_Population_Manager.h:90
SubPopulation_Population_Manager::GetLiveArraySize
virtual unsigned GetLiveArraySize(int a_listindex)
Must be re-implemented in descendent classes. Gets the number of 'live' objects.
Definition: SubPopulation_Population_Manager.cpp:410
SubPopulation_Population_Manager::m_lowest_temp_dev
blitz::Array< double, 1 > m_lowest_temp_dev
Lowest development temperatures for each life stage. This is the last step in each day.
Definition: SubPopulation_Population_Manager.h:158
SubPopulation_Population_Manager::m_landing_life_stage_array
std::vector< int > m_landing_life_stage_array
The vector to store the life stage when a flying one lands, it could be different from the flying one...
Definition: SubPopulation_Population_Manager.h:196
struct_SubPopulation::h
int h
area height
Definition: SubPopulation_Population_Manager.h:56
SubPopulation_Population_Manager::updateWholePopulation
void updateWholePopulation()
Update whole population info.
Definition: SubPopulation_Population_Manager.cpp:240
SubPopulation_Population_Manager::subpopuBaseOutputProbe
virtual void subpopuBaseOutputProbe()
Below are the functions for saving result.
Definition: SubPopulation_Population_Manager.cpp:349
g_msg
MapErrorMsg * g_msg
Definition: MapErrorMsg.cpp:41
SubPopulation_Population_Manager::supplyOldEnoughIndex
std::vector< int > supplyOldEnoughIndex(int life_stage_index)
Definition: SubPopulation_Population_Manager.h:247
SubPopulation_Population_Manager::m_size_cell
double m_size_cell
The size of each subpopulation cell.
Definition: SubPopulation_Population_Manager.h:83
SubPopulation_Population_Manager::m_development_degree_day
blitz::Array< double, 2 > m_development_degree_day
The array to store the average max and std development time for each life stage, max and std time for...
Definition: SubPopulation_Population_Manager.h:97
SubPopulation_Population_Manager::supplyMortalityWholeArray
blitz::Array< double, 2 > supplyMortalityWholeArray(void)
The function to supply the whole base mortality rate array.
Definition: SubPopulation_Population_Manager.h:298
TTypesOfVegetation
TTypesOfVegetation
Values that represent the types of vegetation that are represented in ALMaSS.
Definition: LandscapeFarmingEnums.h:192
SubPopulation_Population_Manager::m_current_mortality_array
blitz::Array< double, 2 > m_current_mortality_array
This a lookup table for the age and temperature dependent mortality rate. This is the same for the wh...
Definition: SubPopulation_Population_Manager.h:186
SubPopulation_Population_Manager::SubPopulation_Population_Manager
SubPopulation_Population_Manager(Landscape *L, string DevReproFile="", int a_sub_w=10, int a_sub_h=10, int a_num_life_stage=5, int a_max_long_dist=1000, int a_peak_long_dist=100, float a_scale_wind_speed=1.1, float a_max_wind_speed=16, int a_wind_direc_num=8, int a_wind_speed_step_size=2, int a_max_alive_day=300)
Definition: SubPopulation_Population_Manager.cpp:61
g_farmmanager
FarmManager * g_farmmanager
Definition: Farm.cpp:638
SubPopulation_Population_Manager::doDevelopment
void doDevelopment()
Function to make the development for all the subpopulation object.
Definition: SubPopulation_Population_Manager.cpp:566
SubPopulation_Population_Manager::openSubpopulationBaseProbeFile
bool openSubpopulationBaseProbeFile()
Open the storing file.
Definition: SubPopulation_Population_Manager.cpp:394
struct_SubPopulation::index_x
int index_x
Definition: SubPopulation_Population_Manager.h:69
CfgFloat
Double configurator entry class.
Definition: Configurator.h:126
Population_Manager_Base::m_SimulationName
string m_SimulationName
stores the simulation name
Definition: PopulationManager.h:622
SubPopulation_Population_Manager::initialisePopulation
virtual void initialisePopulation()
The function to initialise the population when starting the simulation which requires rewritten in th...
Definition: SubPopulation_Population_Manager.cpp:906
SubPopulation_Population_Manager::m_num_x_range
int m_num_x_range
The number of subpopulation in x range.
Definition: SubPopulation_Population_Manager.h:99
SubPopulation_Population_Manager::m_scale_wind_speed
float m_scale_wind_speed
The scale for wind.
Definition: SubPopulation_Population_Manager.h:125
SubPopulation_Population_Manager::m_subpopulation_base_prb_file
std::ofstream m_subpopulation_base_prb_file
The file for the storing the data.
Definition: SubPopulation_Population_Manager.h:200
SubPopulation_Population_Manager::supplyCellWidth
double supplyCellWidth()
Supply the width of a subpopulation cell.
Definition: SubPopulation_Population_Manager.h:224
SubPopulation_Population_Manager::m_first_flag_life_stage
blitz::Array< bool, 1 > m_first_flag_life_stage
Array to track whether it is the first existence for a life stage.
Definition: SubPopulation_Population_Manager.h:164
SubPopulation_Population_Manager::supplyCellNumY
int supplyCellNumY()
Supply number of subpopulation in y coordinate.
Definition: SubPopulation_Population_Manager.h:222
SubPopulation_Population_Manager::relocatePopulation
void relocatePopulation(void)
Relocate the population in each cell based on the suitability and movement ability.
Definition: SubPopulation_Population_Manager.cpp:452
SubPopulation_Population_Manager::m_landing_masks
blitz::Array< blitz::Array< double, 2 >, 2 > m_landing_masks
The array to store the landing masks. The vector is indexed by the wind speed index first and the sec...
Definition: SubPopulation_Population_Manager.h:191
CFG_CUSTOM
Definition: Configurator.h:70
SubPopulation_Population_Manager::m_hibernated_hatch_flag
bool m_hibernated_hatch_flag
Flag variable to indicate hibernated eggs are ready to hatch.
Definition: SubPopulation_Population_Manager.h:162
SubPopulation_Population_Manager::updateMortalityArray
virtual void updateMortalityArray(void)
This function is used to update the daily mortality rate for all the ages. In this base class,...
Definition: SubPopulation_Population_Manager.cpp:879
SubPopulation_Population_Manager::supplyAgeInDayDegree
double supplyAgeInDayDegree(int lifestage_index, int column_index)
Definition: SubPopulation_Population_Manager.h:308
SubPopulation_Population_Manager::Run
virtual void Run(int NoTSteps)
Definition: SubPopulation_Population_Manager.cpp:256
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
SubPopulation_Population_Manager::m_current_flying_array
blitz::Array< double, 1 > m_current_flying_array
Temporal array for the flying subpopulation.
Definition: SubPopulation_Population_Manager.h:166
SubPopulation_Population_Manager::doParasitoidDevelopment
virtual void doParasitoidDevelopment()
The function for parasitoid calculation, it does nothing in this base class.
Definition: SubPopulation_Population_Manager.h:336
SubPopulation_Population_Manager::m_winter_hosts_tole_period_map
std::map< int, int > m_winter_hosts_tole_period_map
The map to store the index for the winter host period.
Definition: SubPopulation_Population_Manager.h:174
SubPopulation_Population_Manager::supplyTotalPopulationInCell
double supplyTotalPopulationInCell(int x_indx, int y_indx)
Supply whole population size at the given cell.
SubPopulation_Population_Manager::m_wind_speed_num
int m_wind_speed_num
The number of wind speed samples.
Definition: SubPopulation_Population_Manager.h:133
SubPopulation_Population_Manager::m_num_y_range
int m_num_y_range
The number of subpopulation in y range.
Definition: SubPopulation_Population_Manager.h:101
SubPopulation_Population_Manager::m_short_move_mask
blitz::Array< double, 4 > m_short_move_mask
Short distance movement mask.
Definition: SubPopulation_Population_Manager.h:117
Landscape::SupplyPolyRefIndex
int SupplyPolyRefIndex(int a_x, int a_y)
Get the index to the m_elems array for a polygon at location x,y.
Definition: Landscape.h:2172
SubPopulation_Population_Manager::m_long_move_mask_y_num_half
int m_long_move_mask_y_num_half
Definition: SubPopulation_Population_Manager.h:144
FarmManager
The Farm Manager class.
Definition: Farm.h:1461
SubPopulation_Population_Manager::supplyCellNumX
int supplyCellNumX()
Supply number of subpopulation in x coordinate.
Definition: SubPopulation_Population_Manager.h:220
count
Definition: SubPopulation.h:48
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
struct_SubPopulation::starting_suitability
double * starting_suitability
Starting suitability for the subpopulation.
Definition: SubPopulation_Population_Manager.h:66
Landscape::SupplyDaylength
int SupplyDaylength(void)
Passes a request on to the associated Weather class function, the day length for the current day.
Definition: Landscape.h:2201
SubPopulation_Population_Manager::m_accumu_degree_days
blitz::Array< double, 2 > m_accumu_degree_days
Array for accumulated degree days for each life circle.
Definition: SubPopulation_Population_Manager.h:152
struct_SubPopulation::y
int y
y-coord
Definition: SubPopulation_Population_Manager.h:52
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_Population_Manager::m_optimal_temperature
blitz::Array< double, 1 > m_optimal_temperature
The optimal development temperature for the species. (Mortality rate = 0).
Definition: SubPopulation_Population_Manager.h:92
SubPopulation_Population_Manager::m_short_move_mask_x_num
int m_short_move_mask_x_num
Definition: SubPopulation_Population_Manager.h:148
g_Species
TTypesOfPopulation g_Species
Definition: PopulationManager.cpp:101
cfg_Subpopu_Base_Output_Used
CfgBool cfg_Subpopu_Base_Output_Used("SUBPOPU_BASE_OUTPUT_USED", CFG_CUSTOM, true)
cfg_Subpopu_Base_Output_Filename
CfgStr cfg_Subpopu_Base_Output_Filename("SUBPOPU_BASE_OUTPUT_FILENAME", CFG_CUSTOM, "SubpopuBaseOutput.txt")
SubPopulation_Population_Manager::isSummerHostTov
bool isSummerHostTov(TTypesOfVegetation a_ele)
Test whether it is a summer host tov.
Definition: SubPopulation_Population_Manager.cpp:830
SubPopulation_Population_Manager::m_sub_w
int m_sub_w
Variable to record the width of the subpopulation cell.
Definition: SubPopulation_Population_Manager.h:107
SubPopulation_Population_Manager::supplyNewestIndex
int supplyNewestIndex(int life_stage_index)
Definition: SubPopulation_Population_Manager.h:248
SubPopulation_Population_Manager::supplyVecFlyingLifeStages
std::vector< int > supplyVecFlyingLifeStages()
Supply the vector of life stages for flying.
Definition: SubPopulation_Population_Manager.h:317
SubPopulation_Population_Manager::m_winter_host_on
bool m_winter_host_on
The flag to enalble winter host.
Definition: SubPopulation_Population_Manager.h:206