Goose Management Model ODdox
1.02
|
Go to the documentation of this file.
40 #include "../Landscape/ls.h"
41 #include "../BatchALMaSS/PopulationManager.h"
42 #include "../BatchALMaSS/AOR_Probe.h"
43 #include "../GooseManagement/GooseMemoryMap.h"
44 #include "../GooseManagement/Goose_Base.h"
45 #include "../BatchALMaSS/CurveClasses.h"
46 #include "../Hunters/Hunters_all.h"
47 #include "../GooseManagement/Goose_Population_Manager.h"
52 #include "../BatchALMaSS/BoostRandomGenerators.h"
53 #include <boost/io/ios_state.hpp>
56 extern boost::variate_generator<base_generator_type &, boost::uniform_real<>>
g_rand_uni;
58 extern boost::variate_generator<base_generator_type &, boost::uniform_int<>>
g_rand_uni2;
439 int a_area,
double a_graindensity,
double a_maizedensity,
double *a_grazing,
453 for (
int i = 0; i < gs_foobar; i++)
474 g_land->
Warn(
"GooseActiveForageLocation::ClearBirds() - still birds on field",
"");
501 for (
unsigned i = 1; i<
m_roosts[a_type].size(); i++)
560 m_ListNames[0] =
"Pinkfoot Family";
561 m_ListNames[1] =
"Pinkfoot Nonbreeder";
562 m_ListNames[2] =
"Barnacle Family";
563 m_ListNames[3] =
"Barnacle Nonbreeder";
564 m_ListNames[4] =
"Greylag Family";
565 m_ListNames[5] =
"Greylag Nonbreeder";
566 m_ListNameLength = 6;
567 m_population_type = TOP_Goose;
569 for (
unsigned i=0; i<(10-m_ListNameLength); i++)
573 strcpy( m_SimulationName,
"Goose Simulation" );
577 BeforeStepActions[0]=5;
578 BeforeStepActions[1]=5;
579 BeforeStepActions[2]=5;
580 BeforeStepActions[3]=5;
581 BeforeStepActions[4]=5;
586 ifstream ifile(
"GooseRoosts.txt");
587 if (!ifile.is_open())
589 m_TheLandscape->Warn(
"Goose_Population_Manager::Goose_Population_Manager(Landscape* L) ",
"GooseRoosts.txt missing");
595 for (
unsigned i = 0; i < gs_foobar; i++)
m_roosts.push_back(r);
596 for (
int i=0; i< no_entries; i++)
600 ifile >> type >> ap.m_x >> ap.m_y;
608 ifstream jfile(
"PfYoungDist.txt" );
609 if (!jfile.is_open()) {
610 m_TheLandscape->Warn(
"Goose_Population_Manager::Goose_Population_Manager(Landscape* L) ",
"PfYoungDist.txt missing" );
615 for (
int i = 0; i< no_entries; i++) {
662 Mersenne_Twister twister;
676 OpenTheReallyBigProbe();
678 else ReallyBigOutputPrb = 0;
680 m_AOR_Pinkfeet =
new AOR_Probe_Goose(
this, m_TheLandscape,
"AOR_pinkfoot.txt");
681 m_AOR_Barnacles =
new AOR_Probe_Goose(
this, m_TheLandscape,
"AOR_barnacle.txt");
682 m_AOR_Greylags =
new AOR_Probe_Goose(
this, m_TheLandscape,
"AOR_greylag.txt");
685 std::vector<std::string> xy_headers;
686 xy_headers = {
"X",
"Y",
"poly_ref",
"fl_x",
"fl_y",
"fl_poly" };
690 std::vector<std::string> pd_headers;
691 pd_headers = {
"season",
"day",
"pf_families",
"pf_non_breeders",
"bn_families",
692 "bn_non_breeders",
"gl_families",
"gl_non_breeders",
"snow_depth" };
696 std::vector<std::string> ws_headers = {
"season",
"day",
"day_in_year",
"species",
"mean_weight",
"mean_weight_se",
"n" };
700 std::vector<std::string> ilc_headers = {
"season",
"day",
"day_in_year",
"species",
701 "n_forage_locs",
"n_forage_locs_se",
"n" };
705 std::vector<std::string> ghu_headers = {
"season",
"day",
"day_in_year",
"species" };
709 ghu_headers.push_back(str1);
711 ghu_headers.push_back(
"count");
716 std::vector<std::string> ghufo_headers = {
"season",
"day",
"day_in_year",
"species" };
720 ghufo_headers.push_back(str1);
722 ghufo_headers.push_back(
"count");
727 std::vector<std::string> lr_headers = {
"season",
"day",
"day_in_year",
"species_type",
"leave_reason",
"n" };
731 std::vector<std::string> ss_headers = {
"season",
"day",
"n" };
735 std::vector<std::string> ed_headers;
736 ed_headers = {
"season",
"day",
"species",
"foraging_time",
"foraging_time_se",
737 "flight_distance",
"flight_distance_se",
"daily_energy_budget",
738 "daily_energy_budget_se",
"daily_energy_balance",
739 "daily_energy_balance_se",
"day_length" };
745 std::vector<std::string> fd_headers;
752 "roost_dist_pinkfoot",
755 "roost_dist_barnacle",
758 "roost_dist_greylag",
765 std::vector<std::string> fd_headers;
766 fd_headers = {
"season",
"day",
"polyref",
"utm_x",
"utm_y",
"geese",
767 "geese_timed",
"openness",
"pinkfoot",
"pinkfoot_timed",
768 "roost_dist_pinkfoot",
"grass_pinkfoot",
"barnacle",
769 "barnacle_timed",
"roost_dist_barnacle",
"grass_barnacle",
770 "greylag",
"greylag_timed",
"roost_dist_greylag",
"grass_greylag",
771 "grain",
"maize",
"veg_type_chr",
"veg_height",
"digestability",
772 "veg_phase",
"previous_crop",
"last_sown_veg" };
786 (*m_GooseGitVersionFile) <<
"hash=" << GIT_HASH << std::endl;
787 (*m_GooseGitVersionFile) <<
"time=" << COMPILE_TIME << std::endl;
788 (*m_GooseGitVersionFile) <<
"branch=" << GIT_BRANCH << std::endl;
798 ofstream ofile(
"GooseObservedOpenness.txt", ios::out);
799 ofile <<
"Polyref" <<
'\t' <<
"Openness" <<
'\t' <<
"ElementType" <<
'\t'<<
"CentroidX" <<
'\t' <<
"CentroidY" << endl;
801 ifstream ifile(
"GooseObservations.txt" );
802 if (!ifile.is_open())
804 m_TheLandscape->Warn(
"Goose_Population_Manager::Goose_Population_Manager(Landscape* L) ",
"GooseObservations.txt missing" );
811 for (
int i = 0; i < no_entries; i++)
822 thetype = m_TheLandscape->PolytypeToString(m_TheLandscape->SupplyElementType(x, y));
823 centroidx = m_TheLandscape->SupplyCentroidX(x, y);
824 centroidy = m_TheLandscape->SupplyCentroidY(x, y);
825 thepolyref = m_TheLandscape->SupplyPolyRef( x, y );
826 theopenness = m_TheLandscape->SupplyOpenness( x, y );
829 ofile << thepolyref <<
'\t' << theopenness <<
'\t' << thetype <<
'\t' << centroidx <<
'\t' << centroidy << endl;
840 ofstream ofile(
"GooseConfig.txt", ios::out);
841 boost::io::ios_flags_saver ifs( ofile );
843 ofile <<
"Variable" <<
'\t' <<
"Value" << endl;
900 for (
int i = 0; i<a_number; i++)
906 if (
unsigned(TheArray[a_ob_type].size())>GetLiveArraySize(a_ob_type)) {
908 new_PFFamilyGoose = dynamic_cast<Goose_Pinkfoot_FamilyGroup*>(TheArray[a_ob_type][GetLiveArraySize(a_ob_type)]);
910 IncLiveArraySize(a_ob_type);
914 TheArray[a_ob_type].push_back(new_PFFamilyGoose);
915 IncLiveArraySize(a_ob_type);
920 if (
unsigned(TheArray[a_ob_type].size())>GetLiveArraySize(a_ob_type)) {
922 new_PFNonbreederGoose = dynamic_cast<Goose_Pinkfoot_NonBreeder*>(TheArray[a_ob_type][GetLiveArraySize(a_ob_type)]);
924 IncLiveArraySize(a_ob_type);
928 TheArray[a_ob_type].push_back(new_PFNonbreederGoose);
929 IncLiveArraySize(a_ob_type);
934 if (
unsigned(TheArray[a_ob_type].size())>GetLiveArraySize(a_ob_type)) {
936 new_BFamilyGoose = dynamic_cast<Goose_Barnacle_FamilyGroup*>(TheArray[a_ob_type][GetLiveArraySize(a_ob_type)]);
938 IncLiveArraySize(a_ob_type);
942 TheArray[a_ob_type].push_back(new_BFamilyGoose);
943 IncLiveArraySize(a_ob_type);
948 if (
unsigned(TheArray[a_ob_type].size())>GetLiveArraySize(a_ob_type)) {
950 new_BNonbreederGoose = dynamic_cast<Goose_Barnacle_NonBreeder*>(TheArray[a_ob_type][GetLiveArraySize(a_ob_type)]);
952 IncLiveArraySize(a_ob_type);
956 TheArray[a_ob_type].push_back(new_BNonbreederGoose);
957 IncLiveArraySize(a_ob_type);
962 if (
unsigned(TheArray[a_ob_type].size())>GetLiveArraySize(a_ob_type)) {
964 new_GNonbreederGoose = dynamic_cast<Goose_Greylag_NonBreeder*>(TheArray[a_ob_type][GetLiveArraySize(a_ob_type)]);
966 IncLiveArraySize(a_ob_type);
970 TheArray[a_ob_type].push_back(new_GNonbreederGoose);
971 IncLiveArraySize(a_ob_type);
976 if (
unsigned(TheArray[a_ob_type].size())>GetLiveArraySize(a_ob_type)) {
978 new_GFamilyGoose = dynamic_cast<Goose_Greylag_FamilyGroup*>(TheArray[a_ob_type][GetLiveArraySize(a_ob_type)]);
980 IncLiveArraySize(a_ob_type);
984 TheArray[a_ob_type].push_back(new_GFamilyGoose);
985 IncLiveArraySize(a_ob_type);
990 sprintf(ob,
"%d", (
int)a_ob_type);
991 m_TheLandscape->Warn(
"Goose_Population_Manager::CreateObjects() unknown object type - ", ob);
1006 for (
unsigned i=1; i<
m_roosts[a_type].size(); i++)
1011 if (di<dist) answer = i;
1013 a_x =
m_roosts[a_type][answer].m_x;
1014 a_y =
m_roosts[a_type][answer].m_y;
1029 int dlt = m_TheLandscape->SupplyDaylength();
1044 double temp = m_TheLandscape->SupplyTemp();
1064 int today = m_TheLandscape->SupplyDayInYear();
1080 m_TheLandscape->ResetGrainAndMaize();
1102 int daylength = m_TheLandscape->SupplyDaylength();
1105 rectime -= rectime % 10;
1108 for (
int i = 0; i < sz; i++) {
1111 m_TheLandscape->RecordGooseNumbersTimed(pref, goose_numbers);
1112 for (
unsigned j = 0; j < gs_foobar; j++) {
1114 m_TheLandscape->RecordGooseSpNumbersTimed(pref, goose_numbers_timed, (GooseSpecies)j);
1116 m_TheLandscape->RecordGooseRoostDist(pref, roost_dist, (GooseSpecies)j);
1120 int day = m_TheLandscape->SupplyDayInYear();
1124 rectime -= rectime % 10;
1132 day = m_TheLandscape->SupplyDayInYear();
1133 if (day == 183) m_SeasonNumber++;
1136 for (
int i = 0; i < sz; i++) {
1138 for (
unsigned j = 0; j < gs_foobar; j++) {
1147 anygeese = (int) GetLiveArraySize( i );
1164 if ((day + 1) % 7 == 0)
1188 for (
int i = 0; i < sz; i++) {
1190 double poly_grain = m_TheLandscape->SupplyBirdSeedForage( TheForageLocationPolyref );
1191 if (poly_grain > 0) {
1194 double poly_maize = m_TheLandscape->SupplyBirdMaizeForage( TheForageLocationPolyref );
1195 if (poly_maize > 0) {
1199 m_TheLandscape->GrazeVegetationTotal( TheForageLocationPolyref,
m_GooseForageLocations[ i ].GetGrazedBiomass() );
1211 int sz = int(GetLiveArraySize(i));
1212 for (
int j = 0; j < sz; j++)
1215 gb = (dynamic_cast<Goose_Base*>(TheArray[i][j]));
1246 for (
int i = 0; i < gs_foobar; ++i)
1259 (*m_GooseHabitatUseFile)
1260 << m_SeasonNumber <<
'\t'
1261 << m_TheLandscape->SupplyGlobalDate() <<
'\t'
1262 << m_TheLandscape->SupplyDayInYear() <<
'\t'
1265 (*m_GooseHabitatUseFile) << pct[h] <<
'\t';
1267 (*m_GooseHabitatUseFile) << count << endl;
1275 for (
int i = 0; i < gs_foobar; ++i)
1288 (*m_GooseHabitatUseFieldObsFile)
1289 << m_SeasonNumber <<
'\t'
1290 << m_TheLandscape->SupplyGlobalDate() <<
'\t'
1291 << m_TheLandscape->SupplyDayInYear() <<
'\t'
1294 (*m_GooseHabitatUseFieldObsFile) << pct[h] <<
'\t';
1296 (*m_GooseHabitatUseFieldObsFile) << count << endl;
1308 int Day = m_TheLandscape->SupplyGlobalDate();
1311 unsigned sz = (unsigned) afieldlist->size();
1314 for (
unsigned f = 0; f < sz; f++)
1317 if ((*afieldlist)[f].geese > 0) {
1318 (*m_GooseFieldForageDataFile)
1319 << m_SeasonNumber <<
'\t'
1321 << (*afieldlist)[f].geese <<
'\t';
1322 for (
int i = 0; i < gs_foobar; ++i)
1324 (*m_GooseFieldForageDataFile)
1325 << (*afieldlist)[f].geesesp[i] <<
'\t'
1326 << (*afieldlist)[f].geesespTimed[i] <<
'\t'
1327 << (*afieldlist)[f].roostdists[i] <<
'\t';
1329 (*m_GooseFieldForageDataFile) << (*afieldlist)[f].polyref << endl;
1334 for (
unsigned f = 0; f < sz; f++)
1336 int pref = (*afieldlist)[f].polyref;
1337 int utm_x = 484378 + m_TheLandscape->SupplyCentroidX(pref);
1338 int utm_y = 6335161 - m_TheLandscape-> SupplyCentroidY(pref);
1339 (*m_GooseFieldForageDataFile)
1340 << m_SeasonNumber <<
'\t'
1345 << (*afieldlist)[f].geese <<
'\t'
1346 << (*afieldlist)[f].geeseTimed <<
'\t'
1347 << (*afieldlist)[f].openness <<
'\t';
1348 for (
int i = 0; i < gs_foobar; ++i)
1350 (*m_GooseFieldForageDataFile)
1351 << (*afieldlist)[f].geesesp[i] <<
'\t'
1352 << (*afieldlist)[f].geesespTimed[i] <<
'\t'
1353 << (*afieldlist)[f].roostdists[i] <<
'\t'
1354 << (*afieldlist)[f].grass[i] <<
'\t';
1356 (*m_GooseFieldForageDataFile)
1357 << (*afieldlist)[f].grain <<
'\t'
1358 << (*afieldlist)[f].maize <<
'\t'
1359 << (*afieldlist)[f].vegtypechr <<
'\t'
1360 << (*afieldlist)[f].vegheight <<
'\t'
1361 << (*afieldlist)[f].digestability <<
'\t'
1362 << (*afieldlist)[f].vegphase <<
'\t'
1363 << (*afieldlist)[f].previouscrop <<
'\t'
1364 << (*afieldlist)[f].lastsownveg << endl;
1373 int day = m_TheLandscape->SupplyGlobalDate();
1374 int day_length = m_TheLandscape->SupplyDaylength();
1375 for (
int i = 0; i < gs_foobar; ++i)
1378 (*m_GooseEnergeticsDataFile)
1379 << m_SeasonNumber <<
'\t'
1390 << day_length << endl;
1397 for (
int i = 0; i < gs_foobar; ++i)
1400 (*m_GooseWeightStatsFile)
1401 << m_SeasonNumber <<
'\t'
1402 << m_TheLandscape->SupplyGlobalDate() <<
'\t'
1403 << m_TheLandscape->SupplyDayInYear() <<
'\t'
1414 for (
int i = 0; i < gs_foobar; ++i)
1417 (*m_GooseIndLocCountFile)
1418 << m_SeasonNumber <<
'\t'
1419 << m_TheLandscape->SupplyGlobalDate() <<
'\t'
1420 << m_TheLandscape->SupplyDayInYear() <<
'\t'
1431 int Day = m_TheLandscape->SupplyGlobalDate();
1432 (*m_StateStatsFile) << m_SeasonNumber <<
'\t' << Day <<
'\t' <<
m_StateStats.get_N() << endl;
1438 int day = m_TheLandscape->SupplyGlobalDate();
1439 int day_in_year = m_TheLandscape->SupplyDayInYear();
1445 (*m_GooseLeaveReasonStatsFile)
1446 << m_SeasonNumber <<
'\t'
1448 << day_in_year <<
'\t'
1465 for (
int j = 0; j<sz; j++)
1471 for (
int j = 0; j<sz; j++)
1477 for (
int j = 0; j<sz; j++)
1481 (*m_GoosePopDataFile)
1482 << m_SeasonNumber <<
'\t'
1483 << m_TheLandscape->SupplyGlobalDate() <<
'\t'
1490 << m_TheLandscape->SupplySnowDepth() << endl;
1505 for (
int i = 0; i < gs_foobar; ++i)
1512 int today = m_TheLandscape->SupplyDayInYear();
1562 gs->
m_L = m_TheLandscape;
1570 int index = random((
int)
m_roosts[gs_Pinkfoot].size());
1584 int index = random((
int)
m_roosts[gs_Pinkfoot].size());
1597 int index = random((
int)
m_roosts[gs_Barnacle].size());
1611 int index = random((
int)
m_roosts[gs_Barnacle].size());
1624 int index = random((
int)
m_roosts[gs_Greylag].size());
1638 int index = random((
int)
m_roosts[gs_Greylag].size());
1653 double emigrationchance;
1655 int today = m_TheLandscape->SupplyDayInYear();
1664 for (
int j = 0; j<sz; j++)
1669 for (
int j = 0; j<sz; j++)
1679 for (
int j = 0; j<sz; j++) {
1683 for (
int j = 0; j<sz; j++) {
1695 for (
int j = 0; j<sz; j++)
1700 for (
int j = 0; j<sz; j++)
1710 for (
int j = 0; j<sz; j++) {
1714 for (
int j = 0; j<sz; j++) {
1726 for (
int j = 0; j<sz; j++)
1731 for (
int j = 0; j<sz; j++)
1741 for (
int j = 0; j<sz; j++) {
1745 for (
int j = 0; j<sz; j++) {
1761 for (
int i=0; i< sz; i++)
1783 double grain = m_TheLandscape->SupplyBirdSeedForage( a_polyref );
1784 double maize = m_TheLandscape->SupplyBirdMaizeForage( a_polyref );
1785 double grazing[gs_foobar];
1787 for (
int g = 0; g < gs_foobar; g++)
1789 grazing[g] = m_TheLandscape->GetActualGooseGrazingForage(a_polyref, (GooseSpecies) g);
1791 GooseActiveForageLocation aFL(a_type, a_number, a_polyref, (
int) m_TheLandscape->SupplyPolygonArea(a_polyref), grain, maize, grazing,
this);
1794 int x = m_TheLandscape->SupplyCentroidX(a_polyref);
1795 int y = m_TheLandscape->SupplyCentroidY(a_polyref);
1796 for (
int i = 0; i < gs_foobar; i++) {
1798 aFL.SetDistToClosestRoost(i, dist);
1839 if (index == -1)
return 0;
1855 g_msg->
Warn(
"Goose_Population_Manager::BirdsToShootAtPoly 0 or less then 0 geese to shoot.", geese);
1875 g_msg->
Warn(
"Goose_Population_Manager::BirdsShot - No birds at this location to shoot. Tried to kill ", a_numbershot);
1879 if (birds < 1)
return;
1883 while (a_numbershot > 0)
1893 g_msg->
Warn(
"Goose_Population_Manager::BirdsShot() - in while() - where are those damn birds?. Tried to kill ", a_numbershot);
1894 g_msg->
Warn(
"Goose_Population_Manager::BirdsShot() - in while() - there where supposed to this many of them:", birds);
1895 g_msg->
Warn(
"Goose_Population_Manager::BirdsShot() - in while() - consisting of pinkfoot familygroups:", pffg);
1896 g_msg->
Warn(
"Goose_Population_Manager::BirdsShot() - in while() - consisting of pinkfoot nonbreeders:", pfnb);
1897 g_msg->
Warn(
"Goose_Population_Manager::BirdsShot() - in while() - consisting of greylag familygroups:", glfg);
1898 g_msg->
Warn(
"Goose_Population_Manager::BirdsShot() - in while() - consisting of greylag nonbreeders:", glnb);
1927 int sz = int(GetLiveArraySize(gst));
1928 for (
int i = 0; i < sz; i++)
1930 if (TheArray[gst][i]->SupplyPolygonRef() == a_polyref)
1932 if (TheArray[gst][i]->GetCurrentStateNo() != -1)
1935 TheArray[gst][i]->KillThis();
1957 int polyX = m_TheLandscape->SupplyCentroidX(a_polyref);
1958 int polyY = m_TheLandscape->SupplyCentroidY(a_polyref);
1960 for (
unsigned i=0; i<(m_ListNameLength); i++)
1962 unsigned sz = (unsigned) TheArray[i].size();
1963 for (
unsigned j=0; j<sz; j++)
1965 APoint ap = TheArray[i][j]->SupplyPoint();
1967 if (dist < maxscaredist)
1969 Goose_Base* gb = dynamic_cast<Goose_Base*>(TheArray[i][j]);
1970 #ifdef __LINKGOOSESCARETODISTANCE
1972 gb->
On_Bang(a_polyref, 1.0-(
double) (dist/maxscaredist));
1997 int base = (int)a_species * 2;
1998 int base1 = 1 + ((int)a_species * 2);
1999 switch (a_species) {
2013 int total = sz1 + sz2;
2014 int start = random(total);
2015 for (
int g = 0; g < total; g++)
2021 GBp = dynamic_cast<Goose_Base*>(TheArray[base][index]);
2027 index =
start - sz1;
2028 GBp = dynamic_cast<Goose_Base*>(TheArray[base1][index]);
2040 int forageindex = -1;
2041 std::vector<int> fields;
2044 for (
int i = 0; i < sz; i++) {
2048 fields.push_back( index );
2051 if (fields.size() != 0) {
2053 int answer = random(
int(fields.size()));
2054 int max_dist = 43266;
2056 for (
int i = 0; i<fields.size(); i++) {
2057 fx = m_TheLandscape->SupplyCentroidX( fields[ i ] );
2058 fy = m_TheLandscape->SupplyCentroidY( fields[ i ] );
2065 int polyref = fields[ answer ];
2074 switch (a_maxintakesource) {
2082 Graze( forage, m_myForageIndex );
2085 m_TheLandscape->Warn(
"Goose_Population_Manager::RemoveMaxForageKj",
" - Somebody visited the foobar. Not allowed!" );
2094 if (a_goose == gs_Pinkfoot && fall)
2098 int pffam = (int)floor(pfyoung / 4);
2099 int pfnb = pfnum - (pffam + pfyoung);
2104 if (a_goose == gs_Pinkfoot && !fall)
2108 int pffam = (int)floor(pfyoung / 4);
2109 int pfnb = pfnum - (pffam + pfyoung);
2116 if (a_goose == gs_Barnacle && fall)
2120 int bnfam = (int)floor(bnyoung / 4);
2121 int bnnb = bnnum - (bnfam + bnyoung);
2126 if (a_goose == gs_Barnacle && !fall)
2130 int bnfam = (int)floor(bnyoung / 4);
2131 int bnnb = bnnum - (bnfam + bnyoung);
2138 if (a_goose == gs_Greylag && fall)
2142 int glfam = (int)floor(glyoung / 4);
2143 int glnb = glnum - (glfam + glyoung);
2148 if (a_goose == gs_Greylag && !fall)
2152 int glfam = (int)floor(glyoung / 4);
2153 int glnb = glnum - (glfam + glyoung);
2170 for (
unsigned i = 0; i < gs_foobar; i++)
2210 for (
unsigned i = 0; i < gs_foobar; i++)
2224 for (
unsigned i = 0; i < gs_foobar; i++)
2238 for (
unsigned i = 0; i < gs_foobar; i++)
2252 for (
unsigned i = 0; i < gs_foobar; i++)
2265 for (
unsigned i = 0; i < gs_foobar; i++)
2300 if (GetSeasonNumber() == 0) {
2304 if (a_species == gs_Pinkfoot)
2308 if (pfstart > pfend) {
2309 if (a_day < pfstart && a_day > pfend)
return false;
2316 if (a_day < pfstart || a_day > pfend) {
2324 else if (a_species == gs_Greylag)
2328 if (glstart > glend) {
2329 if (a_day < glstart && a_day > glend)
return false;
2336 if (a_day < glstart || a_day > glend) {
2346 g_msg->
Warn(
WARN_FILE,
"Goose_Population_Manager::InHuntingSeason: ""Species error",
"");
2354 for (
int i = 0; i < a_headers.size(); ++i)
2356 if (i <= a_headers.size() - 2)
2358 (*a_file) << a_headers[i];
2363 (*a_file) << a_headers[i];
2389 int x, y, poly, index, gaflx, gafly, gaflpoly;
2393 for (
int j = 0; j<total; j++)
2396 for (
int k = 0; k < group_size; k++)
2400 poly = m_TheLandscape->SupplyPolyRef(x, y);
2405 gaflx = m_TheLandscape->SupplyCentroidX(gaflpoly);
2406 gafly = m_TheLandscape->SupplyCentroidY(gaflpoly);
2413 (*m_GooseXYDumpFile) << x <<
'\t' << y <<
'\t' << poly <<
'\t' <<
2414 gaflx <<
'\t' << gafly <<
'\t' << gaflpoly << endl;
2420 for (
int j = 0; j<total; j++)
2424 poly = m_TheLandscape->SupplyPolyRef(x, y);
2429 gaflx = m_TheLandscape->SupplyCentroidX(gaflpoly);
2430 gafly = m_TheLandscape->SupplyCentroidY(gaflpoly);
2437 (*m_GooseXYDumpFile) << x <<
'\t' << y <<
'\t' << poly <<
'\t' <<
2438 gaflx <<
'\t' << gafly <<
'\t' << gaflpoly << endl;
2447 return "pinkfoot_family";
2449 return "pinkfoot_nonbreeder";
2451 return "barnacle_family";
2453 return "barnacle_nonbreeder";
2455 return "greylag_family";
2457 return "greylag_nonbreeder";
2459 return "gst_foobar";
2480 switch (a_intake_source)
2485 return "winter_cereal";
2491 return "tomis_foobar";
2497 switch (a_leave_reason)
2502 return "body_condition";
2504 return "lean_weight";
2508 return "tolr_foobar";
CfgFloat cfg_G6B("POLYNOMIALTWO_TWO_B", CFG_CUSTOM, 2.6695)
Coefficient B in a second order polynomial function.
CfgFloat cfg_Petti1E("PETTIFOR_ONE_E", CFG_CUSTOM, 1000)
Max x-value - at this point the curve tends to 0, must stop here to avoid negative values.
double m_weight
The weight.
CfgFloat cfg_P1D("POLYNOMIALTWO_ONE_D", CFG_CUSTOM, 0.404)
Scaler for assimilation of energy from grass for pinkfeet. Madsen 1985 Vol 16 p. 222 - 228 Ornis Scan...
ofstream * m_GooseHabitatUseFieldObsFile
Pointer to an output file for goose habitat use data, field observation mimic version.
CfgFloat cfg_B6A("POLYNOMIALTWO_THREE_A", CFG_CUSTOM, -0.066)
Coefficient A in a second order polynomial function.
SimpleStatistics m_ForagingTimeStats[gs_foobar]
Statistics for the time spent foraging for the population.
CfgFloat cfg_goose_daytime_BMR_multiplier("GOOSE_DAYTIMEBMRMULTIPLIER", CFG_CUSTOM, 1.65, 1.0, 10.0)
To calculate daily energy budget. This is the multiple of BMR spent during daytime Default is based o...
CfgInt cfg_goose_ModelExitDay("GOOSE_MODELEXITDAY", CFG_CUSTOM, 9999, 1, 100000)
Input variable to control exit of the goose model The geese leave the simulation in spring,...
CfgBool cfg_H2C("HOLLINGS_TWO_C", CFG_CUSTOM, false)
Logical config to control if the curve should be reversed (i.e. 1 - value)
SimpleStatistics m_DailyEnergyBudgetStats[gs_foobar]
Statistics for the daily energy budget in the population.
Landscape * g_land
This pointer provides access the to landscape module.
static CfgInt cfg_gooseAORtime("GOOSE_AORRECORDTIME", CFG_CUSTOM, 120, 0, 12 *60)
The time in minutes (multiple of ten) from sunrise when the AOR probe is recorded for geese.
CfgBool cfg_goose_bn_fallmigrate("GOOSE_BN_FALL_MIGRATE", CFG_CUSTOM, true)
Input: Should we simulate a barnacle fall migration?
static CfgBool cfg_goose_WeightStats("GOOSE_WEIGHTSTATS", CFG_CUSTOM, false)
Should we record goose weight statistics?
CfgFloat cfg_goose_MaxEnergyReserveProportion("GOOSE_MAXENERGYRESERVEPROPORTION", CFG_CUSTOM, 0.27, 0.1, 1)
The maximum proportion of weight that can be stored as energy reserves.
ofstream * m_GoosePopDataFile
Pointer to an output file for goose population data.
void UpdateKJ()
Updates the grain or maize density based on the current total grain or maize amount.
int GetForageLocIndex(GooseSpecies a_species, int a_x, int a_y)
Get a forage location for my species (picked randomly among the active locations)
CfgBool cfg_goose_gl_springmigrate("GOOSE_GL_SPRING_MIGRATE", CFG_CUSTOM, true)
Input: Should we simulate greylag a spring migration?
static CfgInt cfg_gooseHabitatUsetime("GOOSE_HABUSERECORDTIME", CFG_CUSTOM, 120, 0, 12 *60)
The time in minutes (multiple of ten) from sunrise when the habitat use is recorded for geese.
void BangAtPoly(int a_polyref)
Passes a 'Bang' message to birds near to the location specified by the polygon reference.
std::vector< int > m_youngdist
The observed distribution of young for pink feet.
void RecordHabitatUse(int a_habitatype, GooseSpecies a_species, int a_count)
Record the habitat use.
void GoosePopulationDescriptionOutput()
Produces output to a standard file describing the state of the goose populations.
SimpleStatistics m_WeightStats[gs_foobar]
Statistics for the weights of the population.
int GetDayTime()
Get the time of day (in minutes). For the goose model, sunrise is defined as m_daytime == 0....
CfgFloat cfg_goose_pf_sexratio("GOOSE_PF_SEXRATIO", CFG_CUSTOM, 0.5, 0.0, 1.0)
The sex ratio of pinkfoot non-breeders.
bool InHuntingSeason(int a_day, GooseSpecies a_species)
Are we in the hunting season?
CfgFloat cfg_goose_grass_to_winter_cereal_scaler("GOOSE_GRASS_TO_WINTER_CEREAL_SCALER", CFG_CUSTOM, 1.0325, 0.0, 10.0)
The scaler to go from energy intake from grass forage to winter cereal The default value of 1....
int m_HabitatUseFieldObsStats[gs_foobar *tomis_foobar]
Data for the habitat use, field observation mimic version.
CfgBool cfg_H1C("HOLLINGS_ONE_C", CFG_CUSTOM, false)
Logical config to control if the curve should be reversed (i.e. 1 - value)
double m_grainKJ_total
The total grain kJ.
CfgFloat cfg_goose_bn_baseweight("GOOSE_BARNACLEWEIGHT", CFG_CUSTOM, 1708, 1500, 2000)
Lean weight of barnacle geese.
CfgInt cfg_goose_gl_leavingdatestart("GOOSE_GL_LEAVINGDATESTART", CFG_CUSTOM, 58)
Input: The initial starting date for greylags to leave the simulation area.
A class to describe the Barnacle family group.
CfgInt cfg_goose_pf_startnos("GOOSE_PF_STARTNOS", CFG_CUSTOM, 13440)
Input: Pink-footed goose start numbers.
ofstream * m_GooseWeightStatsFile
Pointer to an output file for goose weight stats data.
CfgFloat cfg_P1F("POLYNOMIALTWO_ONE_F", CFG_CUSTOM, 16.63)
Max x-value - at this point the curve tends to 0, must stop here to avoid negative values.
CfgInt cfg_goose_gl_leavingdateend("GOOSE_GL_LEAVINGDATEEND", CFG_CUSTOM, 68)
Input: The last date for greylags to leave the simulation area.
int GetHuntables(void)
Returns the number of huntable birds at the location.
Goose_Population_Manager(Landscape *L)
Goose_Population_Manager Constructor.
CfgFloat cfg_H2E("HOLLINGS_TWO_E", CFG_CUSTOM, 0)
Min x-value.
boost::variate_generator< base_generator_type &, boost::uniform_int<> > g_rand_uni2
A random number generator (0-9999)
CfgBool cfg_B6E("POLYNOMIALTWO_THREE_E", CFG_CUSTOM, false)
Logical config to control if the curve should be reversed (i.e. 1 - value)
void XYDump()
Outputs x y data.
CfgBool cfg_P1E("POLYNOMIALTWO_ONE_E", CFG_CUSTOM, false)
Logical config to control if the curve should be reversed (i.e. 1 - value)
void ReInit(Landscape *p_L, Goose_Population_Manager *p_NPM, double a_weight, bool a_sex, int a_groupsize, APoint a_roost)
ReInit for object pool.
void AddGeeseToForageLocation(GooseSpeciesType a_type, int a_index, int a_number)
Adds a goose or geese to the forage location - requires an index.
void RecordWeight(double a_weight, GooseSpecies a_species)
Record the weight.
void SetGrainDensity(double a_density)
Sets forage density (grain/m2)
static CfgBool cfg_goose_ObservedOpennessQuery("GOOSE_OBSERVEDOPENNESS", CFG_CUSTOM, false)
Should we query the map for openness scores on locations where geese have been observed in the field?
String configurator entry class.
void GooseHabitatUseOutput()
Outputs simple stats for the goose habitat use.
CfgFloat cfg_goose_pf_FieldForageDist("GOOSE_FIELDFORAGEDIST_PF", CFG_CUSTOM, 5000, 1000, 35000)
The maximum forage range when already at a forage location for pink-footed geese (m)
std::vector< APoint > roostlist
a list of goose roosts as points
CfgInt cfg_goose_bn_springmigdatestart("GOOSE_BN_SPRING_MIG_START", CFG_CUSTOM, 15, 1, 365)
Input: Date for onset of barnacle spring migration.
int GetGroupsize()
Returns the groupsize.
int m_MaxBirdsPresent[gst_foobar]
An array holding the maximum number of geese of different types and total i.e. Pinkfoot families,...
CfgFloat cfg_H1D("HOLLINGS_ONE_D", CFG_CUSTOM, 2500)
Max x-value - at this point the curve tends to 0, must stop here to avoid negative values.
CfgFloat cfg_H1A("HOLLINGS_ONE_A", CFG_CUSTOM, 0.04217666)
Attack rate in a type II functional response curve (Hollings disc equation)
ofstream * m_GooseIndLocCountFile
Pointer to an output file for goose individual forage location count data.
void SetArea(int a_area)
Set the area in m.
CfgFloat cfg_P1C("POLYNOMIALTWO_ONE_C", CFG_CUSTOM, 0.0)
The constant C in a second order polynomial function.
CfgInt cfg_goose_grain_and_maize_reset_day("GOOSE_GRAINANDMAIZERESETDAY", CFG_CUSTOM, 59, 0, 364)
The day where all grain across the landscape is reset.
CfgFloat cfg_goose_gl_fallmig_probability("GOOSE_GL_FALLMIG_PROBABILITY", CFG_CUSTOM, 0.0083, 0.0, 1.0)
Input: The greylag fall migration probability.
void Set_GooseMinForageOpenness(double a_cost)
Set the min forage openess for all geese.
Used for creation of a new Goose object.
void StateStatOutput()
Write simple stats for the states.
CfgInt cfg_goose_bn_startnos("GOOSE_BN_STARTNOS", CFG_CUSTOM, 5600)
Input: Barnacle goose start numbers.
CfgInt cfg_goose_AfterDarkTime("GOOSE_AFTERDARKTIME", CFG_CUSTOM, 30, 0, 180)
The number of minutes that geese will be foraging after sunset.
void GooseWeightStatOutput()
Outputs simple stats for the weights in the population.
virtual ~Goose_Population_Manager(void)
Goose_Population_Manager Destructor.
CfgFloat cfg_goose_pf_young_proportion("GOOSE_PF_YOUNG_PROPORTION", CFG_CUSTOM, 0.21, 0.0, 1.0)
Input: Pink-footed goose proportion of young at start.
CfgInt cfg_goose_bn_arrivedateend("GOOSE_BN_ARRIVEDATEEND", CFG_CUSTOM, 298)
Input: The last date for arrival for barnacles to the simulation area.
CfgInt cfg_goose_gl_fallmigdateend("GOOSE_GL_FALL_MIGRATION_END", CFG_CUSTOM, 334, 1, 365)
Input: Date for end of greylag fall migration.
GreylagGoose_All.h This is the header file for the greylag goose classes
CfgInt cfg_goose_bn_leavingdatestart("GOOSE_BN_LEAVINGDATESTART", CFG_CUSTOM, 90)
Input: The initial starting date for barnacles to leave the simulation area.
A class to describe the Greylag non-breeder.
void RecordDailyEnergyBudget(int a_deb, GooseSpecies a_species)
Record the daily energy budget.
CfgBool cfg_ReallyBigOutput_used
Config to control if the Ripley probe is used or not.
CfgInt cfg_goose_gl_springmigdatestart("GOOSE_GL_SPRING_MIG_START", CFG_CUSTOM, 15, 1, 365)
Input: Date for onset of greylag spring migration.
CfgFloat cfg_Petti1F("PETTIFOR_ONE_F", CFG_CUSTOM, 0)
Min x-value.
CfgInt cfg_goose_pf_springmignos("GOOSE_PF_SPRING_MIG_NOS", CFG_CUSTOM, 5600)
Input: Number of pinkfeet to immigrate in spring.
CfgInt cfg_goose_pf_leavingdateend("GOOSE_PF_LEAVINGDATEEND", CFG_CUSTOM, 104)
Input: The last date for pink-foots to leave the simulation area.
CfgFloat cfg_goose_MinForageOpenness("GOOSE_MINFORAGEOPENNESS", CFG_CUSTOM, 100.0, 10, 10000)
The minimum openness score that a goose will tolerate for foraging.
CfgInt cfg_goose_bn_leavingdateend("GOOSE_BN_LEAVINGDATEEND", CFG_CUSTOM, 134)
Input: The last date for barnacles to leave the simulation area.
void ClearGooseDailyEnergyBalanceStats()
Clear simple stats for daily energy balance in the population.
CfgFloat cfg_Petti1B("PETTIFOR_ONE_B", CFG_CUSTOM, 0.57)
Minimum feeding time.
CfgInt cfg_goose_gl_arrivedateend("GOOSE_GL_ARRIVEDATEEND", CFG_CUSTOM, 231)
Input: The last date for arrival for greylags to the simulation area.
CfgInt cfg_goose_gl_arrivedatestart("GOOSE_GL_ARRIVEDATESTART", CFG_CUSTOM, 212)
Input: The initial starting date for arrival for greylags to the simulation area.
CfgFloat cfg_goose_MinForageRateDecayRate("GOOSE_MINFORAGEDECAYRATE", CFG_CUSTOM, 0.72, 0.0, 1.0)
The decay rate for the minimum forage rate.
static CfgBool cfg_goose_LeaveReasonStats("GOOSE_LEAVEREASONSTATS", CFG_CUSTOM, false)
Should we record goose leaving reason statistics?
CfgFloat cfg_goose_gl_FieldForageDist("GOOSE_FIELDFORAGEDIST_GL", CFG_CUSTOM, 5000, 1000, 35000)
The maximum forage range when already at a forage location for greylag geese (m)
CfgFloat cfg_G6F("POLYNOMIALTWO_TWO_F", CFG_CUSTOM, 24.4013)
Max x-value - at this point the curve tends to 0, must stop here to avoid negative values.
CfgFloat cfg_G6A("POLYNOMIALTWO_TWO_A", CFG_CUSTOM, -0.1094)
Coefficient A in a second order polynomial function.
TTypesOfVegetation m_veg
The vegetation type.
void GooseEnergyRecordOutput()
Produces output to a standard file describing the number of birds foraging at each field and the fiel...
CfgFloat cfg_goose_gl_young_proportion("GOOSE_GL_YOUNG_PROPORTION", CFG_CUSTOM, 0.21, 0.0, 1.0)
Input: Greylag goose proportion of young at start.
void RecordLeaveReason(TTypeOfLeaveReason a_leavereason, GooseSpeciesType a_speciestype)
Record the reason for leaving.
int GetPolygonref()
Get the landscape element ( LE ) reference number used by the Landscape class to identify this locati...
static CfgBool cfg_goose_StateStats("GOOSE_STATESTATS", CFG_CUSTOM, false)
Should we record state statistics?
ofstream * m_GooseEnergeticsDataFile
Pointer to an output file for goose energetics data.
CfgFloat cfg_goose_pf_fallmig_probability("GOOSE_PF_FALLMIG_PROBABILITY", CFG_CUSTOM, 0.03, 0.0, 1.0)
Input: The pinkfoot fall migration probability.
CfgInt cfg_goose_MaxScareDistance("GOOSE_MAXSCAREDIST", CFG_CUSTOM, 500, 1, 5000)
The maximum distance in m that a goose can hear a scary bang.
CfgFloat cfg_P1G("POLYNOMIALTWO_ONE_G", CFG_CUSTOM, 0.00)
Min x-value.
ofstream * m_GooseFieldForageDataFile
Pointer to an output file for goose field forage data.
CfgInt cfg_goose_gl_springmignos("GOOSE_GL_SPRING_MIG_NOS", CFG_CUSTOM, 2240)
Input: Number of greylag to immigrate in spring.
void RecordHabitatUseFieldObs(int a_habitatype, GooseSpecies a_species, int a_count)
Record the habitat use.
void Set_Indivmingooseforagerate(double a_cost)
Set the mimimum tolerated forage rate for the individual goose.
GooseActiveForageLocation(GooseSpeciesType a_type, int a_number, int a_polyref, int a_area, double a_graindensity, double a_maizedensity, double *a_grazing, Goose_Population_Manager *p_NPM)
Constructor for GooseActiveForageLocation.
void ClearGooseHabitatUseStats()
Clear simple stats for habitat use.
void Set_mingooseforagerate(double a_cost, GooseSpecies a_species)
Set the mimimum tolerated forage rate for all geese.
ALMaSS_MathFuncs constructor.
TTypeOfMaxIntakeSource m_HabitatType
Whether it is a cereal crop, grass etc.
Landscape * m_L
Landscape pointer.
CfgInt cfg_goose_pf_arrivedateend("GOOSE_PF_ARRIVEDATEEND", CFG_CUSTOM, 280)
Input: The last date for arrival for pink-foots to the simulation area.
APoint m_roost
Roost location.
CfgFloat cfg_goose_snow_scaler("GOOSE_SNOW_SCALER", CFG_CUSTOM, 0.1, 0.0, 1.0)
The decrease in intake rate resulting from snow.
Variate_gen * m_variate_generator
Function to be able to draw randomly from predefined distributions.
Goose_Base * GetLeader(APoint a_homeloc, GooseSpecies a_species)
Asks for a pointer to a goose that can be followed.
static CfgInt cfg_goose_bn_followinglikelyhood("GOOSE_FOLLOWINGLIKELYHOOD_BN", CFG_CUSTOM, 0, 0, 10000)
The likelyhood that a goose will follow another goose when going foraging - barnacle goose.
static CfgInt cfg_goose_pf_followinglikelyhood("GOOSE_FOLLOWINGLIKELYHOOD_PF", CFG_CUSTOM, 0, 0, 10000)
The likelyhood that a goose will follow another goose when going foraging - pinkfooted goose.
The landscape class containing all environmental and topographical data.
CfgBool cfg_goose_pf_fallmigrate("GOOSE_PF_FALL_MIGRATE", CFG_CUSTOM, true)
Input: Should we simulate a pinkfoot fall migration?
CfgInt cfg_goose_gl_fallmigdatestart("GOOSE_GL_FALL_MIGRATION_START", CFG_CUSTOM, 232, 1, 365)
Input: Date for onset of greylag fall migration.
CfgInt cfg_goose_pf_leavingdatestart("GOOSE_PF_LEAVINGDATESTART", CFG_CUSTOM, 78)
Input: The initial starting date for pink-foots to the leave simulation area.
TTypeOfMaxIntakeSource m_maxintakesource
The intake source which gave the maximum intake.
void RecordForagingTime(int a_time, GooseSpecies a_species)
Record the time spent foraging.
bool m_iscereal
Flag for whether the intake source is a cereal.
CfgFloat cfg_B6D("POLYNOMIALTWO_THREE_D", CFG_CUSTOM, 0.404)
Scaler for assimilation of energy from grass for pinkfeet. Madsen 1985 Vol 16 p. 222 - 228 Ornis Scan...
CfgBool cfg_Petti1D("PETTIFOR_ONE_D", CFG_CUSTOM, false)
Logical config to control if the curve should be reversed (i.e. 1 - value)
CfgFloat cfg_goose_Thermalconstantb("GOOSE_THERMALCONSTANTB", CFG_CUSTOM, 1.272 *24, 1, 100)
Thermal regulation cost Constant b.
void ClearStateStats()
Clear simple stats for the states.
void Set_GooseFieldForageDist(double sp1, double sp2, double sp3)
Set the max forage distance from a field for all geese.
bool m_daylight
Flag for in daylight hours. Sunrise is always at m_daytime == 0.
CfgInt cfg_goose_bn_arrivedatestart("GOOSE_BN_ARRIVEDATESTART", CFG_CUSTOM, 277)
Input: The initial starting date for arrival for barnacles to the simulation area.
void ClearGooseWeightStats()
Clear simple stats for the weights in the population.
int g_torun
This variable controls how long the simulation will run for.
void ReInit(Landscape *p_L, Goose_Population_Manager *p_NPM, double a_weight, bool a_sex, int a_groupsize, APoint a_roost)
ReInit for object pool.
CfgFloat cfg_H2A("HOLLINGS_TWO_A", CFG_CUSTOM, 0.04294186)
Attack rate in a type II functional response curve (Hollings disc equation)
boost::variate_generator< base_generator_type &, boost::uniform_real<> > g_rand_uni
A random number generator (0-1)
CfgFloat cfg_goose_bn_young_proportion("GOOSE_BN_YOUNG_PROPORTION", CFG_CUSTOM, 0.21, 0.0, 1.0)
Input: Barnacle goose proportion of young at start.
void FindClosestRoost(int &a_x, int &a_y, unsigned a_type)
Changes a_x & a_y to the location of the nearest roost of a_type to a_x, a_y.
SimpleStatistics m_StateStats
Debugging code. Statistics for the number of times a state method is called.
void RecordIndForageLoc(double a_count, int a_groupsize, GooseSpecies a_species)
Record a forage location count.
double GetMaizeDensity(int a_index)
Returns the maize forage density for a forage location.
CfgFloat cfg_PermanentVegGrowthMaxScaler
Scales the growth of vegetation - max value.
bool m_instubble
Flag to indicate if the intake source was in stubble.
CfgFloat cfg_G6C("POLYNOMIALTWO_TWO_C", CFG_CUSTOM, 0.0)
The constant C in a second order polynomial function.
void ReInit(Landscape *p_L, Goose_Population_Manager *p_NPM, double a_weight, bool a_sex, APoint a_roost)
ReInit for object pool.
CfgFloat cfg_PermanentVegGrowthMinScaler
Scales the growth of vegetation - min value.
virtual void TheAOROutputProbe()
The modified goose version of the standard output for creating AOR statistics.
Bool configurator entry class.
HollingsDiscCurveClass * m_IntakeRateVSMaizeDensity_BN
Speed optimisation to hold all potential forage rates in the range 0-X maize density per m2.
ofstream * m_StateStatsFile
Pointer to an output file for state stats data.
CfgBool cfg_goose_bn_springmigrate("GOOSE_BN_SPRING_MIGRATE", CFG_CUSTOM, true)
Input: Should we simulate barnacle a spring migration?
CfgFloat cfg_goose_gl_baseweight("GOOSE_GREYLAGWEIGHT", CFG_CUSTOM, 2795, 2500, 3000)
Lean weight of greylag geese.
HollingsDiscCurveClass * m_IntakeRateVSGrainDensity_PF
Speed optimisation to hold all potential forage rates in the range 0-X grain density per m2.
CfgFloat cfg_goose_bn_sexratio("GOOSE_BN_SEXRATIO", CFG_CUSTOM, 0.5, 0.0, 1.0)
The sex ratio of barnacle non-breeders.
CfgInt cfg_goose_bn_fallmigdatestart("GOOSE_BN_FALL_MIGRATION_START", CFG_CUSTOM, 318, 1, 365)
Input: Date for onset of barnacle fall migration.
CfgFloat cfg_H1B("HOLLINGS_ONE_B", CFG_CUSTOM, 0.0840075)
Handling time in a type II functional response curve (Hollings disc equation)
CfgInt cfg_goose_RoostLeaveDistSD("GOOSE_ROOSTLEAVEDISTSD", CFG_CUSTOM, 10)
The standard deviation for the normal distribution which determines roost leave time.
int ForageLocationInUse(int a_polyref)
Tests if a forage location is currently in use, if so returns the index to it.
static CfgBool cfg_goose_EnergyRecord("GOOSE_ENERGYRECORD", CFG_CUSTOM, false)
Should we record goose energetics?
CfgStr cfg_H1F("HOLLINGS_ONE_G", CFG_CUSTOM, "KJIntakeAtDiffGrainDensities_PF")
File name for functional response on grain for pinkfeet.
double m_thermalcosts[3]
Temporary storage for daily goose energetic thermal costs constant for each species.
CfgBool cfg_goose_pf_springmigrate("GOOSE_PF_SPRING_MIGRATE", CFG_CUSTOM, true)
Input: Should we simulate a spring migration?
void Set_GooseMaxEnergyReserveProportion(double a_prop)
Set the maximum energy reserve proportion allowed for all geese.
TMaxIntakeSource GetMaxIntakeSource()
Supply the current max intake source.
GooseSpecies GetSpecies()
Returns the species.
CfgFloat cfg_goose_gl_sexratio("GOOSE_GL_SEXRATIO", CFG_CUSTOM, 0.5, 0.0, 1.0)
The sex ratio of greylag non-breeders.
static CfgInt cfg_goose_gl_followinglikelyhood("GOOSE_FOLLOWINGLIKELYHOOD_GL", CFG_CUSTOM, 0, 0, 10000)
The likelyhood that a goose will follow another goose when going foraging - graylag goose.
ofstream * m_GooseLeaveReasonStatsFile
Pointer to an output file for goose leave reason stats data.
std::vector< GooseActiveForageLocation > m_GooseForageLocations
Is a list of active goose forage locations where we have geese.
CfgInt cfg_goose_pf_springmigdateend("GOOSE_PF_SPRING_MIG_END", CFG_CUSTOM, 59, 1, 365)
Input: Date for end of spring migration.
static CfgBool cfg_goose_PopulationDescriptionON("GOOSE_POPULATIONDESCRIPTIONON", CFG_CUSTOM, true)
The cfg variable determining whether to print goose population stats.
void AddGeeseToForageLocationP(GooseSpeciesType a_type, int a_polyref, int a_number)
Adds a goose or geese to the forage location - uses polygon number as reference.
void Warn(MapErrorState a_level, std::string a_msg1, std::string a_msg2)
void Set_GooseForageDist(double sp1, double sp2, double sp3)
Set the max forage distance from roost for all geese.
GooseActiveForageLocation * GetForageLocation(unsigned int a_index)
Returns a pointer to the forage location indexed by index.
ofstream * m_GooseHabitatUseFile
Pointer to an output file for goose habitat use data.
void GetImmigrationNumbers(GooseSpecies a_goose, bool a_season)
Get the numbers to immigrate.
void ClearGooseFlightDistanceStats()
Clear simple stats for flight distances in the population.
CfgFloat cfg_G6D("POLYNOMIALTWO_TWO_D", CFG_CUSTOM, 0.404)
Scaler for assimilation of energy from grass for pinkfeet. Madsen 1985 Vol 16 p. 222 - 228 Ornis Scan...
void Graze(double a_kJ, int a_index)
Removes KJ as grams veg biomass from a forage area.
int SupplyDayInYear(void)
void RecordFlightDistance(int a_distance, GooseSpecies a_species)
Record the flight distance.
CfgFloat cfg_goose_GrainDecayRateSpring("GOOSE_GRAINDECAYRATESPRING", CFG_CUSTOM, 0.95, 0.0, 1.0)
The decay rate for spilled grain for Spring until 1st July.
CfgFloat cfg_goose_pf_ForageDist("GOOSE_FORAGEDIST_PF", CFG_CUSTOM, 35000, 1000, 35000)
The maximum forage range in m for pink-footed geese.
CfgFloat cfg_B6G("POLYNOMIALTWO_THREE_B", CFG_CUSTOM, 0.00)
Min x-value.
void BirdsShot(int a_polyref, int a_numbershot, GooseHunter *a_Hunter)
Passes the message to shoot a number of birds at a forage location.
CfgFloat cfg_goose_EnergyContentOfFat("GOOSE_ENERGYCONTENTOFFAT", CFG_CUSTOM, 39.8, 1, 100)
The energy content of fat.
bool InGreylagSeason()
Are we in the greylag hunting season?
CfgInt cfg_goose_bn_fallmigdateend("GOOSE_BN_FALL_MIGRATION_END", CFG_CUSTOM, 348, 1, 365)
Input: Date for end of barnacle fall migration.
CfgFloat cfg_goose_gl_ForageDist("GOOSE_FORAGEDIST_GL", CFG_CUSTOM, 35000, 1000, 35000)
The maximum forage range in m for greylag geese.
The class to handle all goose population related matters.
CfgBool l_map_print_git_version_info
Should git version info be printed to file and console?
CfgBool cfg_WriteCurve("CURVE_WRITE", CFG_CUSTOM, false)
Controlling whether the functional response curves used are written to disk.
void RemoveGrainKJ(double a_kJ, int a_index)
Removes kJ eaten as grains from a forage area.
CfgStr cfg_P1H("POLYNOMIALTWO_ONE_H", CFG_CUSTOM, "KJIntakeAtVaryingGrassHeights_PF")
File name for grass functional response for pinkfeet.
CfgFloat cfg_goose_dist_weight_power("GOOSE_DIST_WEIGHTING_POWER", CFG_CUSTOM, 1.0, -10.0, 10.0)
The exponent for the distance weighting curve.
CfgInt cfg_goose_gl_startnos("GOOSE_GL_STARTNOS", CFG_CUSTOM, 8960)
Input: Greylag geese start numbers.
AOR_Probe_Goose * m_AOR_Greylags
AOR Probe for greylags.
TTypesOfVegetation m_prevsowncrop
The previous sown crop on the forage location.
A class to hold an active goose foraging location and the number of birds of different types there.
void Set_GooseLeavingRoost(bool a_leaving)
Set the flag to indicate if we are coming from the roost.
void RemoveMaizeKJ(double a_kJ, int a_index)
Removes KJ eaten as maize from a forage area.
CfgFloat cfg_goose_MetabolicConversionCosts("GOOSE_METABOLICCONVCOSTS", CFG_CUSTOM, 11.4, 1, 100)
The metabolic costs of converting tissue to energy or vice versa
double GetGrainDensity(int a_index)
Returns the forage density for a forage location.
double m_maizeKJ_total
The total maize kJ.
void ClearIndLocCountStats()
Clear simple stats for forage location counts.
CfgInt cfg_goose_pf_springmigdatestart("GOOSE_PF_SPRING_MIG_START", CFG_CUSTOM, 7, 1, 365)
Input: Date for onset of spring migration.
A class to describe the Greylag family group.
SimpleStatistics m_LeaveReasonStats[gst_foobar][tolr_foobar]
Statistics for reasons for leaving the simulation.
ofstream * m_GooseXYDumpFile
Pointer to an output file for goose x y data.
void ClearGooseForagingTimeStats()
Clear simple stats for foraging times in the population.
AOR_Probe_Goose * m_AOR_Barnacles
AOR Probe for barnacles.
SimpleStatistics m_IndividualForageLocationData[gs_foobar]
Statistics for the number of forage locations visited per goose of the population.
int NewForageLocation(GooseSpeciesType a_type, int a_number, int a_polyref)
Creates a new forage location and adds a goose or geese to the forage location. Returns an index to t...
void ClearBirds()
Empties the bird recording arrays.
void CreateObjects(int ob_type, TAnimal *pvo, struct_Goose *data, int number)
Method for creating a new individual Goose.
CfgFloat cfg_H2D("HOLLINGS_TWO_D", CFG_CUSTOM, 2100)
Max x-value - at this point the curve tends to 0, must stop here to avoid negative values.
CfgFloat cfg_goose_GrainDecayRateWinter("GOOSE_GRAINDECAYRATEWINTER", CFG_CUSTOM, 0.9985, 0.0, 1.0)
The decay rate for spilled grain for Harvest to Spring.
int m_migrationnumbers[3][2]
Storage for goose numbers. Used when birds are immigrating.
bool m_GreylagSeason
Flag to indicate if we are in the greylag hunting season.
CfgInt cfg_goose_gl_springmigdateend("GOOSE_GL_SPRING_MIG_END", CFG_CUSTOM, 75, 1, 365)
Input: Date for end of greylag spring migration.
CfgStr cfg_H2F("HOLLINGS_TWO_G", CFG_CUSTOM, "KJIntakeAtDiffMaizeDensities_BN")
File name for functional response maize for barnacle.
CfgFloat cfg_goose_roostchangechance("GOOSE_ROOSTCHANGECHANCE", CFG_CUSTOM, 0.0, 0.0, 1.0)
Chance of changing roost.
CfgFloat cfg_goose_gl_Thermalconstant("GOOSE_THERMALCONSTANTA_GL", CFG_CUSTOM, 10.8, 1, 25)
Greylag goose lower critical temperature for calculating thermal regulation cost. Constant 1.
std::string IntakeSourceToString(TTypeOfMaxIntakeSource a_intake_source)
Translates tomis enum to string
CfgFloat cfg_goose_InitialEnergyReserveProportion("GOOSE_INITIALENERGYRESERVEPROPORTION", CFG_CUSTOM, 0.1, 0.0, 1)
The initial proportion of weight that can be stored as energy reserves.
AOR_Probe_Goose * m_AOR_Pinkfeet
AOR Probe for pinkfeet.
CfgInt cfg_goose_bn_springmigdateend("GOOSE_BN_SPRING_MIG_END", CFG_CUSTOM, 75, 1, 365)
Input: Date for end of barnacle spring migration.
void ClearGooseHabitatUseFieldObsStats()
Clear simple stats for field obs habitat use.
PettiforFeedingTimeCurveClass * m_ForageRateVSGooseDensity
Speed optimisation to hold all potential competition reductions in the range 0 - 1 goose/m2.
CfgInt cfg_goose_pf_fallmigdateend("GOOSE_PF_FALL_MIGRATION_END", CFG_CUSTOM, 304, 1, 365)
Input: Date for end of pinkfoot fall migration.
void ClearGooseLeaveReasonStats()
Clear simple stats for the reasons for leaving the simulation.
void RecordDailyEnergyBalance(int a_balance, GooseSpecies a_species)
Record the daily energy balance.
CfgBool cfg_AOROutput_used
This config variable controls whether we should make AOR output.
CfgBool cfg_G6E("POLYNOMIALTWO_TWO_E", CFG_CUSTOM, false)
Logical config to control if the curve should be reversed (i.e. 1 - value)
int m_daytime
Holds the time of day. Note that sunrise is at m_daytime == 0.
void SetPolygonref(int a_polyref)
Set the landscape element ( LE ) reference number used by the Landscape class to identify this locati...
void On_Bang(int a_polyid)
The goose is scared by a bang at location.
A class to describe the Barnacle non-breeder.
CfgStr cfg_Petti1G("PETTIFOR_ONE_G", CFG_CUSTOM, "FeedingTimePettifor_PF")
File name for density dependent functional response for pinkfeet.
std::string GooseTypeToString(GooseSpeciesType a_gst)
Translates gst enum to string
int m_grpsize
Size of family unit if any.
void WriteHeaders(ofstream *a_file, std::vector< std::string > a_headers)
Handy function for writing headers.
CfgFloat cfg_goose_nighttime_BMR_multiplier("GOOSE_NIGHTTIMEBMRMULTIPLIER", CFG_CUSTOM, 1.3, 1.0, 10.0)
To calculate daily energy budget. This is the multiple of BMR spent during nighttime.
CfgBool cfg_goose_gl_fallmigrate("GOOSE_GL_FALL_MIGRATE", CFG_CUSTOM, true)
Input: Should we simulate a greylag fall migration?
CfgFloat cfg_goose_pf_baseweight("GOOSE_PINKFOOTWEIGHT", CFG_CUSTOM, 2307, 2000, 3000)
Lean weight of pinkfoot geese.
void ClearGooseDailyEnergyBudgetStats()
Clear simple stats for daily energy budget in the population.
int GetForageLocIndex()
Gets for the forage location index.
static CfgBool cfg_goose_FieldForageInfo("GOOSE_FIELDFORAGEINFO", CFG_CUSTOM, false)
Should we record goose field forage information?
Integer configurator entry class.
CfgInt cfg_goose_pf_arrivedatestart("GOOSE_PF_ARRIVEDATESTART", CFG_CUSTOM, 265)
Input: The initial starting date for arrival for pink-foots to the simulation area.
A class to describe the goose base.
CfgInt cfg_goose_TimedCounts("GOOSE_TIMEDCOUNTS", CFG_CUSTOM, 2, 1, 12)
The time when the geese are counted on fields. We divide the daylight hours by this cfg and add that ...
void GooseIndLocCountOutput()
Outputs simple stats for the number of forage locations visited per goose.
Goose_Population_Manager * m_GPM
Goose_Population_Manager pointer.
MapErrorMsg * g_msg
This pointer provides access the to the internal ALMaSS error message system.
bool m_family
is part of a family
CfgFloat cfg_G6G("POLYNOMIALTWO_TWO_G", CFG_CUSTOM, 0.00)
Min x-value.
int CalcDistPythagorasApprox(int a_x, int a_y, int a_x1, int a_y1)
Calculate distance using the Pythagoras approximation.
void GooseHabitatUseFieldObsOutput()
Outputs simple stats for the goose habitat use but using rules to mimic field observations.
bool m_PinkfootSeason
Flag to indicate if we are in the pinkfoot hunting season?
int m_daylightleft
Number of daylight minutes left.
CfgFloat cfg_B6B("POLYNOMIALTWO_THREE_B", CFG_CUSTOM, 0.88)
Coefficient B in a second order polynomial function.
Goose_Population_Manager * m_OurPopulationManager
This is a time saving pointer to the correct population manager object.
CfgFloat cfg_goose_BMRconstant2("GOOSE_BMRCONSTANTB", CFG_CUSTOM, 0.72, 0, 1)
The cost of BMR per kg goose - constant 2.
void Set_GooseFattoKJConversion(double a_cost)
Set the fat to kJ conversion constant for all geese.
CfgStr cfg_G6H("POLYNOMIALTWO_TWO_H", CFG_CUSTOM, "KJIntakeAtVaryingGrassHeights_GL")
File name for grass functional response for greylags.
Double configurator entry class.
CfgInt cfg_goose_greylagopenseasonend("GOOSE_GL_OPENSEASONEND", CFG_CUSTOM, 31)
The end of the greylag hunting season.
void Set_GooseKJtoFatConversion(double a_cost)
Set the kJ to fat conversion constant for all geese.
void WriteConfig()
Writes a file the values of the config variables used.
CfgFloat cfg_H1E("HOLLINGS_ONE_E", CFG_CUSTOM, 0)
Min x-value.
static CfgBool cfg_goose_WriteConfig("GOOSE_WRITECONFIG", CFG_CUSTOM, true)
Should we write the values of the configs to a file?
void RecordState()
Record the state.
virtual void DoFirst(void)
Things to do before anything else at the start of a timestep.
CfgFloat cfg_goose_bn_FieldForageDist("GOOSE_FIELDFORAGEDIST_BN", CFG_CUSTOM, 5000, 1000, 35000)
The maximum forage range when already at a forage location for barnacle geese (m)
void GooseFieldForageInfoOutput()
Produces output to a standard file describing the energetic state of all individuals of the goose pop...
CfgFloat cfg_goose_pf_Thermalconstant("GOOSE_THERMALCONSTANTA_PF", CFG_CUSTOM, 11.4, 1, 25)
Pinkfooted goose lower critical temperature for calculating thermal regulation cost....
void Set_GooseMaxAppetiteScaler(double a_cost)
Set the goose appetite scale used to calculate max intake for all geese.
void RemoveGeeseFromForageLocation(GooseSpeciesType a_type, int a_index, int a_number)
Removes a goose or geese to the forage location - requires an index.
void GooseLeaveReasonStatOutput()
Outputs simple stats for the reasons for leaving the simulation.
std::string LeaveReasonToString(TTypeOfLeaveReason a_leave_reason)
Translates tolr enum to string
std::string GooseToString(GooseSpecies a_gs)
Translates gs enum to string
void RemoveMaxForageKj(double a_forage, TTypeOfMaxIntakeSource a_maxintakesource, int m_myForageIndex)
Removes the forage eaten from the field.
bool InPinkfootSeason()
Are we in the pinkfoot hunting season?
ALMaSS_MathFuncs g_AlmassMathFuncs
This variable provides access the to the internal ALMaSS math functions.
SimpleStatistics m_DailyEnergyBalanceStats[gs_foobar]
Statistics for the daily energy balance in the population.
void ResetGrazing()
Sets grazed biomass to zero.
void SetFlightCost(double a_cost)
Set the flight cost per m per g.
CfgFloat cfg_goose_bn_fallmig_probability("GOOSE_BN_FALLMIG_PROBABILITY", CFG_CUSTOM, 0.0083, 0.0, 1.0)
Input: The barnacle fall migration probability.
std::vector< GooseFieldListItem > GooseFieldList
A list of GooseFieldListItem s.
double GetDistToClosestRoost(int a_x, int a_y, unsigned a_type)
Returns the distance in to the nearest roost of a_type in meters.
virtual void Init(void)
Called upon initialization of the simulation. Sets up output files.
CfgInt cfg_goose_pf_fallmigdatestart("GOOSE_PF_FALL_MIGRATION_START", CFG_CUSTOM, 274, 1, 365)
Input: Date for onset of pinkfoot fall migration.
void Set_GooseLeavingThreshold(double a_threshold)
Set the body condition threshold for leaving for all geese.
CfgInt cfg_goose_pinkfootopenseasonstart("GOOSE_PF_OPENSEASONSTART", CFG_CUSTOM, 243)
The start of the pinkfoot hunting season.
int BirdsToShootAtPoly(int a_poly)
Returns the number of birds at a forage location - given by a poly ref.
void SetMaizeDensity(double a_density)
Sets maize forage density (kJ/m2)
int CalcDistPythagoras(int a_x, int a_y, int a_x1, int a_y1)
Calculate distance using Pythagoras.
ofstream * m_GooseGitVersionFile
Pointer to an output file for almass version.
void Warn(std::string a_msg1, std::string a_msg2)
CfgInt cfg_goose_RoostLeaveDistMean("GOOSE_ROOSTLEAVEDISTMEAN", CFG_CUSTOM, 30)
The mean for the normal distribution which determines roost leave time.
CfgStr cfg_B6H("POLYNOMIALTWO_THREE_H", CFG_CUSTOM, "KJIntakeAtVaryingGrassHeights_BG")
File name for grass functional response for barnacles.
SimpleStatistics m_FlightDistanceStats[gs_foobar]
Statistics for the flight distances in the population.
CfgFloat cfg_goose_BMRconstant1("GOOSE_BMRCONSTANTA", CFG_CUSTOM, 4.19 *78.30, 1, 500)
The cost of BMR per kg goose - constant 1.
CfgFloat cfg_goose_bn_ForageDist("GOOSE_FORAGEDIST_BN", CFG_CUSTOM, 35000, 1000, 35000)
The maximum forage range in m for barnacle geese.
CfgFloat cfg_goose_MaxAppetiteScaler("GOOSE_MAXAPPETITESCALER", CFG_CUSTOM, 4.82, 1, 10)
The maximum a goose is allowed to eat in a day as a scaling of BMR.
void ObservedOpennessQuery()
Writes a file with the openness scores on places where geese have been observed in the field.
CfgFloat cfg_H2B("HOLLINGS_TWO_B", CFG_CUSTOM, 0.05844966)
Handling time in a type II functional response curve (Hollings disc equation)
APoint GetRoost()
Supply roost coords.
CfgFloat cfg_P1A("POLYNOMIALTWO_ONE_A", CFG_CUSTOM, -0.1884)
Coefficient A in a second order polynomial function.
static CfgBool cfg_goose_IndLocCounts("GOOSE_INDLOCCOUNTSTATS", CFG_CUSTOM, false)
Should we record gooseindividual forage location count statistics?
CfgInt cfg_goose_greylagopenseasonstart("GOOSE_GL_OPENSEASONSTART", CFG_CUSTOM, 243)
The start of the greylag hunting season.
CfgFloat cfg_B6C("POLYNOMIALTWO_THREE_C", CFG_CUSTOM, 5.0)
The constant C in a second order polynomial function.
The class for goose hunters encompsassing all their specific behaviours.
static CfgFloat cfg_goose_LeavingThreshold("GOOSE_LEAVINGTHRESHOLD", CFG_CUSTOM, 1.0, 1.0, 5.0)
The 5-day mean of body condition which triggers the bird to leave.
int m_BirdsPresent[gst_foobar]
An array holding the number of geese of different type i.e. Pinkfoot families, juvs,...
void AddGeese(GooseSpeciesType a_type, int a_number)
Adds geese to the location.
CfgInt cfg_goose_pinkfootopenseasonend("GOOSE_PF_OPENSEASONEND", CFG_CUSTOM, 364)
The end of the pinkfoot hunting season.
void OnShotABird(int a_birdtype, int a_poly)
Message received when a goose is successully shot.
CfgFloat cfg_goose_bn_Thermalconstant("GOOSE_THERMALCONSTANTA_BN", CFG_CUSTOM, 12.1, 1, 25)
Barnacle goose lower critical temperature for calculating thermal regulation cost....
void SetGrazing(int gs, double a_density)
Sets forage density (kJ/m2)
static CfgFloat cfg_goose_flightcost("GOOSE_FLIGHTCOST", CFG_CUSTOM, 0.000002079, 0, 1)
the cost of flight in kJ per m per gram
CfgFloat cfg_B6F("POLYNOMIALTWO_THREE_F", CFG_CUSTOM, 13.4761)
Max x-value - at this point the curve tends to 0, must stop here to avoid negative values.
int m_HabitatUseStats[gs_foobar *tomis_foobar]
Data for the habitat use.
CfgInt cfg_goose_bn_springmignos("GOOSE_BN_SPRING_MIG_NOS", CFG_CUSTOM, 8960)
Input: Number of barnacle to immigrate in spring.
virtual void DoImmigration()
Controls immigration to the Danish simulation area.
virtual void DoLast()
Things to do after the EndStep.
void ReInit(Landscape *p_L, Goose_Population_Manager *p_NPM, double a_weight, bool a_sex, APoint a_roost)
ReInit for object pool.
static CfgBool cfg_goose_runtime_reporting("GOOSE_RUNTIMEREPORTING", CFG_CUSTOM, true)
Should we use stripped down output to optimize run time?
BarnacleGoose_All.h This is the header file for the greylag goose classes
std::vector< roostlist > m_roosts
The list of roosts
CfgFloat cfg_Petti1A("PETTIFOR_ONE_A", CFG_CUSTOM, 0.88)
Maximum feeding time.
CfgFloat cfg_Petti1C("PETTIFOR_ONE_C", CFG_CUSTOM, 280)
Threshold flock size above which feeding time no longer increases.
void Set_GooseFollowingLikelyhood(int a_likelyhood, GooseSpeciesType a_speciestype)
Set the followinglikelyhood.
virtual void DoEmigration()
Controls emigration from the Danish simulation area.
CfgFloat cfg_P1B("POLYNOMIALTWO_ONE_B", CFG_CUSTOM, 3.1349)
Coefficient B in a second order polynomial function.