ALMaSS Rabbit ODdox
1.1
The rabbit model description following ODdox protocol
|
Base class for all population managers.
More...
#include <populationmanager.h>
|
| 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) |
|
Base class for all population managers.
The core of the handling of animal populations. All time-step code and most input/output is handled by this class and its descendents. This class effectively implements a state machine to facilitate simulation of animal behaviours and handle potential issues with concurrency. The PopulationManager class is never instantiated but must be used by deriving a descendent class.
Definition at line 424 of file populationmanager.h.
◆ Population_Manager()
Population_Manager::Population_Manager |
( |
Landscape * |
L | ) |
|
◆ ~Population_Manager()
Population_Manager::~Population_Manager |
( |
void |
| ) |
|
|
virtual |
◆ BeginningOfMonth()
bool Population_Manager::BeginningOfMonth |
( |
| ) |
|
◆ BreedingPairsOutput()
virtual void Population_Manager::BreedingPairsOutput |
( |
int |
| ) |
|
|
inlinevirtual |
◆ BreedingSuccessProbeOutput()
virtual void Population_Manager::BreedingSuccessProbeOutput |
( |
double |
, |
|
|
int |
, |
|
|
int |
, |
|
|
int |
, |
|
|
int |
, |
|
|
int |
, |
|
|
int |
, |
|
|
int |
|
|
) |
| |
|
inlinevirtual |
◆ Catastrophe() [1/2]
void Population_Manager::Catastrophe |
( |
| ) |
|
|
protectedvirtual |
This method MUST be overidden in descendent classes if this functionality is does not match with the animals requirements
Definition at line 1109 of file PopulationManager.cpp.
◆ Catastrophe() [2/2]
virtual void Population_Manager::Catastrophe |
( |
int |
| ) |
|
|
inlinevirtual |
◆ CheckXY()
bool Population_Manager::CheckXY |
( |
int |
l, |
|
|
int |
i |
|
) |
| |
Debug method to test for out of bounds coordinates.
Definition at line 1518 of file PopulationManager.cpp.
1520 if (
TheArray[l][i]->Supply_m_Location_x() > 10000)
return true;
1521 if (
TheArray[l][i]->Supply_m_Location_y() > 10000)
return true;
1522 if (
TheArray[l][i]->Supply_m_Location_x() < 0)
return true;
1523 if (
TheArray[l][i]->Supply_m_Location_y() < 0)
return true;
◆ CloseTheMonthlyRipleysOutputProbe()
void Population_Manager::CloseTheMonthlyRipleysOutputProbe |
( |
| ) |
|
◆ CloseTheReallyBigOutputProbe()
void Population_Manager::CloseTheReallyBigOutputProbe |
( |
| ) |
|
|
virtual |
◆ CloseTheRipleysOutputProbe()
void Population_Manager::CloseTheRipleysOutputProbe |
( |
| ) |
|
|
virtual |
◆ DisplayLocations()
void Population_Manager::DisplayLocations |
( |
| ) |
|
|
virtual |
Used to update the graphics when control is not returned to the ALMaSS_GUI between timesteps.
Definition at line 560 of file PopulationManager.cpp.
565 #ifdef __ALMASS_VISUAL
566 m_MainForm->UpdateGraphics();
◆ DoAfter()
void Population_Manager::DoAfter |
( |
| ) |
|
|
protectedvirtual |
◆ DoAlmostLast()
void Population_Manager::DoAlmostLast |
( |
| ) |
|
|
protectedvirtual |
◆ DoBefore()
void Population_Manager::DoBefore |
( |
| ) |
|
|
protectedvirtual |
◆ DoFirst()
void Population_Manager::DoFirst |
( |
| ) |
|
|
protectedvirtual |
◆ DoLast()
void Population_Manager::DoLast |
( |
| ) |
|
|
protectedvirtual |
◆ EmptyTheArray()
void Population_Manager::EmptyTheArray |
( |
| ) |
|
|
protected |
Removes all objects from the TheArray by deleting them and clearing TheArray.
Sort TheArray w.r.t. the m_Location_x attribute
Definition at line 962 of file PopulationManager.cpp.
964 for (
unsigned i = 0; i <
TheArray.size(); i++ )
967 for (
unsigned j = 0; j < (unsigned)
TheArray[i].size(); j++)
◆ FarmAnimalCensus()
unsigned int Population_Manager::FarmAnimalCensus |
( |
unsigned int |
a_farm, |
|
|
unsigned int |
a_typeofanimal |
|
) |
| |
Definition at line 1261 of file PopulationManager.cpp.
1263 unsigned int No = 0;
1265 for (
unsigned j = 0; j < sz; j++ )
1267 if (a_farm ==
TheArray[ a_typeofanimal ] [ j ]->SupplyFarmOwnerRef()) No++;
◆ FindClosest()
TAnimal * Population_Manager::FindClosest |
( |
int |
x, |
|
|
int |
y, |
|
|
unsigned |
Type |
|
) |
| |
◆ FledgelingProbeOutput()
virtual void Population_Manager::FledgelingProbeOutput |
( |
int |
, |
|
|
int |
|
|
) |
| |
|
inlinevirtual |
◆ GeneticsResultsOutput()
virtual void Population_Manager::GeneticsResultsOutput |
( |
FILE * |
, |
|
|
unsigned |
|
|
) |
| |
|
inlinevirtual |
◆ GetLiveArraySize()
unsigned Population_Manager::GetLiveArraySize |
( |
int |
a_listindex | ) |
|
|
inline |
◆ GetPopulationType()
◆ GetSeasonNumber()
int Population_Manager::GetSeasonNumber |
( |
| ) |
|
|
inline |
◆ ImpactedProbe()
void Population_Manager::ImpactedProbe |
( |
| ) |
|
|
virtual |
◆ ImpactProbeReport()
void Population_Manager::ImpactProbeReport |
( |
int |
a_Time | ) |
|
Special probe
Definition at line 1321 of file PopulationManager.cpp.
1323 for (
int ProbeNo = 0; ProbeNo < 1; ProbeNo++ ) {
1326 if ( (
TheProbe[ ProbeNo ]->m_ReportInterval == 3 )
1328 || ( (
TheProbe[ ProbeNo ]->m_ReportInterval == 1 ) && ( a_Time % 365 == 0 ) ) ) {
◆ IncLiveArraySize()
void Population_Manager::IncLiveArraySize |
( |
int |
a_listindex | ) |
|
|
inline |
◆ IsLast()
bool Population_Manager::IsLast |
( |
unsigned |
listindex | ) |
|
|
inline |
◆ LamdaBirth() [1/2]
void Population_Manager::LamdaBirth |
( |
int |
x, |
|
|
int |
y |
|
) |
| |
|
inline |
◆ LamdaBirth() [2/2]
void Population_Manager::LamdaBirth |
( |
int |
x, |
|
|
int |
y, |
|
|
int |
z |
|
) |
| |
|
inline |
◆ LamdaClear()
void Population_Manager::LamdaClear |
( |
| ) |
|
|
inline |
◆ LamdaDeath()
void Population_Manager::LamdaDeath |
( |
int |
x, |
|
|
int |
y |
|
) |
| |
|
inline |
◆ LamdaDumpOutput()
void Population_Manager::LamdaDumpOutput |
( |
| ) |
|
Special probe
Definition at line 657 of file PopulationManager.cpp.
658 ofstream fout(
"LambdaGridOuput.txt", ios_base::app);
659 for (
int i=0; i<257; i++ ) {
660 for (
int j=0; j<257; j++) {
◆ LOG()
void Population_Manager::LOG |
( |
const char * |
fname | ) |
|
Debug function used to log whatever is needed - this is just a place to write whatever is needed at the time - so contents vary
Definition at line 294 of file PopulationManager.cpp.
295 FILE * PFile = fopen(fname,
"w" );
301 for (
unsigned listindex = 0; listindex <
TheArray.size(); listindex++ ) {
303 fprintf( PFile,
"%s :\n",
m_ListNames[ listindex ] );
305 fprintf( PFile,
"%s :\n",
m_ListNames[ listindex ].c_str() );
307 for (
unsigned j = 0; j < (unsigned)
m_LiveArraySize[listindex]; j++ ) {
308 AP =
TheArray[ listindex ] [ j ]->SupplyPosition();
309 fprintf( PFile,
"%i %i %i\n", j, AP.
m_x, AP.
m_y );
References AnimalPosition::m_x, and AnimalPosition::m_y.
◆ OpenTheAOROutputProbe()
void Population_Manager::OpenTheAOROutputProbe |
( |
string |
a_AORFilename | ) |
|
◆ OpenTheBreedingPairsProbe()
virtual bool Population_Manager::OpenTheBreedingPairsProbe |
( |
| ) |
|
|
inlinevirtual |
◆ OpenTheBreedingSuccessProbe()
virtual bool Population_Manager::OpenTheBreedingSuccessProbe |
( |
| ) |
|
|
inlinevirtual |
◆ OpenTheFledgelingProbe()
virtual bool Population_Manager::OpenTheFledgelingProbe |
( |
| ) |
|
|
inlinevirtual |
◆ OpenTheMonthlyRipleysOutputProbe()
bool Population_Manager::OpenTheMonthlyRipleysOutputProbe |
( |
| ) |
|
open 12 ripley output probles, one for each month
Definition at line 778 of file PopulationManager.cpp.
781 g_msg->
Warn(
WARN_FILE,
"Population_Manager::OpenTheRipleysOutputProbe(): ""Unable to open probe file",
787 g_msg->
Warn(
WARN_FILE,
"Population_Manager::OpenTheRipleysOutputProbe(): ""Unable to open probe file",
793 g_msg->
Warn(
WARN_FILE,
"Population_Manager::OpenTheRipleysOutputProbe(): ""Unable to open probe file",
799 g_msg->
Warn(
WARN_FILE,
"Population_Manager::OpenTheRipleysOutputProbe(): ""Unable to open probe file",
805 g_msg->
Warn(
WARN_FILE,
"Population_Manager::OpenTheRipleysOutputProbe(): ""Unable to open probe file",
811 g_msg->
Warn(
WARN_FILE,
"Population_Manager::OpenTheRipleysOutputProbe(): ""Unable to open probe file",
817 g_msg->
Warn(
WARN_FILE,
"Population_Manager::OpenTheRipleysOutputProbe(): ""Unable to open probe file",
823 g_msg->
Warn(
WARN_FILE,
"Population_Manager::OpenTheRipleysOutputProbe(): ""Unable to open probe file",
829 g_msg->
Warn(
WARN_FILE,
"Population_Manager::OpenTheRipleysOutputProbe(): ""Unable to open probe file",
835 g_msg->
Warn(
WARN_FILE,
"Population_Manager::OpenTheRipleysOutputProbe(): ""Unable to open probe file",
841 g_msg->
Warn(
WARN_FILE,
"Population_Manager::OpenTheRipleysOutputProbe(): ""Unable to open probe file",
847 g_msg->
Warn(
WARN_FILE,
"Population_Manager::OpenTheRipleysOutputProbe(): ""Unable to open probe file",
References cfg_RipleysOutput_filename, g_msg, CfgStr::value(), MapErrorMsg::Warn(), and WARN_FILE.
◆ OpenTheReallyBigProbe()
bool Population_Manager::OpenTheReallyBigProbe |
( |
| ) |
|
◆ OpenTheRipleysOutputProbe()
bool Population_Manager::OpenTheRipleysOutputProbe |
( |
string |
a_NWordFilename | ) |
|
◆ PartitionLiveDead()
unsigned Population_Manager::PartitionLiveDead |
( |
unsigned |
Type | ) |
|
|
protected |
Sort TheArray w.r.t. the current state attribute in reverse order
Definition at line 1015 of file PopulationManager.cpp.
1019 return unsigned(it -
TheArray[Type].begin());
◆ Probe()
float Population_Manager::Probe |
( |
int |
ListIndex, |
|
|
probe_data * |
p_TheProbe |
|
) |
| |
|
virtual |
Default data probe. Rarely used in actuality but always available
Definition at line 680 of file PopulationManager.cpp.
689 Sp =
TheArray[ ListIndex ] [ j ]->SupplyPosition();
690 unsigned Farm =
TheArray[ ListIndex ] [ j ]->SupplyFarmOwnerRef();
691 for (
unsigned i = 0; i < p_TheProbe->
m_NoAreas; i++ ) {
694 for (
unsigned k = 0; k < p_TheProbe->
m_NoFarms; k++ ) {
703 Sp =
TheArray[ ListIndex ] [ j ]->SupplyPosition();
704 for (
unsigned i = 0; i < p_TheProbe->
m_NoAreas; i++ ) {
707 for (
unsigned k = 0; k < p_TheProbe->
m_NoEleTypes; k++ ) {
716 Sp =
TheArray[ ListIndex ] [ j ]->SupplyPosition();
718 for (
unsigned i = 0; i < p_TheProbe->
m_NoAreas; i++ ) {
721 for (
unsigned k = 0; k < p_TheProbe->
m_NoVegTypes; k++ ) {
740 for (
unsigned j = 0; j < sz; j++ ) {
741 Sp =
TheArray[ ListIndex ] [ j ]->SupplyPosition();
742 for (
unsigned i = 0; i < p_TheProbe->
m_NoAreas; i++ ) {
References AnimalPosition::m_EleType, probe_data::m_NoAreas, probe_data::m_NoEleTypes, probe_data::m_NoFarms, probe_data::m_NoVegTypes, probe_data::m_Rect, probe_data::m_RefEle, probe_data::m_RefFarms, probe_data::m_RefVeg, AnimalPosition::m_VegType, AnimalPosition::m_x, rectangle::m_x1, rectangle::m_x2, AnimalPosition::m_y, rectangle::m_y1, and rectangle::m_y2.
◆ ProbeFileInput()
int Population_Manager::ProbeFileInput |
( |
char * |
p_Filename, |
|
|
int |
p_ProbeNo |
|
) |
| |
Default probe file input
Definition at line 574 of file PopulationManager.cpp.
579 PFile = fopen(p_Filename,
"r" );
584 fgets( S, 255, PFile );
585 fgets( S, 255, PFile );
586 fscanf( PFile,
"%d\n", & data );
588 fgets( S, 255, PFile );
589 fscanf( PFile,
"%d\n", & data );
592 fgets( S, 255, PFile );
593 for (
int i = 0; i < 10; i++ ) {
594 fscanf( PFile,
"%d", & data );
599 fgets( S, 255, PFile );
600 fgets( S, 255, PFile );
601 fscanf( PFile,
"%d", & data );
603 fgets( S, 255, PFile );
604 fgets( S, 255, PFile );
605 fscanf( PFile,
"%d", & data2 );
606 fgets( S, 255, PFile );
607 fgets( S, 255, PFile );
608 fscanf( PFile,
"%d", & data );
615 fgets( S, 255, PFile );
616 fgets( S, 255, PFile );
618 for (
int i = 0; i < 10; i++ ) {
619 fscanf( PFile,
"%d", & data );
621 fscanf( PFile,
"%d", & data );
623 fscanf( PFile,
"%d", & data );
625 fscanf( PFile,
"%d", & data );
628 fgets( S, 255, PFile );
629 fgets( S, 255, PFile );
630 if (
TheProbe[ p_ProbeNo ]->m_NoVegTypes > 0 ) {
631 for (
int i = 0; i < 25; i++ ) {
632 fscanf( PFile,
"%d", & data );
636 }
else if (
TheProbe[ p_ProbeNo ]->m_NoFarms > 0 ) {
637 for (
int i = 0; i < 25; i++ ) {
638 fscanf( PFile,
"%d", & data );
643 for (
int i = 0; i < 25; i++ ) {
644 fscanf( PFile,
"%d", & data );
◆ ProbeReport()
char * Population_Manager::ProbeReport |
( |
int |
a_time | ) |
|
Definition at line 1273 of file PopulationManager.cpp.
1278 for (
int ProbeNo = 0; ProbeNo <
m_NoProbes; ProbeNo++ ) {
1282 if ( (
TheProbe[ ProbeNo ]->m_ReportInterval == 3 )
1284 || ( (
TheProbe[ ProbeNo ]->m_ReportInterval == 1 ) && ( Time % 365 == 0 ) ) ) {
1287 for (
unsigned listindex = 0; listindex < Index; listindex++ ) {
1288 if (
TheProbe[ ProbeNo ]->m_TargetTypes[ listindex ] )
1292 sprintf(str,
" %d ", No );
References g_str.
◆ ProbeReportTimed()
char * Population_Manager::ProbeReportTimed |
( |
int |
a_time | ) |
|
Definition at line 1300 of file PopulationManager.cpp.
1304 for (
int ProbeNo = 0; ProbeNo <
m_NoProbes; ProbeNo++ ) {
1307 for (
unsigned listindex = 0; listindex < Index; listindex++ ) {
1308 if (
TheProbe[ ProbeNo ]->m_TargetTypes[ listindex ] ) No += (int)
Probe( listindex,
TheProbe[ ProbeNo ] );
1311 sprintf(str,
" %d ", No );
References g_str.
◆ Run()
void Population_Manager::Run |
( |
int |
NoTSteps | ) |
|
|
virtual |
This is the main scheduling method for the population manager.
Note the structure of Shuffle_or_Sort(), DoFirst(), BeginStep, DoBefore(), Step looping until all are finished, DoAfter(), DoAlmostLast(), EndStep, DoLast().
Can do multiple time-steps here inside one landscape time-step (a day). This is used in the roe deer model to provide 10 minute behavioural time-steps.
It is necessary to remove any dead animals before the timestep starts. It is possible that animals are killed after their population manager Run method has been executed. This is the case with geese and hunters. Checking death first prevents this becomming a problem.
Definition at line 337 of file PopulationManager.cpp.
341 for (
int TSteps = 0; TSteps < NoTSteps; TSteps++ )
344 unsigned size1 = (unsigned)
TheArray.size();
349 for (
unsigned listindex = 0; listindex < size1; listindex++ )
354 #ifdef __ALMASS_VISUAL
355 if (m_MainForm!=NULL)
358 for (
unsigned listindex = 0; listindex < size1; listindex++ ) n += (
int)
m_LiveArraySize[ listindex ];
365 for (
unsigned listindex = 0; listindex < size1; listindex++ )
368 for (
unsigned j = 0; j < size2; j++ )
370 TheArray[ listindex ] [ j ]->SetStepDone(
false );
374 for (
unsigned listindex = 0; listindex < size1; listindex++ ) {
463 for (
unsigned listindex = 0; listindex < size1; listindex++ ) {
465 for (
unsigned j = 0; j < size2; j++)
466 TheArray[ listindex ] [ j ]->BeginStep();
471 for (
unsigned listindex = 0; listindex < size1; listindex++ ) {
473 for (
unsigned j = 0; j < size2; j++) {
474 TheArray[ listindex ] [ j ]->Step();
480 for (
unsigned listindex = 0; listindex < size1; listindex++ ) {
482 for (
unsigned j = 0; j < size2; j++) {
483 TheArray[ listindex ] [ j ]->EndStep();
References cfg_AOROutput_day, cfg_AOROutput_interval, cfg_AOROutput_used, cfg_AOROutputFirstYear, cfg_CatastropheEventStartYear, cfg_ReallyBigOutput_day1, cfg_ReallyBigOutput_day2, cfg_ReallyBigOutput_day3, cfg_ReallyBigOutput_day4, cfg_ReallyBigOutput_interval, cfg_ReallyBigOutput_used, cfg_ReallyBigOutputFirstYear, cfg_RipleysOutput_day, cfg_RipleysOutput_interval, cfg_RipleysOutput_used, cfg_RipleysOutputFirstYear, cfg_RipleysOutputMonthly_used, CfgInt::value(), and CfgBool::value().
◆ SetNoProbes()
void Population_Manager::SetNoProbes |
( |
int |
a_pn | ) |
|
|
inline |
◆ Shuffle()
void Population_Manager::Shuffle |
( |
unsigned |
Type | ) |
|
|
protected |
Run once through the list swapping randomly chosen elements
Definition at line 1055 of file PopulationManager.cpp.
1057 for (
unsigned i = 0; i < s; i++ ) {
1059 unsigned a = random( s );
1060 unsigned b = random( s );
◆ Shuffle_or_Sort()
void Population_Manager::Shuffle_or_Sort |
( |
unsigned |
Type | ) |
|
|
protected |
This method is used to determine whether the array of animals should be shuffled or sorted.
To do nothing ensure that the BeforeStepActions[] is set appropriately // 0 = Shuffle, 1 = SortX, 2 = SortY, 3 = sortXIndex, 4 = do nothing
Definition at line 1073 of file PopulationManager.cpp.
1093 m_TheLandscape->
Warn(
"Population_Manager::Shuffle_or_Sort- BeforeStepAction Unknown", NULL );
References g_rand_uni.
◆ SortState()
void Population_Manager::SortState |
( |
unsigned |
Type | ) |
|
|
protected |
◆ SortStateR()
void Population_Manager::SortStateR |
( |
unsigned |
Type | ) |
|
|
protected |
◆ SortX()
void Population_Manager::SortX |
( |
unsigned |
Type | ) |
|
|
protected |
◆ SortXIndex()
void Population_Manager::SortXIndex |
( |
unsigned |
Type | ) |
|
|
protected |
Sort TheArray w.r.t. the m_Location_x attribute, and make an indexing array
Definition at line 1027 of file PopulationManager.cpp.
1035 for (
unsigned i = 0; i < s; i++ ) {
1037 x =
TheArray[ Type ] [ i ]->Supply_m_Location_x();
1039 while ( counter < x )
IndexArrayX[ Type ] [ counter++ ] = -1;
1040 if ( x == counter ) {
1045 for (
int c = counter; c < 10000; c++ ) {
◆ SortY()
void Population_Manager::SortY |
( |
unsigned |
Type | ) |
|
|
protected |
◆ SpeciesSpecificReporting()
char * Population_Manager::SpeciesSpecificReporting |
( |
int |
a_species, |
|
|
int |
a_time |
|
) |
| |
This method handles species specific outputs. This is one place to do it. More commonly this is done in descendent classes
Definition at line 1121 of file PopulationManager.cpp.
1124 if ( a_species == 1 ) {
1212 #ifdef __SpecificPesticideEffectsVinclozolinLike__
1215 #ifdef __WithinOrchardPesticideSim__
1221 else if ( a_species == 0 ) {
1223 int a_day = a_time % 365;
1224 if ( a_time % 365 == 364 )
1227 int BreedingFemales, YoungOfTheYear, TotalPop, TotalFemales, TotalMales, BreedingAttempts;
1228 No =
TheBreedingSuccessProbe( BreedingFemales, YoungOfTheYear, TotalPop, TotalFemales, TotalMales, BreedingAttempts );
1230 if ( BreedingFemales > 0 ) {
1231 bs = No / ( float )BreedingFemales;
1234 TotalFemales, TotalMales, a_time, BreedingAttempts );
1236 if ( a_day == 152 ) {
1241 if ( a_day == 197 ) {
1242 for (
int ProbeNo = 0; ProbeNo <
m_NoProbes; ProbeNo++ ) {
References g_str.
◆ StepFinished()
bool Population_Manager::StepFinished |
( |
void |
| ) |
|
|
protectedvirtual |
Overrides the population manager StepFinished - there is no chance that hunters do not finish a step behaviour.
Returns true if and only if all objects have finished the current step
Definition at line 498 of file PopulationManager.cpp.
499 for (
unsigned listindex = 0; listindex <
TheArray.size(); listindex++ ) {
501 if (
TheArray[ listindex ] [ j ]->GetStepDone() == false ) {
◆ SupplyAnimalPtr()
TAnimal* Population_Manager::SupplyAnimalPtr |
( |
int |
a_index, |
|
|
int |
a_animal |
|
) |
| |
|
inline |
◆ SupplyCovPosx()
virtual int Population_Manager::SupplyCovPosx |
( |
int |
| ) |
|
|
inlinevirtual |
◆ SupplyCovPosy()
virtual int Population_Manager::SupplyCovPosy |
( |
int |
| ) |
|
|
inlinevirtual |
◆ SupplyListIndexSize()
unsigned Population_Manager::SupplyListIndexSize |
( |
| ) |
|
|
inline |
◆ SupplyListName()
const char* Population_Manager::SupplyListName |
( |
int |
i | ) |
|
|
inline |
◆ SupplyListNameLength()
int Population_Manager::SupplyListNameLength |
( |
| ) |
|
|
inline |
◆ SupplyListSize()
unsigned Population_Manager::SupplyListSize |
( |
unsigned |
listindex | ) |
|
|
inline |
◆ SupplyLocXY()
virtual void Population_Manager::SupplyLocXY |
( |
unsigned |
listindex, |
|
|
unsigned |
j, |
|
|
int & |
x, |
|
|
int & |
y |
|
) |
| |
|
inlinevirtual |
◆ SupplyPegPosx()
virtual int Population_Manager::SupplyPegPosx |
( |
int |
| ) |
|
|
inlinevirtual |
◆ SupplyPegPosy()
virtual int Population_Manager::SupplyPegPosy |
( |
int |
| ) |
|
|
inlinevirtual |
◆ SupplySimH()
int Population_Manager::SupplySimH |
( |
| ) |
|
|
inline |
◆ SupplySimW()
int Population_Manager::SupplySimW |
( |
| ) |
|
|
inline |
◆ SupplyState()
int Population_Manager::SupplyState |
( |
unsigned |
listindex, |
|
|
unsigned |
j |
|
) |
| |
|
inline |
◆ SupplyStateNames()
const char* Population_Manager::SupplyStateNames |
( |
int |
i | ) |
|
|
inline |
◆ SupplyStateNamesLength()
unsigned Population_Manager::SupplyStateNamesLength |
( |
| ) |
|
|
inline |
◆ SupplyStepSize()
int Population_Manager::SupplyStepSize |
( |
| ) |
|
|
inline |
◆ TheAOROutputProbe()
void Population_Manager::TheAOROutputProbe |
( |
| ) |
|
|
virtual |
◆ TheBreedingFemalesProbe()
virtual int Population_Manager::TheBreedingFemalesProbe |
( |
int |
| ) |
|
|
inlinevirtual |
◆ TheBreedingSuccessProbe()
virtual int Population_Manager::TheBreedingSuccessProbe |
( |
int & |
, |
|
|
int & |
, |
|
|
int & |
, |
|
|
int & |
, |
|
|
int & |
, |
|
|
int & |
|
|
) |
| |
|
inlinevirtual |
◆ TheFledgelingProbe()
virtual int Population_Manager::TheFledgelingProbe |
( |
| ) |
|
|
inlinevirtual |
◆ TheGeneticProbe()
virtual void Population_Manager::TheGeneticProbe |
( |
unsigned |
, |
|
|
int |
, |
|
|
unsigned & |
|
|
) |
| |
|
inlinevirtual |
◆ TheReallyBigOutputProbe()
void Population_Manager::TheReallyBigOutputProbe |
( |
| ) |
|
|
virtual |
◆ TheRipleysOutputProbe()
void Population_Manager::TheRipleysOutputProbe |
( |
FILE * |
a_prb | ) |
|
|
virtual |
◆ AOROutputPrb
ofstream* Population_Manager::AOROutputPrb |
|
protected |
◆ BeforeStepActions
unsigned Population_Manager::BeforeStepActions[12] |
|
protected |
◆ IndexArrayX
int Population_Manager::IndexArrayX[5][10000] |
◆ lamdagrid
long int Population_Manager::lamdagrid[2][257][257] |
|
protected |
◆ m_AlleleFreqsFile
FILE* Population_Manager::m_AlleleFreqsFile |
|
protected |
◆ m_AOR_Probe
AOR_Probe* Population_Manager::m_AOR_Probe |
|
protected |
◆ m_catastrophestartyear
int Population_Manager::m_catastrophestartyear |
|
protected |
◆ m_EasyPopRes
FILE* Population_Manager::m_EasyPopRes |
|
protected |
◆ m_GeneticsFile
FILE* Population_Manager::m_GeneticsFile |
|
protected |
◆ m_ListNameLength
unsigned Population_Manager::m_ListNameLength |
|
protected |
◆ m_ListNames
const char* Population_Manager::m_ListNames[32] |
|
protected |
◆ m_LiveArraySize
vector<unsigned> Population_Manager::m_LiveArraySize |
|
protected |
◆ m_NoProbes
int Population_Manager::m_NoProbes |
|
protected |
◆ m_population_type
◆ m_SeasonNumber
int Population_Manager::m_SeasonNumber |
|
protected |
◆ m_SimulationName
char Population_Manager::m_SimulationName[255] |
◆ m_StepSize
int Population_Manager::m_StepSize |
|
protected |
◆ m_TheLandscape
Landscape* Population_Manager::m_TheLandscape |
Definition at line 515 of file populationmanager.h.
Referenced by Rabbit_Population_Manager::AssessPctForage(), Rabbit_Population_Manager::AssignStaticVariables(), Rabbit_Population_Manager::CheckForRabbitBreedingConditions(), Rabbit_Population_Manager::ClassifyHabitat(), Rabbit_Population_Manager::DoFirst(), Rabbit_Population_Manager::DoLast(), Rabbit_Population_Manager::LoadWarrenLocations(), Rabbit_Population_Manager::NatalDispersalRecordOutput(), Rabbit_Population_Manager::PesticideDeathRecordOutput(), Rabbit_Population_Manager::PreProcessWarrenLocations(), Rabbit_Population_Manager::Rabbit_Population_Manager(), Rabbit_Population_Manager::ReproOutputRecordOutput(), Rabbit_Population_Manager::WarrenLegalPos(), and Rabbit_Population_Manager::WarrenOccupancyRecordOutput().
◆ ProbesSet
bool Population_Manager::ProbesSet |
◆ ReallyBigOutputPrb
FILE* Population_Manager::ReallyBigOutputPrb |
|
protected |
◆ RipleysOutputPrb
FILE* Population_Manager::RipleysOutputPrb |
|
protected |
◆ RipleysOutputPrb1
FILE* Population_Manager::RipleysOutputPrb1 |
|
protected |
◆ RipleysOutputPrb10
FILE* Population_Manager::RipleysOutputPrb10 |
|
protected |
◆ RipleysOutputPrb11
FILE* Population_Manager::RipleysOutputPrb11 |
|
protected |
◆ RipleysOutputPrb12
FILE* Population_Manager::RipleysOutputPrb12 |
|
protected |
◆ RipleysOutputPrb2
FILE* Population_Manager::RipleysOutputPrb2 |
|
protected |
◆ RipleysOutputPrb3
FILE* Population_Manager::RipleysOutputPrb3 |
|
protected |
◆ RipleysOutputPrb4
FILE* Population_Manager::RipleysOutputPrb4 |
|
protected |
◆ RipleysOutputPrb5
FILE* Population_Manager::RipleysOutputPrb5 |
|
protected |
◆ RipleysOutputPrb6
FILE* Population_Manager::RipleysOutputPrb6 |
|
protected |
◆ RipleysOutputPrb7
FILE* Population_Manager::RipleysOutputPrb7 |
|
protected |
◆ RipleysOutputPrb8
FILE* Population_Manager::RipleysOutputPrb8 |
|
protected |
◆ RipleysOutputPrb9
FILE* Population_Manager::RipleysOutputPrb9 |
|
protected |
◆ SimH
int Population_Manager::SimH |
◆ SimHH
unsigned Population_Manager::SimHH |
◆ SimW
int Population_Manager::SimW |
◆ SimWH
unsigned Population_Manager::SimWH |
◆ StateNames
const char* Population_Manager::StateNames[100] |
|
protected |
◆ StateNamesLength
unsigned Population_Manager::StateNamesLength |
|
protected |
◆ TestFile
FILE* Population_Manager::TestFile |
|
protected |
◆ TestFile2
FILE* Population_Manager::TestFile2 |
|
protected |
◆ TheArray
Definition at line 534 of file populationmanager.h.
Referenced by Rabbit_Population_Manager::CreateLocalWarrenNetworkLists(), Rabbit_Population_Manager::CreateObjects(), Rabbit_Population_Manager::DoFirst(), Rabbit_Population_Manager::FindClosestWarren(), IsLast(), Rabbit_Population_Manager::PreProcessWarrenLocations(), Rabbit_Population_Manager::SaveWarrenLocations(), Rabbit_Population_Manager::SupplyAllBigRabbits(), SupplyAnimalPtr(), SupplyListIndexSize(), SupplyListSize(), SupplyLocXY(), SupplyState(), Rabbit_Population_Manager::WarrenLegalPos(), Rabbit_Population_Manager::WarrenOccupancyRecordOutput(), and Rabbit_Population_Manager::~Rabbit_Population_Manager().
◆ TheProbe
The documentation for this class was generated from the following files:
static CfgInt cfg_RipleysOutput_interval("G_RIPLEYSOUTPUT_INTERVAL", CFG_CUSTOM, 1)
CfgBool cfg_RipleysOutput_used("G_RIPLEYSOUTPUT_USED", CFG_CUSTOM, false)
TTypesOfVegetation TranslateVegTypes(int VegReference)
int m_catastrophestartyear
void CloseTheMonthlyRipleysOutputProbe()
void Shuffle_or_Sort(unsigned Type)
vector< TListOfAnimals > TheArray
unsigned StateNamesLength
TTypesOfPopulation m_population_type
virtual float Probe(int ListIndex, probe_data *p_TheProbe)
static CfgInt cfg_ReallyBigOutput_day1("G_REALLYBIGOUTPUT_DAY_ONE", CFG_CUSTOM, 1)
virtual void TheRipleysOutputProbe(FILE *a_prb)
FILE * ReallyBigOutputPrb
Function to compare to TAnimal's m_CurrentStateNo to anything but -1.
probe_data * TheProbe[100]
static CfgInt cfg_RipleysOutputFirstYear("G_RIPLEYSOUTPUT_FIRSTYEAR", CFG_CUSTOM, 1)
static CfgInt cfg_AOROutput_interval("G_AORSOUTPUT_INTERVAL", CFG_CUSTOM, 1)
virtual void BreedingSuccessProbeOutput(double, int, int, int, int, int, int, int)
virtual void CloseTheRipleysOutputProbe()
unsigned GetLiveArraySize(int a_listindex)
Gets the number of 'live' objects for a list index in the TheArray.
Function to compare to TAnimal's m_Location_y.
int IndexArrayX[5][10000]
void SortXIndex(unsigned Type)
void ImpactProbeReport(int a_Time)
class MapErrorMsg * g_msg
static CfgInt cfg_DayInMonth("PRB_DAYINMONTH", CFG_CUSTOM, 1)
unsigned m_ReportInterval
void FileOutput(int No, int time, int ProbeNo)
TTypesOfLandscapeElement m_RefEle[25]
static CfgInt cfg_AOROutput_day("G_AOROUTPUT_DAY", CFG_CUSTOM, 60)
static CfgInt cfg_ReallyBigOutput_interval("G_REALLYBIGOUTPUT_INTERVAL", CFG_CUSTOM, 1)
static CfgInt cfg_ReallyBigOutput_day2("G_REALLYBIGOUTPUT_DAY_TWO", CFG_CUSTOM, 91)
int SupplyDayInMonth(void)
TTypesOfVegetation m_RefVeg[25]
int SupplySimAreaHeight(void)
int SupplySimAreaWidth(void)
TTypesOfLandscapeElement TranslateEleTypes(int EleReference)
virtual void TheReallyBigOutputProbe()
FILE * RipleysOutputPrb10
static CfgInt cfg_ReallyBigOutput_day3("G_REALLYBIGOUTPUT_DAY_THREE", CFG_CUSTOM, 182)
unsigned SupplyListIndexSize()
The base class for all ALMaSS animal classes.
int m_SeasonNumber
Holds the season number. Used when running goose and hunter sims.
Function to compare to TAnimal's m_Location_x.
A class defining an animals position.
unsigned BeforeStepActions[12]
virtual void ImpactedProbe()
void Warn(MapErrorState a_level, std::string a_msg1, std::string a_msg2)
CfgBool cfg_RipleysOutputMonthly_used("G_RIPLEYSOUTPUTMONTHLY_USED", CFG_CUSTOM, false)
int SupplyDayInYear(void)
FILE * RipleysOutputPrb11
CfgBool cfg_ReallyBigOutput_used("G_REALLYBIGOUTPUT_USED", CFG_CUSTOM, false)
long int lamdagrid[2][257][257]
int SupplyYearNumber(void)
static CfgStr cfg_ReallyBigOutput_filename("G_REALLYBIGOUTPUT_FILENAME", CFG_CUSTOM, "ReallyBigOutput.txt")
virtual int TheFledgelingProbe()
static CfgInt cfg_ReallyBigOutput_day4("G_REALLYBIGOUTPUT_DAY_FOUR", CFG_CUSTOM, 274)
TTypesOfLandscapeElement m_EleType
const char * StateNames[100]
virtual int TheBreedingSuccessProbe(int &, int &, int &, int &, int &, int &)
Landscape * m_TheLandscape
static CfgStr cfg_RipleysOutput_filename("G_RIPLEYSOUTPUT_FILENAME", CFG_CUSTOM, "RipleysOutput.txt")
virtual void FledgelingProbeOutput(int, int)
char * ProbeReport(int a_time)
static CfgInt cfg_RipleysOutput_day("G_RIPLEYSOUTPUT_DAY", CFG_CUSTOM, 60)
bool OpenTheMonthlyRipleysOutputProbe()
FILE * RipleysOutputPrb12
static CfgInt cfg_ReallyBigOutputFirstYear("G_REALLYBIGOUTPUT_FIRSTYEAR", CFG_CUSTOM, 1)
vector< TAnimal * > TListOfAnimals
virtual void BreedingPairsOutput(int)
unsigned m_ListNameLength
The base class for all farm types.
void SortX(unsigned Type)
Function to compare to TAnimal's Current behavioural state.
unsigned PartitionLiveDead(unsigned Type)
virtual bool StepFinished()
Overrides the population manager StepFinished - there is no chance that hunters do not finish a step ...
CfgInt cfg_CatastropheEventStartYear("PM_CATASTROPHEEVENTSTARTYEAR", CFG_CUSTOM, 99999)
virtual void DoAlmostLast()
virtual void CloseTheReallyBigOutputProbe()
void Shuffle(unsigned Type)
Function to compare to TAnimal's m_CurrentStateNo.
void OpenTheAOROutputProbe(string a_AORFilename)
const char * m_ListNames[32]
void Warn(std::string a_msg1, std::string a_msg2)
virtual void TheAOROutputProbe()
boost::variate_generator< base_generator_type &, boost::uniform_real<> > g_rand_uni
void SortY(unsigned Type)
vector< unsigned > m_LiveArraySize
CfgBool cfg_AOROutput_used("G_AOROUTPUT_USED", CFG_CUSTOM, false)
virtual void Catastrophe()
static CfgInt cfg_AOROutputFirstYear("G_AOROUTPUT_FIRSTYEAR", CFG_CUSTOM, 1)
TTypesOfVegetation m_VegType