ALMaSS Rodenticide ODdox
1.1
The rodenticide model description following ODdox protocol
|
#include <RodenticidePredators.h>
Public Member Functions | |
virtual | ~RodenticidePredators_Population_Manager () |
RodenticidePredators_Population_Manager (Landscape *L) | |
void | Tick () |
Updates the rodenticide exposure for all predator territories. More... | |
void | PreCachePoly (int a_poly) |
vector< RP_Territory > * | SupplyTerritories () |
int | HowManyTerritoriesHere (int a_x, int a_y) |
Public Member Functions inherited from Population_Manager | |
Population_Manager (Landscape *L) | |
virtual | ~Population_Manager (void) |
void | SetNoProbes (int a_pn) |
unsigned | GetLiveArraySize (int a_listindex) |
Gets the number of 'live' objects for a list index in the TheArray. More... | |
void | IncLiveArraySize (int a_listindex) |
Increments the number of 'live' objects for a list index in the TheArray. More... | |
virtual void | Catastrophe (int) |
unsigned int | FarmAnimalCensus (unsigned int a_farm, unsigned int a_typeofanimal) |
char * | SpeciesSpecificReporting (int a_species, int a_time) |
char * | ProbeReport (int a_time) |
char * | ProbeReportTimed (int a_time) |
void | ImpactProbeReport (int a_Time) |
bool | BeginningOfMonth () |
void | LOG (const char *fname) |
int | SupplyStepSize () |
int | SupplySimW () |
int | SupplySimH () |
virtual void | Run (int NoTSteps) |
virtual float | Probe (int ListIndex, probe_data *p_TheProbe) |
virtual void | ImpactedProbe () |
int | SupplyListNameLength () |
TAnimal * | SupplyAnimalPtr (int a_index, int a_animal) |
Returns the pointer indexed by a_index and a_animal. Note NO RANGE CHECK. More... | |
unsigned | SupplyListIndexSize () |
unsigned | SupplyListSize (unsigned listindex) |
bool | CheckXY (int l, int i) |
Debug method to test for out of bounds coordinates. More... | |
const char * | SupplyListName (int i) |
bool | IsLast (unsigned listindex) |
int | SupplyState (unsigned listindex, unsigned j) |
virtual void | SupplyLocXY (unsigned listindex, unsigned j, int &x, int &y) |
const char * | SupplyStateNames (int i) |
unsigned | SupplyStateNamesLength () |
virtual void | DisplayLocations () |
int | ProbeFileInput (char *p_Filename, int p_ProbeNo) |
TAnimal * | FindClosest (int x, int y, unsigned Type) |
bool | OpenTheRipleysOutputProbe (string a_NWordFilename) |
void | OpenTheAOROutputProbe (string a_AORFilename) |
bool | OpenTheMonthlyRipleysOutputProbe () |
bool | OpenTheReallyBigProbe () |
virtual void | TheAOROutputProbe () |
virtual void | TheRipleysOutputProbe (FILE *a_prb) |
virtual void | TheReallyBigOutputProbe () |
void | CloseTheMonthlyRipleysOutputProbe () |
virtual void | CloseTheRipleysOutputProbe () |
virtual void | CloseTheReallyBigOutputProbe () |
TTypesOfPopulation | GetPopulationType () |
int | GetSeasonNumber () |
Get the season number. More... | |
void | LamdaDeath (int x, int y) |
void | LamdaBirth (int x, int y) |
void | LamdaBirth (int x, int y, int z) |
void | LamdaClear () |
void | LamdaDumpOutput () |
virtual int | SupplyPegPosx (int) |
virtual int | SupplyPegPosy (int) |
virtual int | SupplyCovPosx (int) |
virtual int | SupplyCovPosy (int) |
virtual bool | OpenTheFledgelingProbe () |
virtual bool | OpenTheBreedingPairsProbe () |
virtual bool | OpenTheBreedingSuccessProbe () |
virtual void | BreedingPairsOutput (int) |
virtual int | TheBreedingFemalesProbe (int) |
virtual int | TheFledgelingProbe () |
virtual void | BreedingSuccessProbeOutput (double, int, int, int, int, int, int, int) |
virtual int | TheBreedingSuccessProbe (int &, int &, int &, int &, int &, int &) |
virtual void | FledgelingProbeOutput (int, int) |
virtual void | TheGeneticProbe (unsigned, int, unsigned &) |
virtual void | GeneticsResultsOutput (FILE *, unsigned) |
Protected Member Functions | |
double | EvaluatePoly (int a_poly) |
Get the habitat quality based on polygon type. More... | |
void | ReadHabitatValues (int a_type) |
Read in specific predator type habitat scores. More... | |
void | CreatHabitatQualGrid (void) |
Evaluate the landscape and create the habitat quality grid. More... | |
void | CreateTerritories () |
Populates the landscape with predatory territories. More... | |
void | PredatorTerritoryOutput (bool a_initial) |
Output functions for predator territories. More... | |
void | PredatorTerritoryInput () |
Output functions for predator territories. More... | |
bool | IsGridPositionValid (int &x, int &y, int range) |
Tests whether a square has any occupied cells. More... | |
double | EvaluateHabitat (int a_x, int a_y, int a_range) |
Gets the total habitat score for a square UL x,y diameter of range. More... | |
void | NewTerritory (int a_x, int a_y, int a_range, double a_qual) |
Create a new territory and claim the grid. More... | |
Protected Member Functions inherited from Population_Manager | |
virtual bool | StepFinished () |
Overrides the population manager StepFinished - there is no chance that hunters do not finish a step behaviour. More... | |
virtual void | DoFirst () |
virtual void | DoBefore () |
virtual void | DoAfter () |
virtual void | DoAlmostLast () |
virtual void | DoLast () |
void | EmptyTheArray () |
Removes all objects from the TheArray by deleting them and clearing TheArray. More... | |
void | SortX (unsigned Type) |
void | SortXIndex (unsigned Type) |
void | SortY (unsigned Type) |
void | SortState (unsigned Type) |
void | SortStateR (unsigned Type) |
unsigned | PartitionLiveDead (unsigned Type) |
void | Shuffle_or_Sort (unsigned Type) |
void | Shuffle (unsigned Type) |
virtual void | Catastrophe () |
Additional Inherited Members | |
Public Attributes inherited from Population_Manager | |
int | IndexArrayX [5][10000] |
probe_data * | TheProbe [100] |
int | SimH |
int | SimW |
unsigned | SimHH |
unsigned | SimWH |
char | m_SimulationName [255] |
bool | ProbesSet |
Landscape * | m_TheLandscape |
|
virtual |
When the manager is destroyed call the output functions for predator territories
References m_occupancy_grid, m_qual_cache, m_qual_grid, and PredatorTerritoryOutput().
RodenticidePredators_Population_Manager::RodenticidePredators_Population_Manager | ( | Landscape * | L | ) |
On construction the first thing to do is to read the quality scores in from the correct predator input file. This depends on a config variable being correctly set: cfg_RodenticidePredatoryType
Create the habitat quality grid ready for predatory habitat assessment
Now populate the landscape with predatory territories
References cfg_rodenticide_read_predators(), cfg_RodenticidePredatoryMaxTerr(), cfg_RodenticidePredatoryMinTerr(), cfg_RodenticidePredatoryTargetQual(), cfg_RodenticidePredatoryType(), CreateTerritories(), CreatHabitatQualGrid(), m_predator_maxHR, m_predator_minHR, m_predator_targetQual, m_summeddays, PredatorTerritoryInput(), PredatorTerritoryOutput(), and ReadHabitatValues().
|
protected |
Populates the landscape with predatory territories.
Starts with a minimum territory size territory and then increases the size until either a occupied square is found or max size is reached, or the quality level has been met.
References EvaluateHabitat(), g_rand_uni, IsGridPositionValid(), m_NoTerritories, m_predator_maxHR, m_predator_minHR, m_predator_targetQual, m_sim_h_div_10, m_sim_w_div_10, and NewTerritory().
Referenced by RodenticidePredators_Population_Manager().
|
protected |
Evaluate the landscape and create the habitat quality grid.
Need to do the basic read and quality assessment for the landscape, before creating and allocating the predatory territories. The first step is to get the map dimensions saved to local attributes.
Following that all the polygons in the landscape are pre-cached for their quality score - this is important for speed because it only needs to be done once per polygon.
Finally go through the whole landscape in 10x10m blocks and fill in the quality grid scoresas a the mean of 100m2 i.e. 10 x 10 m squares
References m_hash_size, m_occupancy_grid, m_qual_cache, m_qual_grid, m_sim_h, m_sim_h_div_10, m_sim_w, m_sim_w_div_10, Population_Manager::m_TheLandscape, Landscape::RodenticidePredatorsEvaluation(), Landscape::SupplyLargestPolyNumUsed(), Landscape::SupplyPolyRef(), Landscape::SupplySimAreaHeight(), and Landscape::SupplySimAreaWidth().
Referenced by RodenticidePredators_Population_Manager().
|
protected |
Gets the total habitat score for a square UL x,y diameter of range.
Looks through the area summing all scores.
References m_qual_grid, and m_sim_w_div_10.
Referenced by CreateTerritories().
|
protected |
Get the habitat quality based on polygon type.
Returns the specific score for this polygon based on the polygon type and the score stored in m_habquals
References m_habquals, Population_Manager::m_TheLandscape, and Landscape::SupplyElementType().
Referenced by PreCachePoly().
References m_Territories.
|
protected |
Tests whether a square has any occupied cells.
otherwise test each potential location to see if they are occupied - if so return false
References m_occupancy_grid, and m_sim_w_div_10.
Referenced by CreateTerritories().
|
protected |
Create a new territory and claim the grid.
References cfg_RodenticidePredatoryTerrOverlap(), RP_Territory::m_exposure, m_occupancy_grid, RP_Territory::m_range, m_sim_w_div_10, m_Territories, RP_Territory::m_x, and RP_Territory::m_y.
Referenced by CreateTerritories().
|
inline |
References EvaluatePoly(), and m_qual_cache.
Referenced by Landscape::RodenticidePredatorsEvaluation().
|
protected |
Output functions for predator territories.
Opens a standard output tab-delimited text file and reads all predatory territory information in the format:
Number of entries
Entry 1 x, Entry 1 y, Entry 1 size, Entry 1 exposure
Entry 2 x, Entry 2 y, Entry 2 size, Entry 2 exposure
Entry 3 x etc....
References RP_Territory::m_exposure, RP_Territory::m_range, m_Territories, RP_Territory::m_x, and RP_Territory::m_y.
Referenced by RodenticidePredators_Population_Manager().
|
protected |
Output functions for predator territories.
Opens a standard output tab-delimited text file and dumps all predatory territory information in the format:
Number of entries
Entry 1 x, Entry 1 y, Entry 1 size, Entry 1 exposure
Entry 2 x, Entry 2 y, Entry 2 size, Entry 2 exposure
Entry 3 x etc....
References m_summeddays, and m_Territories.
Referenced by RodenticidePredators_Population_Manager(), and ~RodenticidePredators_Population_Manager().
|
protected |
Read in specific predator type habitat scores.
This method picks the input file based on the parameter a_type and reads in the scores for each habitat for that predator type. These are stored in m_habquals for later use in habitat evaluation.
References m_habquals, Population_Manager::m_TheLandscape, and Landscape::Warn().
Referenced by RodenticidePredators_Population_Manager().
|
inline |
References m_Territories.
void RodenticidePredators_Population_Manager::Tick | ( | void | ) |
Updates the rodenticide exposure for all predator territories.
Runs through all the territories and sums up the rodenticide exposure and accumulates this in each territory
References m_sim_h, m_sim_w, m_summeddays, m_Territories, Population_Manager::m_TheLandscape, and Landscape::SupplyRodenticide().
|
protected |
Referenced by EvaluatePoly(), and ReadHabitatValues().
|
protected |
Referenced by CreatHabitatQualGrid().
|
protected |
Referenced by CreateTerritories().
|
protected |
Referenced by CreatHabitatQualGrid(), IsGridPositionValid(), NewTerritory(), and ~RodenticidePredators_Population_Manager().
|
protected |
Referenced by CreateTerritories(), and RodenticidePredators_Population_Manager().
|
protected |
Referenced by CreateTerritories(), and RodenticidePredators_Population_Manager().
|
protected |
Referenced by CreateTerritories(), and RodenticidePredators_Population_Manager().
|
protected |
Referenced by CreatHabitatQualGrid(), PreCachePoly(), and ~RodenticidePredators_Population_Manager().
|
protected |
Referenced by CreatHabitatQualGrid(), EvaluateHabitat(), and ~RodenticidePredators_Population_Manager().
|
protected |
Referenced by CreatHabitatQualGrid(), and Tick().
|
protected |
Referenced by CreateTerritories(), and CreatHabitatQualGrid().
|
protected |
Referenced by CreatHabitatQualGrid(), and Tick().
|
protected |
Referenced by CreateTerritories(), CreatHabitatQualGrid(), EvaluateHabitat(), IsGridPositionValid(), and NewTerritory().
|
protected |
Keeps track of the number of days we have rodenticide exposure summation for.
Referenced by PredatorTerritoryOutput(), RodenticidePredators_Population_Manager(), and Tick().
|
protected |
Referenced by HowManyTerritoriesHere(), NewTerritory(), PredatorTerritoryInput(), PredatorTerritoryOutput(), SupplyTerritories(), and Tick().