![]() |
ALMaSS
1.2 (after EcoStack, March 2024)
The Animal, Landscape and Man Simulation System
|
The class to handle all subpopulation-based ainimal population related matters in the whole landscape. More...
#include <SubPopulation_Population_Manager.h>
Public Member Functions | |
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) | |
virtual | ~SubPopulation_Population_Manager (void) |
SubPopulation_Manager Destructor. More... | |
double | supplyAllPopulationGivenStage (int index) |
Supply the population size at the given life stage for the who landscape. More... | |
double | supplyTotalPopulationInCell (int x_indx, int y_indx) |
Supply whole population size at the given cell. More... | |
int | supplyCellNumX () |
Supply number of subpopulation in x coordinate. More... | |
int | supplyCellNumY () |
Supply number of subpopulation in y coordinate. More... | |
double | supplyCellWidth () |
Supply the width of a subpopulation cell. More... | |
double | supplyCellHeight () |
Supply the height of a subpopulation cell. More... | |
double | supplySizeSubpopulationCell () |
Supply the size of aphid subpopulation cell. More... | |
bool | openSubpopulationBaseProbeFile () |
Open the storing file. More... | |
virtual void | subpopuBaseOutputProbe () |
Below are the functions for saving result. More... | |
double | getTotalSubpopulationInCell (int x_indx, int y_indx) |
Supply the total subpopulation size in the given cell. More... | |
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. More... | |
double | getSuitabilityInCell (int x_indx, int y_indx) |
Supply the suitability in the given cell. More... | |
SubPopulation * | supplySubPopulationPointer (int indx, int indy) |
Supply the pointer of the subpopulation object in the given cell. More... | |
int | supplyLifeStageNum () |
Supply the number of life stage. More... | |
int | supplyMaxColNum () |
Supply the maximum number of column in the development array. More... | |
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. More... | |
std::vector< int > | supplyOldEnoughIndex (int life_stage_index) |
int | supplyNewestIndex (int life_stage_index) |
virtual unsigned | GetLiveArraySize (int a_listindex) |
Must be re-implemented in descendent classes. Gets the number of 'live' objects. More... | |
void | readDevReproFile (string inputfile) |
Function to read the development time and lifestage. More... | |
void | relocatePopulation (void) |
Relocate the population in each cell based on the suitability and movement ability. More... | |
virtual void | DoLast () |
virtual void | DoFirst () |
virtual void | calLongMovementMask (void) |
Function to calculate the movement mask. More... | |
void | doDevelopment () |
Function to make the development for all the subpopulation object. More... | |
void | addNewDay () |
Add new day to the newest and oldest array. More... | |
virtual int | calNextStage (int current_stage, double density=1) |
Return the next life stage for the given life stage. More... | |
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. More... | |
virtual void | updateDevelopmentSeason () |
The function to update the development season. More... | |
void | updateWholePopulationArray (int a_listindex, double number) |
The function to update the whole population array in the whole landscape. More... | |
void | updateWholePopulationArray (blitz::Array< double, 1 > a_array) |
void | setFirstFlagLifeStage (int life_stage, bool pvalue) |
The function to set the flag indicating whether a given lifestage is the first time of existing. More... | |
bool | supplyFirstFlagLifeStage (int life_stage) |
The function to supply the flag of first for the given life stage. More... | |
void | setOldIndex (int life_stage, int p_value) |
The function to set the oldest index for the given life stage. More... | |
void | doFlying (int ind, int index_x, int index_y) |
The function to fly the winged adults. More... | |
void | doLocalMovement (int index_x, int index_y, double proportion) |
The function for local movement. More... | |
bool | isWinterHostTole (TTypesOfLandscapeElement a_ele) |
Test whether it is a winter host tole. More... | |
bool | isSummerHostTole (TTypesOfLandscapeElement a_ele) |
Test whether it is a summer host tole. More... | |
bool | isWinterHostTov (TTypesOfVegetation a_ele) |
Test whether it is a winter host tov. More... | |
bool | isSummerHostTov (TTypesOfVegetation a_ele) |
Test whether it is a summer host tov. More... | |
virtual unsigned | supplyDevelopmentSeason () |
The function to supply the development season. More... | |
virtual void | updateMortalityArray (void) |
This function is used to update the daily mortality rate for all the ages. In this base class, it only depends on the temperature. The lowest and highest temperature that will make the species die. The optimal temperature will make the mortality rate to be 0. More... | |
double | supplyMortality (int a_life_stage, int a_age) |
The function to supply the mortality rate for the given life stage and the age. More... | |
blitz::Array< double, 2 > | supplyMortalityWholeArray (void) |
The function to supply the whole base mortality rate array. More... | |
blitz::Array< double, 1 > | supplyMortalityStageArray (int a_life_stage) |
The function to supply the 1D base morality rate array for the given life stage. More... | |
double | calLandingCurve (double a_dis, double a_peak, double a_furthest) |
The function to calculate the landing curve along the wind direction. More... | |
virtual void | initialisePopulation () |
The function to initialise the population when starting the simulation which requires rewritten in the derived class. More... | |
SubPopulation * | CreateObjects (TAnimal *pvo, struct_SubPopulation *data, int number) |
int | supplyAgeInDay (int lifestage_index, int column_index) |
The function to return the age in days given an element in the subpopulation table. More... | |
double | supplyAgeInDayDegree (int lifestage_index, int column_index) |
virtual void | SupplyLocXY (unsigned index_x, unsigned index_y, int &x, int &y) |
A stub for identifying an individual at a location. More... | |
std::vector< int > | supplyVecFlyingLifeStages () |
Supply the vector of life stages for flying. More... | |
int | supplyNumFlyingLifeStages () |
Supply the number of life stages that can fly. More... | |
std::vector< int > | supplyVecLocMoveLifeStages () |
Supply the vector of life stages that can do local movement. More... | |
int | supplyNumLocMovLifeStages () |
Supply the number of life stages thah can do local movement. More... | |
virtual unsigned | GetPopulationSize (int a_listindex) |
Must be re-implemented in descendent classes. More... | |
virtual bool | isEnoughNextLifeStage (int a_life_stage) |
The funcition to check whether it is read for the next life stage. More... | |
std::vector< int > | supplyWinterTolePeriod (TTypesOfLandscapeElement a_tole) |
The function to supply the available period vector for the given winter tole host. More... | |
std::vector< int > | supplySummerTolePeriod (TTypesOfLandscapeElement a_tole) |
The function to supply the available period vector for the given summer tole host. More... | |
virtual void | doParasitoidDevelopment () |
The function for parasitoid calculation, it does nothing in this base class. More... | |
virtual void | doSpecicesLastThing () |
The special last thing for the drived species. More... | |
void | updateWholePopulation () |
Update whole population info. More... | |
virtual void | SetNoProbesAndSpeciesSpecificFunctions (int a_pn) |
Sets up probe and species specifics. More... | |
virtual void | readHosts (string a_file_name) |
The fuction to read the host lists for aphid. More... | |
virtual void | writeCalibrationFiles (void) |
Write probe files for calibration. More... | |
bool | supplySummerHostOn (void) |
bool | supplyWinterHostOn (void) |
![]() | |
Population_Manager_Base (Landscape *L) | |
The Population_Manager_Base constructor. More... | |
virtual void | Catastrophe (int) |
Must be re-implemented in descendent classes. More... | |
int | SupplySimW () const |
Returns landscape width in m. More... | |
int | SupplySimH () const |
Returns landscape height in m. More... | |
int | SupplySimWH () const |
Returns half the landscape width in m. More... | |
int | SupplySimHH () const |
Returns half the landscape height in m. More... | |
virtual int | ProbeFileInput (char *p_Filename, int p_ProbeNo) |
A stub to build specfic probes and functions. More... | |
virtual char * | SpeciesSpecificReporting (int, int) |
A stub to build specfic reporting. More... | |
int | SupplyListNameLength () const |
const char * | SupplyListName (int a_i) const |
Get a list name from the list. More... | |
virtual TAnimal * | FindClosest (int, int, unsigned) |
A stub for identifying an individual at a location. More... | |
std::string | SupplySimulationName () |
virtual void | OpenTheAOROutputProbe (const string &a_string) |
An empty method that needs to be here because the population manager lists might contain sub-population models which will skip Population_Manager functionality. More... | |
void | SetStepCounterInADay (int a_counter) |
Set step counter in a day. More... | |
int | GetStepCounterInADay (void) |
Return the sep counter in a day. More... | |
virtual double | GetAphidDensity (int, int) |
Return the aphid density, it is only used when aphid simulations are running. More... | |
virtual TAnimal * | SupplyAnimalPtr (unsigned int a_index, unsigned int a_animal) |
Return the animal pointer for the give life stage and number. More... | |
Protected Member Functions | |
virtual void | Run (int NoTSteps) |
![]() | |
~Population_Manager_Base ()=default | |
Protected Attributes | |
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 reproducing. More... | |
int | m_num_x_range |
The number of subpopulation in x range. More... | |
int | m_num_y_range |
The number of subpopulation in y range. More... | |
int | m_num_life_stage |
The number of life stages for the animal. More... | |
bool | m_mul_hosts_flag |
Flag to show whether it has both winter and summer host. More... | |
int | m_sub_w |
Variable to record the width of the subpopulation cell. More... | |
int | m_sub_h |
Variable to record the height of the subpopulation cell. More... | |
blitz::Array< double, 2 > | m_cell_popu_density |
Array for weighted population density in each subpopulation cell. More... | |
blitz::Array< double, 2 > | m_cell_suitability |
Array for suitable value in each subpopulation cell. More... | |
blitz::Array< SubPopulation *, 2 > | m_the_subpopulation_array |
Vector to store the all the pointers for the subpopulation object. More... | |
blitz::Array< double, 4 > | m_short_move_mask |
Short distance movement mask. More... | |
blitz::Array< double, 4 > | m_long_move_mask |
Long distance movement mask. More... | |
int | m_max_long_distance |
The longest distance that the specieces can fly for long distance dispersal. More... | |
int | m_peak_long_distance |
The distance for the peak amount of landing. More... | |
float | m_scale_wind_speed |
The scale for wind. More... | |
float | m_max_flying_wind_speed |
The larget wind speed for winged adults to fly. More... | |
int | m_wind_speed_step_size |
The sampling step size for wind speed. More... | |
int | m_wind_direction_num |
The number of wind directions. More... | |
int | m_wind_speed_num |
The number of wind speed samples. More... | |
blitz::Array< int, 1 > | m_wind_speed_lookup_table |
The look up table for wind speed index in the flying mask. More... | |
double | m_max_short_distance |
The longest distance that the specieces can move for short distance dispersal. More... | |
int | m_long_move_mask_x_num |
Variable to record the dimension of the long distance movement mask. - x. More... | |
int | m_long_move_mask_y_num |
Variable to record the dimension of the long distance movement mask. - y. More... | |
int | m_long_move_mask_x_num_half |
Variable to record the dimension of the short distance movement mask. - x. More... | |
int | m_long_move_mask_y_num_half |
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. More... | |
blitz::Array< int, 1 > | m_long_move_mask_y_num_half_array |
int | m_short_move_mask_x_num |
int | m_short_move_mask_y_num |
Variable to record the dimension of the short distance movement mask. - y. More... | |
blitz::Array< double, 2 > | m_accumu_degree_days |
Array for accumulated degree days for each life circle. More... | |
blitz::Array< int, 2 > | m_index_new_old |
Array for index of the newest and oldest life stages. More... | |
int | m_max_alive_days |
The longest alive day among all the life stages. More... | |
blitz::Array< double, 1 > | m_lowest_temp_dev |
Lowest development temperatures for each life stage. This is the last step in each day. More... | |
blitz::Array< double, 2 > | m_life_circle_path |
The life circle array. It could have more than one life circle paths. More... | |
bool | m_hibernated_hatch_flag |
Flag variable to indicate hibernated eggs are ready to hatch. More... | |
blitz::Array< bool, 1 > | m_first_flag_life_stage |
Array to track whether it is the first existence for a life stage. More... | |
blitz::Array< double, 1 > | m_current_flying_array |
Temporal array for the flying subpopulation. More... | |
blitz::Array< double, 1 > | m_current_landing_array |
Temporal array for the landing subpopulation. More... | |
std::vector< TTypesOfLandscapeElement > | m_winter_hosts_tole |
The vector to hold winter host landscape type. More... | |
std::vector< std::vector< int > > | m_winter_hosts_tole_period |
The vector to store the exsiting period for winter host tole. More... | |
std::map< int, int > | m_winter_hosts_tole_period_map |
The map to store the index for the winter host period. More... | |
std::vector< TTypesOfVegetation > | m_winter_hosts_tov |
The vector to hold winter host vegetation type. More... | |
std::vector< TTypesOfLandscapeElement > | m_summer_hosts_tole |
The vector to hold summer host landscape type. More... | |
std::vector< std::vector< int > > | m_summer_hosts_tole_period |
The vector to store the exsiting period for summer host tole. More... | |
std::map< int, int > | m_summer_hosts_tole_period_map |
The map to store the index for the summer host period. More... | |
std::vector< TTypesOfVegetation > | m_summer_hosts_tov |
The vector to hold sumber host vegetation type. More... | |
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 whole landscape for each day. Further cell specific related calculate should be done in the SubPopulation class. More... | |
blitz::Array< double, 2 > | m_wind_direction_array |
The array to hold the wind directions. More... | |
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 second index is the wind direction. Each element is a 2-D dimensional blitz array. More... | |
std::vector< int > | m_flying_life_stage_array |
The vector to store the life stages that can fly. More... | |
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, e.g., they drop theri wings. More... | |
std::vector< int > | m_local_moving_life_stage_array |
The vector to store the life stags that can move locally. More... | |
std::ofstream | m_subpopulation_base_prb_file |
The file for the storing the data. More... | |
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. More... | |
bool | m_summer_host_on |
The flag to enable summer host. More... | |
bool | m_winter_host_on |
The flag to enalble winter host. More... | |
![]() | |
int | SimH |
stores the simulation height More... | |
int | SimW |
stores the simulation width More... | |
int | SimHH |
stores the simulation height halved More... | |
int | SimWH |
stores the simulation width halved More... | |
string | m_SimulationName |
stores the simulation name More... | |
Landscape * | m_TheLandscape |
holds an internal pointer to the landscape More... | |
int | m_ListNameLength {} |
the number of life-stages simulated in the population manager More... | |
const char * | m_ListNames [32] {} |
A list of life-stage names. More... | |
std::string | m_AORProbeFileName {"AOR_Probe.txt"} |
name of the AOR Probe file More... | |
std::string | m_ProbeFileName {"Probe.res"} |
name of the Probe file More... | |
int | m_step_counter_in_a_day |
Step counter in a day, this is used for the animals with finer step size other than one day. More... | |
Private Attributes | |
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. More... | |
double | m_size_cell |
The size of each subpopulation cell. More... | |
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. More... | |
blitz::Array< double, 1 > | m_lowest_temperature_die |
The lowest temperature that will cause the species die. More... | |
blitz::Array< double, 1 > | m_highest_temperature_die |
The highest temperature that will cause the species die. More... | |
blitz::Array< double, 1 > | m_optimal_temperature |
The optimal development temperature for the species. (Mortality rate = 0). More... | |
Friends | |
class | Subpopulation |
Additional Inherited Members | |
![]() | |
Probe_Data * | TheProbe [100] = {nullptr} |
Holds a list of pointers to standard output probes. More... | |
The class to handle all subpopulation-based ainimal population related matters in the whole landscape.
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 |
||
) |
References calLongMovementMask(), cfg_Subpopu_Base_Output_Used, initialisePopulation(), m_accumu_degree_days, m_cell_popu_density, m_cell_suitability, m_current_flying_array, m_current_landing_array, m_current_mortality_array, m_first_flag_life_stage, m_hibernated_hatch_flag, m_highest_temperature_die, m_index_new_old, m_index_next_life_stage, m_landing_masks, Population_Manager_Base::m_ListNameLength, m_long_move_mask, m_long_move_mask_x_num, m_long_move_mask_x_num_half, m_long_move_mask_x_num_half_array, m_long_move_mask_y_num, m_long_move_mask_y_num_half, m_long_move_mask_y_num_half_array, m_lowest_temp_dev, m_lowest_temperature_die, m_max_alive_days, m_max_flying_wind_speed, m_max_long_distance, m_num_life_stage, m_num_x_range, m_num_y_range, m_optimal_temperature, m_peak_long_distance, M_PI, m_scale_wind_speed, m_short_move_mask, m_short_move_mask_x_num, m_short_move_mask_y_num, m_size_cell, m_sub_h, m_sub_w, m_the_subpopulation_array, Population_Manager_Base::m_TheLandscape, m_total_num_each_stage, m_vec_subpopulation_pointers_polygon, m_wind_direction_array, m_wind_direction_num, m_wind_speed_lookup_table, m_wind_speed_num, m_wind_speed_step_size, openSubpopulationBaseProbeFile(), readDevReproFile(), Population_Manager_Base::SimH, Population_Manager_Base::SimW, Landscape::SupplyNumberOfPolygons(), and CfgBool::value().
|
virtual |
SubPopulation_Manager Destructor.
References cfg_Subpopu_Base_Output_Used, m_num_x_range, m_num_y_range, m_subpopulation_base_prb_file, m_the_subpopulation_array, and CfgBool::value().
void SubPopulation_Population_Manager::addNewDay | ( | ) |
Add new day to the newest and oldest array.
References m_index_new_old, m_max_alive_days, and m_num_life_stage.
Referenced by DoLast().
double SubPopulation_Population_Manager::calLandingCurve | ( | double | a_dis, |
double | a_peak, | ||
double | a_furthest | ||
) |
The function to calculate the landing curve along the wind direction.
Referenced by calLongMovementMask().
|
virtual |
Function to calculate the movement mask.
References calLandingCurve(), m_landing_masks, m_long_move_mask, m_long_move_mask_x_num_half, m_long_move_mask_x_num_half_array, m_long_move_mask_y_num_half, m_long_move_mask_y_num_half_array, m_max_long_distance, m_peak_long_distance, m_scale_wind_speed, m_sub_h, m_sub_w, m_wind_direction_array, m_wind_direction_num, and m_wind_speed_num.
Referenced by SubPopulation_Population_Manager().
|
virtual |
Return the next life stage for the given life stage.
Return the next life stage based on the density
Reimplemented in Aphid_Population_Manager.
References cfg_Subpopu_Density_Threshold, and CfgFloat::value().
Referenced by SubPopulation::doDevelopment().
|
virtual |
Calculate the offspring life stage.
Reimplemented in Aphid_Population_Manager.
Referenced by Aphid::doReproduction(), and SubPopulation::doReproduction().
SubPopulation * SubPopulation_Population_Manager::CreateObjects | ( | TAnimal * | pvo, |
struct_SubPopulation * | data, | ||
int | number | ||
) |
References struct_SubPopulation::empty_flag, struct_SubPopulation::index_x, struct_SubPopulation::index_y, struct_SubPopulation::L, struct_SubPopulation::NPM, struct_SubPopulation::starting_popu_density, struct_SubPopulation::starting_suitability, tos_Egg, struct_SubPopulation::x, and struct_SubPopulation::y.
Referenced by initialisePopulation().
void SubPopulation_Population_Manager::doDevelopment | ( | ) |
Function to make the development for all the subpopulation object.
References g_landscape_p, isEnoughNextLifeStage(), m_accumu_degree_days, m_development_degree_day, m_hibernated_hatch_flag, m_index_new_old, m_index_next_life_stage, m_lowest_temp_dev, m_max_alive_days, m_num_life_stage, Population_Manager_Base::m_TheLandscape, Landscape::SupplyMonth(), and Landscape::SupplyTemp().
Referenced by DoLast().
|
virtual |
References doParasitoidDevelopment(), g_landscape_p, m_max_flying_wind_speed, relocatePopulation(), Landscape::SupplyWind(), updateDevelopmentSeason(), and updateMortalityArray().
Referenced by Run().
void SubPopulation_Population_Manager::doFlying | ( | int | ind, |
int | index_x, | ||
int | index_y | ||
) |
The function to fly the winged adults.
References g_landscape_p, m_cell_suitability, m_current_flying_array, m_flying_life_stage_array, m_index_new_old, m_landing_life_stage_array, m_landing_masks, m_long_move_mask_x_num_half_array, m_long_move_mask_y_num_half_array, m_num_x_range, m_num_y_range, m_the_subpopulation_array, m_wind_speed_lookup_table, Landscape::SupplyWind(), and Landscape::SupplyWindDirection().
Referenced by relocatePopulation().
|
virtual |
References addNewDay(), doDevelopment(), doSpecicesLastThing(), m_subpopulation_base_prb_file, subpopuBaseOutputProbe(), and updateWholePopulation().
Referenced by Run().
void SubPopulation_Population_Manager::doLocalMovement | ( | int | index_x, |
int | index_y, | ||
double | proportion | ||
) |
The function for local movement.
References m_cell_suitability, m_local_moving_life_stage_array, m_max_alive_days, m_num_x_range, m_num_y_range, and m_the_subpopulation_array.
|
inlinevirtual |
The function for parasitoid calculation, it does nothing in this base class.
Referenced by DoFirst().
|
inlinevirtual |
|
virtual |
Must be re-implemented in descendent classes. Gets the number of 'live' objects.
Reimplemented from Population_Manager_Base.
References supplyAllPopulationGivenStage().
|
inlinevirtual |
Must be re-implemented in descendent classes.
Reimplemented from Population_Manager_Base.
References supplyAllPopulationGivenStage().
double SubPopulation_Population_Manager::getSubpopulationInCellLifeStage | ( | int | x_indx, |
int | y_indx, | ||
int | a_life_stage | ||
) |
Supply the subpopulation size at the given life stage in the given cell.
References m_the_subpopulation_array.
|
inline |
Supply the suitability in the given cell.
References m_cell_suitability.
Referenced by Aphid::doMovement().
double SubPopulation_Population_Manager::getTotalSubpopulationInCell | ( | int | x_indx, |
int | y_indx | ||
) |
Supply the total subpopulation size in the given cell.
References m_the_subpopulation_array.
Referenced by Aphid::doMovement().
|
virtual |
The function to initialise the population when starting the simulation which requires rewritten in the derived class.
Reimplemented in Aphid_Population_Manager.
References CreateObjects(), struct_SubPopulation::empty_flag, g_landscape_p, struct_SubPopulation::h, struct_SubPopulation::index_x, struct_SubPopulation::index_y, isSummerHostTole(), struct_SubPopulation::L, m_cell_popu_density, m_cell_suitability, m_flying_life_stage_array, m_landing_life_stage_array, Population_Manager_Base::m_ListNames, m_local_moving_life_stage_array, Population_Manager_Base::m_SimulationName, m_sub_h, m_sub_w, m_the_subpopulation_array, Population_Manager_Base::m_TheLandscape, m_vec_subpopulation_pointers_polygon, struct_SubPopulation::NPM, readHosts(), Population_Manager_Base::SimH, Population_Manager_Base::SimW, struct_SubPopulation::starting_popu_density, struct_SubPopulation::starting_suitability, Landscape::SupplyElementType(), Landscape::SupplyPolyRefIndex(), Landscape::SupplyVegBiomass(), struct_SubPopulation::w, struct_SubPopulation::x, and struct_SubPopulation::y.
Referenced by SubPopulation_Population_Manager().
|
virtual |
The funcition to check whether it is read for the next life stage.
Reimplemented in Aphid_Population_Manager.
References m_accumu_degree_days, m_development_degree_day, and m_index_new_old.
Referenced by doDevelopment().
bool SubPopulation_Population_Manager::isSummerHostTole | ( | TTypesOfLandscapeElement | a_ele | ) |
Test whether it is a summer host tole.
References count, and m_summer_hosts_tole.
Referenced by SubPopulation::calSuitability(), initialisePopulation(), and Aphid_Population_Manager::initialiseSimWithEggs().
bool SubPopulation_Population_Manager::isSummerHostTov | ( | TTypesOfVegetation | a_ele | ) |
Test whether it is a summer host tov.
References count, and m_summer_hosts_tov.
Referenced by SubPopulation::calSuitability().
bool SubPopulation_Population_Manager::isWinterHostTole | ( | TTypesOfLandscapeElement | a_ele | ) |
Test whether it is a winter host tole.
References count, and m_winter_hosts_tole.
Referenced by Aphid_Population_Manager::initialiseSimWithEggs().
bool SubPopulation_Population_Manager::isWinterHostTov | ( | TTypesOfVegetation | a_ele | ) |
bool SubPopulation_Population_Manager::openSubpopulationBaseProbeFile | ( | ) |
Open the storing file.
References cfg_Subpopu_Base_Output_Filename, g_msg, m_num_life_stage, m_num_x_range, m_num_y_range, m_subpopulation_base_prb_file, CfgStr::value(), MapErrorMsg::Warn(), and WARN_FILE.
Referenced by Aphid_Population_Manager::Aphid_Population_Manager(), and SubPopulation_Population_Manager().
void SubPopulation_Population_Manager::readDevReproFile | ( | string | inputfile | ) |
Function to read the development time and lifestage.
References m_development_degree_day, m_lowest_temp_dev, and m_num_life_stage.
Referenced by SubPopulation_Population_Manager().
|
virtual |
The fuction to read the host lists for aphid.
References g_farmmanager, m_mul_hosts_flag, m_summer_host_on, m_summer_hosts_tole, m_summer_hosts_tole_period, m_summer_hosts_tole_period_map, m_summer_hosts_tov, m_winter_host_on, m_winter_hosts_tole, m_winter_hosts_tole_period, m_winter_hosts_tole_period_map, m_winter_hosts_tov, and FarmManager::TranslateVegCodes().
Referenced by Aphid_Population_Manager::initialisePopulation(), and initialisePopulation().
void SubPopulation_Population_Manager::relocatePopulation | ( | void | ) |
Relocate the population in each cell based on the suitability and movement ability.
References doFlying(), m_flying_life_stage_array, m_num_x_range, m_num_y_range, and m_the_subpopulation_array.
Referenced by DoFirst().
|
protectedvirtual |
This is the main scheduling method for the population manager using subpopulation model.
Reimplemented from Population_Manager_Base.
References DoFirst(), DoLast(), g_landscape_p, m_num_x_range, m_num_y_range, m_the_subpopulation_array, Population_Manager_Base::m_TheLandscape, Landscape::SupplyDayInYear(), Landscape::SupplyElementType(), Landscape::SupplyGreenBiomass(), Landscape::SupplyVegBiomass(), Landscape::SupplyVegType(), tole_PermPastureTussocky, tov_DKLegume_Beans, and writeCalibrationFiles().
|
inline |
The function to set the flag indicating whether a given lifestage is the first time of existing.
References m_first_flag_life_stage.
Referenced by SubPopulation::doDevelopment(), and Aphid::doReproduction().
|
virtual |
Sets up probe and species specifics.
Reimplemented from Population_Manager_Base.
References g_Species, Population_Manager_Base::m_TheLandscape, and Landscape::SetSpeciesFunctions().
void SubPopulation_Population_Manager::setOldIndex | ( | int | life_stage, |
int | p_value | ||
) |
The function to set the oldest index for the given life stage.
References m_accumu_degree_days, and m_index_new_old.
Referenced by SubPopulation::doDevelopment(), and Aphid::doReproduction().
|
virtual |
Below are the functions for saving result.
References g_landscape_p, m_num_life_stage, m_num_x_range, m_num_y_range, m_subpopulation_base_prb_file, m_the_subpopulation_array, m_total_num_each_stage, Landscape::SupplyDaylength(), and Landscape::SupplyTemp().
Referenced by DoLast().
int SubPopulation_Population_Manager::supplyAgeInDay | ( | int | lifestage_index, |
int | column_index | ||
) |
The function to return the age in days given an element in the subpopulation table.
References m_max_alive_days, and supplyNewestIndex().
Referenced by Aphid::doReproduction().
|
inline |
double SubPopulation_Population_Manager::supplyAllPopulationGivenStage | ( | int | index | ) |
Supply the population size at the given life stage for the who landscape.
References m_num_life_stage, and m_total_num_each_stage.
Referenced by GetLiveArraySize(), and GetPopulationSize().
|
inline |
|
inline |
Supply number of subpopulation in x coordinate.
References m_num_x_range.
Referenced by Aphid::doMovement().
|
inline |
Supply number of subpopulation in y coordinate.
References m_num_y_range.
Referenced by Aphid::doMovement().
|
inline |
|
inlinevirtual |
The function to supply the development season.
Reimplemented in Aphid_Population_Manager.
|
inline |
The function to supply the flag of first for the given life stage.
References m_first_flag_life_stage.
Referenced by SubPopulation::doDevelopment(), and Aphid::doReproduction().
|
inline |
Supply the number of life stage.
References m_num_life_stage.
Referenced by SubPopulation::doDevelopment(), SubPopulation::doMortality(), Aphid::doReproduction(), SubPopulation::doReproduction(), and SubPopulation::SubPopulation().
|
inlinevirtual |
A stub for identifying an individual at a location.
Reimplemented from Population_Manager_Base.
References m_the_subpopulation_array.
|
inline |
Supply the maximum number of column in the development array.
References m_max_alive_days.
Referenced by SubPopulation::addAnimalNumGivenStage(), SubPopulation::doMortality(), Aphid::doReproduction(), and SubPopulation::SubPopulation().
|
inline |
The function to supply the mortality rate for the given life stage and the age.
References m_current_mortality_array.
|
inline |
The function to supply the 1D base morality rate array for the given life stage.
References m_current_mortality_array.
|
inline |
The function to supply the whole base mortality rate array.
References m_current_mortality_array.
Referenced by SubPopulation::doMortality().
|
inline |
References m_index_new_old.
Referenced by SubPopulation::doDevelopment(), Aphid::doReproduction(), SubPopulation::doReproduction(), and supplyAgeInDay().
|
inline |
Supply the next life stage index for a given life stage and a given life path.
References m_life_circle_path.
|
inline |
Supply the number of life stages that can fly.
References m_flying_life_stage_array.
Referenced by SubPopulation::doMovement(), and SubPopulation::SubPopulation().
|
inline |
Supply the number of life stages thah can do local movement.
References m_local_moving_life_stage_array.
Referenced by SubPopulation::SubPopulation().
|
inline |
|
inline |
Supply the size of aphid subpopulation cell.
References m_size_cell.
Referenced by Aphid::calPopuDensity(), and SubPopulation::calPopuDensity().
SubPopulation * SubPopulation_Population_Manager::supplySubPopulationPointer | ( | int | indx, |
int | indy | ||
) |
Supply the pointer of the subpopulation object in the given cell.
References m_the_subpopulation_array.
Referenced by Aphid::doMovement().
|
inline |
|
inline |
The function to supply the available period vector for the given summer tole host.
References m_summer_hosts_tole_period, and m_summer_hosts_tole_period_map.
double SubPopulation_Population_Manager::supplyTotalPopulationInCell | ( | int | x_indx, |
int | y_indx | ||
) |
Supply whole population size at the given cell.
|
inline |
Supply the vector of life stages for flying.
References m_flying_life_stage_array.
Referenced by SubPopulation::doMovement().
|
inline |
Supply the vector of life stages that can do local movement.
References m_local_moving_life_stage_array.
Referenced by Aphid::doMovement().
|
inline |
References m_winter_host_on.
Referenced by Aphid::calPopuDensity(), Aphid::calSuitabilityShared(), and Aphid::doReproduction().
|
inline |
The function to supply the available period vector for the given winter tole host.
References m_winter_hosts_tole_period, and m_winter_hosts_tole_period_map.
|
inlinevirtual |
The function to update the development season.
Reimplemented in Aphid_Population_Manager.
Referenced by DoFirst().
|
virtual |
This function is used to update the daily mortality rate for all the ages. In this base class, it only depends on the temperature. The lowest and highest temperature that will make the species die. The optimal temperature will make the mortality rate to be 0.
Reimplemented in Aphid_Population_Manager.
References g_landscape_p, m_current_mortality_array, m_highest_temperature_die, m_lowest_temperature_die, m_num_life_stage, and Landscape::SupplyTemp().
Referenced by DoFirst().
void SubPopulation_Population_Manager::updateWholePopulation | ( | ) |
Update whole population info.
References m_num_life_stage, m_num_x_range, m_num_y_range, m_the_subpopulation_array, and m_total_num_each_stage.
Referenced by DoLast().
void SubPopulation_Population_Manager::updateWholePopulationArray | ( | blitz::Array< double, 1 > | a_array | ) |
References m_total_num_each_stage.
void SubPopulation_Population_Manager::updateWholePopulationArray | ( | int | a_listindex, |
double | number | ||
) |
The function to update the whole population array in the whole landscape.
References m_total_num_each_stage.
|
inlinevirtual |
|
friend |
|
protected |
Array for accumulated degree days for each life circle.
Referenced by Aphid_Population_Manager::calHatchChance(), doDevelopment(), Aphid_Population_Manager::doSpeciesLastThing(), Aphid_Population_Manager::initialiseSimWithEggs(), isEnoughNextLifeStage(), Aphid_Population_Manager::isEnoughNextLifeStageShared(), setOldIndex(), SubPopulation_Population_Manager(), supplyAgeInDayDegree(), and Aphid_Population_Manager::updateMortalityArrayShared().
|
protected |
Array for weighted population density in each subpopulation cell.
Referenced by initialisePopulation(), Aphid_Population_Manager::initialiseSimWithEggs(), and SubPopulation_Population_Manager().
|
protected |
Array for suitable value in each subpopulation cell.
Referenced by doFlying(), doLocalMovement(), getSuitabilityInCell(), initialisePopulation(), Aphid_Population_Manager::initialiseSimWithEggs(), and SubPopulation_Population_Manager().
|
protected |
Temporal array for the flying subpopulation.
Referenced by doFlying(), and SubPopulation_Population_Manager().
|
protected |
Temporal array for the landing subpopulation.
Referenced by SubPopulation_Population_Manager().
|
protected |
This a lookup table for the age and temperature dependent mortality rate. This is the same for the whole landscape for each day. Further cell specific related calculate should be done in the SubPopulation class.
Referenced by SubPopulation_Population_Manager(), supplyMortality(), supplyMortalityStageArray(), supplyMortalityWholeArray(), updateMortalityArray(), and Aphid_Population_Manager::updateMortalityArrayShared().
|
protected |
The array to store the average max and std development time for each life stage, max and std time for reproducing.
Referenced by doDevelopment(), isEnoughNextLifeStage(), and readDevReproFile().
|
protected |
Array to track whether it is the first existence for a life stage.
Referenced by setFirstFlagLifeStage(), SubPopulation_Population_Manager(), and supplyFirstFlagLifeStage().
|
protected |
The vector to store the life stages that can fly.
Referenced by doFlying(), Aphid_Population_Manager::initialisePopulation(), initialisePopulation(), relocatePopulation(), supplyNumFlyingLifeStages(), and supplyVecFlyingLifeStages().
|
protected |
Flag variable to indicate hibernated eggs are ready to hatch.
Referenced by doDevelopment(), and SubPopulation_Population_Manager().
|
private |
The highest temperature that will cause the species die.
Referenced by SubPopulation_Population_Manager(), and updateMortalityArray().
|
protected |
Array for index of the newest and oldest life stages.
Referenced by addNewDay(), doDevelopment(), doFlying(), Aphid_Population_Manager::doSpeciesLastThing(), isEnoughNextLifeStage(), Aphid_Population_Manager::isEnoughNextLifeStageShared(), setOldIndex(), SubPopulation_Population_Manager(), and supplyNewestIndex().
|
private |
The array to store the index for the ones go to the next life stage or die. -1 means nothing.
Referenced by doDevelopment(), SubPopulation_Population_Manager(), and supplyOldEnoughIndex().
|
protected |
The vector to store the life stage when a flying one lands, it could be different from the flying one, e.g., they drop theri wings.
Referenced by doFlying(), Aphid_Population_Manager::initialisePopulation(), and initialisePopulation().
|
protected |
The array to store the landing masks. The vector is indexed by the wind speed index first and the second index is the wind direction. Each element is a 2-D dimensional blitz array.
Referenced by calLongMovementMask(), doFlying(), and SubPopulation_Population_Manager().
|
protected |
The life circle array. It could have more than one life circle paths.
Referenced by supplyNextLifeStage().
|
protected |
The vector to store the life stags that can move locally.
Referenced by doLocalMovement(), Aphid_Population_Manager::initialisePopulation(), initialisePopulation(), supplyNumLocMovLifeStages(), and supplyVecLocMoveLifeStages().
|
protected |
Long distance movement mask.
Referenced by calLongMovementMask(), and SubPopulation_Population_Manager().
|
protected |
Variable to record the dimension of the long distance movement mask. - x.
Referenced by SubPopulation_Population_Manager().
|
protected |
Variable to record the dimension of the short distance movement mask. - x.
Referenced by calLongMovementMask(), and SubPopulation_Population_Manager().
|
protected |
Array to store the number of cells for longest flying at different windspeed.
Referenced by calLongMovementMask(), doFlying(), and SubPopulation_Population_Manager().
|
protected |
Variable to record the dimension of the long distance movement mask. - y.
Referenced by SubPopulation_Population_Manager().
|
protected |
Referenced by calLongMovementMask(), and SubPopulation_Population_Manager().
|
protected |
Referenced by calLongMovementMask(), doFlying(), and SubPopulation_Population_Manager().
|
protected |
Lowest development temperatures for each life stage. This is the last step in each day.
Referenced by doDevelopment(), Aphid_Population_Manager::initialisePopulation(), readDevReproFile(), and SubPopulation_Population_Manager().
|
private |
The lowest temperature that will cause the species die.
Referenced by SubPopulation_Population_Manager(), and updateMortalityArray().
|
protected |
The longest alive day among all the life stages.
Referenced by addNewDay(), doDevelopment(), doLocalMovement(), Aphid_Population_Manager::doSpeciesLastThing(), SubPopulation_Population_Manager(), supplyAgeInDay(), and supplyMaxColNum().
|
protected |
The larget wind speed for winged adults to fly.
Referenced by DoFirst(), and SubPopulation_Population_Manager().
|
protected |
The longest distance that the specieces can fly for long distance dispersal.
Referenced by calLongMovementMask(), and SubPopulation_Population_Manager().
|
protected |
The longest distance that the specieces can move for short distance dispersal.
|
protected |
Flag to show whether it has both winter and summer host.
Referenced by Aphid_Population_Manager::initialiseSimWithEggs(), readHosts(), and Aphid_Population_Manager::updateDevelopmentSeason().
|
protected |
The number of life stages for the animal.
Referenced by addNewDay(), doDevelopment(), openSubpopulationBaseProbeFile(), readDevReproFile(), subpopuBaseOutputProbe(), SubPopulation_Population_Manager(), supplyAllPopulationGivenStage(), supplyLifeStageNum(), updateMortalityArray(), and updateWholePopulation().
|
protected |
The number of subpopulation in x range.
Referenced by doFlying(), doLocalMovement(), openSubpopulationBaseProbeFile(), relocatePopulation(), Run(), subpopuBaseOutputProbe(), SubPopulation_Population_Manager(), supplyCellNumX(), updateWholePopulation(), and ~SubPopulation_Population_Manager().
|
protected |
The number of subpopulation in y range.
Referenced by doFlying(), doLocalMovement(), openSubpopulationBaseProbeFile(), relocatePopulation(), Run(), subpopuBaseOutputProbe(), SubPopulation_Population_Manager(), supplyCellNumY(), updateWholePopulation(), and ~SubPopulation_Population_Manager().
|
private |
The optimal development temperature for the species. (Mortality rate = 0).
Referenced by SubPopulation_Population_Manager().
|
protected |
The distance for the peak amount of landing.
Referenced by calLongMovementMask(), and SubPopulation_Population_Manager().
|
protected |
The scale for wind.
Referenced by calLongMovementMask(), and SubPopulation_Population_Manager().
|
protected |
Short distance movement mask.
Referenced by SubPopulation_Population_Manager().
|
protected |
Referenced by SubPopulation_Population_Manager().
|
protected |
Variable to record the dimension of the short distance movement mask. - y.
Referenced by SubPopulation_Population_Manager().
|
private |
The size of each subpopulation cell.
Referenced by SubPopulation_Population_Manager(), and supplySizeSubpopulationCell().
|
protected |
Variable to record the height of the subpopulation cell.
Referenced by calLongMovementMask(), initialisePopulation(), Aphid_Population_Manager::initialiseSimWithEggs(), Aphid_Population_Manager::KillAphid(), SubPopulation_Population_Manager(), Aphid_Population_Manager::SupplyAphidDensity(), and supplyCellHeight().
|
protected |
Variable to record the width of the subpopulation cell.
Referenced by calLongMovementMask(), initialisePopulation(), Aphid_Population_Manager::initialiseSimWithEggs(), Aphid_Population_Manager::KillAphid(), SubPopulation_Population_Manager(), Aphid_Population_Manager::SupplyAphidDensity(), and supplyCellWidth().
|
protected |
The file for the storing the data.
Referenced by DoLast(), openSubpopulationBaseProbeFile(), subpopuBaseOutputProbe(), and ~SubPopulation_Population_Manager().
|
protected |
The flag to enable summer host.
Referenced by readHosts(), supplySummerHostOn(), and Aphid_Population_Manager::updateDevelopmentSeason().
|
protected |
The vector to hold summer host landscape type.
Referenced by isSummerHostTole(), and readHosts().
|
protected |
The vector to store the exsiting period for summer host tole.
Referenced by readHosts(), and supplySummerTolePeriod().
|
protected |
The map to store the index for the summer host period.
Referenced by readHosts(), and supplySummerTolePeriod().
|
protected |
The vector to hold sumber host vegetation type.
Referenced by isSummerHostTov(), and readHosts().
|
protected |
Vector to store the all the pointers for the subpopulation object.
Referenced by doFlying(), doLocalMovement(), getSubpopulationInCellLifeStage(), getTotalSubpopulationInCell(), initialisePopulation(), Aphid_Population_Manager::initialiseSimWithEggs(), Aphid_Population_Manager::KillAphid(), relocatePopulation(), Run(), subpopuBaseOutputProbe(), SubPopulation_Population_Manager(), Aphid_Population_Manager::SupplyAphidDensity(), SupplyLocXY(), supplySubPopulationPointer(), updateWholePopulation(), and ~SubPopulation_Population_Manager().
|
private |
Array to hold the total number of alive animals under different life stages in the whole landscape.
Referenced by subpopuBaseOutputProbe(), SubPopulation_Population_Manager(), supplyAllPopulationGivenStage(), updateWholePopulation(), and updateWholePopulationArray().
|
protected |
The vector used to store the pointers of all the subpopulation objects in each polygon.
Referenced by initialisePopulation(), Aphid_Population_Manager::initialiseSimWithEggs(), and SubPopulation_Population_Manager().
|
protected |
The array to hold the wind directions.
Referenced by calLongMovementMask(), and SubPopulation_Population_Manager().
|
protected |
The number of wind directions.
Referenced by calLongMovementMask(), and SubPopulation_Population_Manager().
|
protected |
The look up table for wind speed index in the flying mask.
Referenced by doFlying(), and SubPopulation_Population_Manager().
|
protected |
The number of wind speed samples.
Referenced by calLongMovementMask(), and SubPopulation_Population_Manager().
|
protected |
The sampling step size for wind speed.
Referenced by SubPopulation_Population_Manager().
|
protected |
The flag to enalble winter host.
Referenced by Aphid_Population_Manager::calOffspringStageBBandPP(), readHosts(), supplyWinterHostOn(), and Aphid_Population_Manager::updateDevelopmentSeason().
|
protected |
The vector to hold winter host landscape type.
Referenced by isWinterHostTole(), and readHosts().
|
protected |
The vector to store the exsiting period for winter host tole.
Referenced by readHosts(), and supplyWinterTolePeriod().
|
protected |
The map to store the index for the winter host period.
Referenced by readHosts(), and supplyWinterTolePeriod().
|
protected |
The vector to hold winter host vegetation type.
Referenced by isWinterHostTov(), and readHosts().