ALMaSS Hare ODDox  1.1
The hare model description following ODdox protocol
UserDefinedFarm17 Class Reference

A farm that can have its rotation defined by the user at runtime. More...

#include <farm.h>

Public Member Functions

 UserDefinedFarm17 (FarmManager *a_manager)
 
- Public Member Functions inherited from Farm
void AddField (LE *a_newfield)
 Adds a field to a farm. More...
 
void AddHunter (Hunter *a_hunter)
 
void AddNewEvent (TTypesOfVegetation a_event, long a_date, LE *a_field, int a_todo, long a_num, bool a_lock, int a_start, bool a_first_year, TTypesOfVegetation a_crop)
 Adds an event to the event queue for a farm. More...
 
void Assign_rotation (vector< TTypesOfVegetation >a_new_rotation)
 
virtual bool AutumnHarrow (LE *a_field, double a_user, int a_days)
 Carry out a harrow event in the autumn on a_field. More...
 
virtual bool AutumnPlough (LE *a_field, double a_user, int a_days)
 Carry out a ploughing event in the autumn on a_field. More...
 
virtual bool AutumnRoll (LE *a_field, double a_user, int a_days)
 Carry out a roll event in the autumn on a_field. More...
 
virtual bool AutumnSow (LE *a_field, double a_user, int a_days)
 Carry out a sowing event in the autumn on a_field. More...
 
virtual bool BedForming (LE *a_field, double a_user, int a_days)
 Do bed forming up on a_field, probably of carrots. More...
 
virtual bool Biocide (LE *a_field, double a_user, int a_days)
 Biocide applied on a_field. More...
 
virtual bool BulbHarvest (LE *a_field, double a_user, int a_days)
 Carry out a bulb harvest on a_field. More...
 
virtual bool BurnStrawStubble (LE *a_field, double a_user, int a_days)
 Burn stubble on a_field. More...
 
virtual bool CattleIsOut (LE *a_field, double a_user, int a_days, int a_max)
 Generate a 'cattle_out' event for every day the cattle are on a_field. More...
 
virtual bool CattleIsOutLow (LE *a_field, double a_user, int a_days, int a_max)
 Generate a 'cattle_out_low' event for every day the cattle are on a_field. More...
 
virtual bool CattleOut (LE *a_field, double a_user, int a_days)
 Start a grazing event on a_field today. More...
 
virtual bool CattleOutLowGrazing (LE *a_field, double a_user, int a_days)
 Start a extensive grazing event on a_field today. More...
 
void Centroids ()
 Finds farm's centroids - x and y. More...
 
virtual bool CutOrch (LE *a_field, double a_user, int a_days)
 Cut vegetation on orchard crop. //based on cut to silage - values from cutting function of orchard. More...
 
virtual bool CutToHay (LE *a_field, double a_user, int a_days)
 Carry out hay cutting on a_field. More...
 
virtual bool CutToSilage (LE *a_field, double a_user, int a_days)
 Cut vegetation for silage on a_field. More...
 
virtual bool CutWeeds (LE *a_field, double a_user, int a_days)
 Carry out weed topping on a_field. More...
 
virtual bool DeepPlough (LE *a_field, double a_user, int a_days)
 Carry out a deep ploughing event on a_field. More...
 
bool DoIt (double a_probability)
 Return chance out of 0 to 100. More...
 
bool DoIt_prob (double a_probability)
 Return chance out of 0 to 1. More...
 
virtual bool FA_AmmoniumSulphate (LE *a_field, double a_user, int a_days)
 Apply ammonium sulphate to a_field owned by an stock farmer. More...
 
virtual bool FA_Calcium (LE *a_field, double a_user, int a_days)
 Calcium applied on a_field owned by a stock farmer. More...
 
virtual bool FA_GreenManure (LE *a_field, double a_user, int a_days)
 Spread green manure on a_field owned by an stock farmer. More...
 
virtual bool FA_ManganeseSulphate (LE *a_field, double a_user, int a_days)
 Apply manganese sulphate to a_field owned by an stock farmer. More...
 
virtual bool FA_Manure (LE *a_field, double a_user, int a_days)
 Spread manure on a_field owned by an stock farmer. More...
 
virtual bool FA_NPK (LE *a_field, double a_user, int a_days)
 Apply NPK fertilizer to a_field owned by an stock farmer. More...
 
virtual bool FA_NPKS (LE *a_field, double a_user, int a_days)
 Apply NPKS fertilizer, on a_field owned by a stock farmer. More...
 
virtual bool FA_PK (LE *a_field, double a_user, int a_days)
 Apply PK fertilizer to a_field owned by an stock farmer. More...
 
virtual bool FA_RSM (LE *a_field, double a_user, int a_days)
 RSM (ammonium nitrate solution) applied on a_field owned by a stock farmer. More...
 
virtual bool FA_Sludge (LE *a_field, double a_user, int a_days)
 Spread sewege sludge on a_field owned by an stock farmer. More...
 
virtual bool FA_Slurry (LE *a_field, double a_user, int a_days)
 Spready slurry on a_field owned by an stock farmer. More...
 
 Farm (FarmManager *a_manager)
 Farm constructor - creates an instance of each possible crop type. More...
 
virtual bool FlowerCutting (LE *a_field, double a_user, int a_days)
 Flower cutting applied on a_field. More...
 
virtual bool FP_AmmoniumSulphate (LE *a_field, double a_user, int a_days)
 Apply Ammonium Sulphate to a_field owned by an arable farmer. More...
 
virtual bool FP_Calcium (LE *a_field, double a_user, int a_days)
 Calcium applied on a_field owned by an arable farmer. More...
 
virtual bool FP_GreenManure (LE *a_field, double a_user, int a_days)
 Spread green manure on a_field owned by an arable farmer. More...
 
virtual bool FP_LiquidNH3 (LE *a_field, double a_user, int a_days)
 Apply liquid ammonia fertilizer to a_field owned by an arable farmer. More...
 
virtual bool FP_ManganeseSulphate (LE *a_field, double a_user, int a_days)
 Apply Manganse Sulphate to a_field owned by an arable farmer. More...
 
virtual bool FP_Manure (LE *a_field, double a_user, int a_days)
 Spread manure on a_field owned by an arable farmer. More...
 
virtual bool FP_NPK (LE *a_field, double a_user, int a_days)
 Apply NPK fertilizer, on a_field owned by an arable farmer. More...
 
virtual bool FP_NPKS (LE *a_field, double a_user, int a_days)
 Apply NPKS fertilizer, on a_field owned by an arable farmer. More...
 
virtual bool FP_PK (LE *a_field, double a_user, int a_days)
 Apply PK fertilizer, on a_field owned by an arable farmer. More...
 
virtual bool FP_RSM (LE *a_field, double a_user, int a_days)
 RSM (ammonium nitrate solution) applied on a_field owned by an arable farmer. More...
 
virtual bool FP_Sludge (LE *a_field, double a_user, int a_days)
 Spread sewege on a_field owned by an arable farmer. More...
 
virtual bool FP_Slurry (LE *a_field, double a_user, int a_days)
 Apply slurry to a_field owned by an arable farmer. More...
 
virtual bool FungicideTreat (LE *a_field, double a_user, int a_days)
 Apply fungicide to a_field. More...
 
int GetArea (void)
 Returns the area of arable fields owned by that farm. More...
 
double GetAreaDouble (void)
 Returns the area of arable fields owned by that farm. More...
 
int GetAreaOpenFields (int a_openness)
 Returns the area of the fields above an openness of a_openness. More...
 
APoint GetCentroids ()
 
TTypesOfVegetation GetCrop (int a_index)
 
int GetFarmNumber (void)
 
int GetIntensity (void)
 
int GetMaxOpenness ()
 Returns the maximum openness score of the fields. More...
 
TTypesOfVegetation GetNextCrop (int a_index)
 
int GetNoFields ()
 Returns the number of the fields owned. More...
 
int GetNoOpenFields (int a_openness)
 Returns the number of the fields above an openness of a_openness. More...
 
TTypesOfVegetation GetPreviousCrop (int a_index)
 
int GetTotalArea (void)
 Returns the area of all fields owned by that farm. More...
 
TTypesOfFarm GetType (void)
 
APoint GetValidCoords ()
 Returns the valid coordinates of the first field owned by a farm. More...
 
virtual bool GrowthRegulator (LE *a_field, double a_user, int a_days)
 Apply growth regulator to a_field. More...
 
virtual bool Harvest (LE *a_field, double a_user, int a_days)
 Carry out a harvest on a_field. More...
 
virtual bool HarvestLong (LE *a_field, double a_user, int a_days)
 Carry out a harvest on a_field. More...
 
virtual bool HayBailing (LE *a_field, double a_user, int a_days)
 Carry out hay bailing on a_field. More...
 
virtual bool HayTurning (LE *a_field, double a_user, int a_days)
 Carry out hay turning on a_field. More...
 
virtual bool HeavyCultivatorAggregate (LE *a_field, double a_user, int a_days)
 Carry out a heavy cultivation event on a_field. This is non-inversion type of cultivation which can be done after fertilizers application on spring for a spring crop. More...
 
virtual bool HerbicideTreat (LE *a_field, double a_user, int a_days)
 Apply herbicide to a_field. More...
 
virtual bool HillingUp (LE *a_field, double a_user, int a_days)
 Do hilling up on a_field, probably of potatoes. More...
 
virtual void InitiateManagement (void)
 Kicks off the farm's management. More...
 
virtual bool InsecticideTreat (LE *a_field, double a_user, int a_days)
 Apply insecticide to a_field. More...
 
bool IsStockFarmer (void)
 
polylistListOpenFields (int a_openness)
 Returns a list of fields with openness above a_openness. More...
 
virtual void MakeStockFarmer (void)
 
virtual void Management (void)
 Starts the main management loop for the farm and performs some error checking. More...
 
virtual bool Molluscicide (LE *a_field, double a_user, int a_days)
 Apply molluscidie to a_field. More...
 
virtual bool PigsAreOut (LE *a_field, double a_user, int a_days)
 Start a pig grazing event on a_field today or soon. More...
 
virtual bool PigsAreOutForced (LE *a_field, double a_user, int a_days)
 Start a pig grazing event on a_field today - no exceptions. More...
 
virtual bool PigsOut (LE *a_field, double a_user, int a_days)
 Generate a 'pigs_out' event for every day the cattle are on a_field. More...
 
virtual bool PreseedingCultivator (LE *a_field, double a_user, int a_days)
 Carry out preseeding cultivation on a_field (tilling set including cultivator and string roller to compact soil) More...
 
virtual bool PreseedingCultivatorSow (LE *a_field, double a_user, int a_days)
 Carry out preseeding cultivation together with sow on a_field (tilling and sowing set including cultivator and string roller to compact soil) More...
 
virtual double Prob_multiplier ()
 
virtual bool ProductApplication (LE *a_field, double a_user, int a_days, double a_applicationrate, PlantProtectionProducts a_ppp)
 Apply test pesticide to a_field. More...
 
virtual bool ProductApplication_DateLimited (LE *a_field, double, int, double a_applicationrate, PlantProtectionProducts a_ppp)
 Special pesticide trial functionality. More...
 
void RemoveField (LE *a_field)
 Removes a field from a farm. More...
 
void RemoveHunter (Hunter *a_hunter)
 
virtual bool RowCultivation (LE *a_field, double a_user, int a_days)
 Carry out a harrowing between crop rows on a_field. More...
 
void SetFarmNumber (int a_farm_num)
 
virtual bool ShallowHarrow (LE *a_field, double a_user, int a_days)
 Carry out a shallow harrow event on a_field, e.g., after grass cutting event. More...
 
virtual bool SleepAllDay (LE *a_field, double a_user, int a_days)
 Nothing to to today on a_field. More...
 
virtual bool Spraying_fungins (TTypesOfVegetation)
 
virtual bool Spraying_herbicides (TTypesOfVegetation)
 
virtual bool SpringHarrow (LE *a_field, double a_user, int a_days)
 Carry out a harrow event in the spring on a_field. More...
 
virtual bool SpringPlough (LE *a_field, double a_user, int a_days)
 Carry out a ploughing event in the spring on a_field. More...
 
virtual bool SpringRoll (LE *a_field, double a_user, int a_days)
 Carry out a roll event in the spring on a_field. More...
 
virtual bool SpringSow (LE *a_field, double a_user, int a_days)
 Carry out a sowing event in the spring on a_field. More...
 
virtual bool SpringSowWithFerti (LE *a_field, double a_user, int a_days)
 Carry out a sowing event with start fertilizer in the spring on a_field. More...
 
virtual bool StrawChopping (LE *a_field, double a_user, int a_days)
 Carry out straw chopping on a_field. More...
 
virtual bool StrawCovering (LE *a_field, double a_user, int a_days)
 Straw covering applied on a_field. More...
 
virtual bool StrawRemoval (LE *a_field, double a_user, int a_days)
 Straw covering applied on a_field. More...
 
virtual bool Strigling (LE *a_field, double a_user, int a_days)
 Carry out a mechanical weeding on a_field. More...
 
virtual bool StriglingHill (LE *a_field, double a_user, int a_days)
 Carry out a mechanical weeding on a_field followed by hilling up (probably on potatoes) More...
 
virtual bool StriglingSow (LE *a_field, double a_user, int a_days)
 Carry out a mechanical weeding followed by sowing on a_field. More...
 
virtual bool StubbleCultivatorHeavy (LE *a_field, double a_user, int a_days)
 Carry out a stubble cultivation event on a_field. This is non-inversion type of cultivation which can be done instead of autumn plough (on a depth up to 40 cm even, if necessary) More...
 
virtual bool StubbleHarrowing (LE *a_field, double a_user, int a_days)
 Carry out stubble harrowing on a_field. More...
 
virtual bool StubblePlough (LE *a_field, double a_user, int a_days)
 Carry out a stubble ploughing event on a_field. This is similar to normal plough but shallow (normally 6-8cm, is special cases up to 12-15cm). Done as a part of after-harvest treatments (instead of stubble cultivation) More...
 
virtual bool Swathing (LE *a_field, double a_user, int a_days)
 Cut the crop on a_field and leave it lying (probably rape) More...
 
virtual bool Water (LE *a_field, double a_user, int a_days)
 Carry out a watering on a_field. More...
 
virtual bool WinterPlough (LE *a_field, double a_user, int a_days)
 Carry out a ploughing event in the winter on a_field. More...
 
virtual ~Farm (void)
 Farm destructor - deletes all crop instances and empties event queues. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Farm
void AssignPermanentCrop (TTypesOfVegetation tov, int pct)
 Used to assign a permanent crop to an otherwise rotational field polygon. More...
 
void CheckRotationManagementLoop (FarmEvent *ev)
 
virtual int GetFirstCropIndex (TTypesOfLandscapeElement a_type)
 Gets the first crop for the farm. More...
 
int GetFirstDate (TTypesOfVegetation a_tov)
 Gets the start date for a crop type. More...
 
virtual int GetNextCropIndex (int a_rot_index)
 Returns the next crop in the rotation. More...
 
int GetNextCropStartDate (LE *a_field, TTypesOfVegetation &a_curr_veg)
 Returns the start date of the next crop in the rotation. More...
 
virtual void HandleEvents (void)
 If there are events to carry out do this, and perhaps start a new crop. More...
 
int InvIntPartition (vector< tpct > *items, int target)
 Finds all possible sums of the integers in the items array. More...
 
bool LeSwitch (FarmEvent *ev)
 Call do function for any crop with an outstanding event. Signal if the crop has terminated. More...
 
void ReadRotation (std::string fname)
 Reads a rotation file into the rotation. More...
 
- Protected Attributes inherited from Farm
AgroChemIndustryCerealm_agrochemindustrycereal
 
BroadBeansm_broadbeans
 
Carrotsm_carrots
 
CloverGrassGrazed1m_CGG1
 
CloverGrassGrazed2m_CGG2
 
DummyCropPestTestingm_dummycroppesttesting
 
int m_farm_centroidx
 Farm's centroid, value x. Equal to the average of the x centroid values of all farm's fields. More...
 
int m_farm_centroidy
 Farm's centroid, value y. Equal to the average of the y centroid values of all farm's fields. More...
 
int m_farm_num
 
TTypesOfFarm m_farmtype
 
FieldPeasm_fieldpeas
 
FieldPeasSilagem_fieldpeassilage
 
FieldPeasStriglingm_fieldpeasstrigling
 
vector< LE * > m_fields
 
Fodderbeetm_fodderbeet
 
FodderGrassm_foddergrass
 
HunterList m_HuntersList
 A list of hunters allocated to this farm. More...
 
int m_intensity
 
Maizem_maize
 
MaizeSilagem_maizesilage
 
MaizeStriglingm_maizestrigling
 
NLBeetm_nlbeet
 
NLBeetSpringm_nlbeetspring
 
NLCabbagem_nlcabbage
 
NLCabbageSpringm_nlcabbagespring
 
NLCarrotsm_nlcarrots
 
NLCarrotsSpringm_nlcarrotsspring
 
NLCatchPeaCropm_nlcatchpeacrop
 
NLGrassGrazed1m_nlgrassgrazed1
 
NLGrassGrazed1Springm_nlgrassgrazed1spring
 
NLGrassGrazed2m_nlgrassgrazed2
 
NLGrassGrazedLastm_nlgrassgrazedlast
 
NLMaizem_nlmaize
 
NLMaizeSpringm_nlmaizespring
 
NLPermanentGrassGrazedm_nlpermanentgrassgrazed
 
NLPotatoesm_nlpotatoes
 
NLPotatoesSpringm_nlpotatoesspring
 
NLSpringBarleym_nlspringbarley
 
NLSpringBarleySpringm_nlspringbarleyspring
 
NLTulipsm_nltulips
 
NLWinterWheatm_nlwinterwheat
 
NorwegianOatsm_norwegianoats
 
NorwegianPotatoesm_norwegianpotatoes
 
NorwegianSpringBarleym_norwegianspringbarley
 
Oatsm_oats
 
OBarleyPeaCloverGrassm_OBarleyPCG
 
OCarrotsm_ocarrots
 
OCloverGrassGrazed1m_OCGG1
 
OCloverGrassGrazed2m_OCGG2
 
OCloverGrassSilage1m_OCGS1
 
OFieldPeasm_ofieldpeas
 
OFieldPeasSilagem_ofieldpeassilage
 
OFirstYearDangerm_ofirstyeardanger
 
OFodderbeetm_ofodderbeet
 
OGrazingPigsm_ograzingpigs
 
OMaizeSilagem_omaizesilage
 
OOatsm_ooats
 
OPermanentGrassGrazedm_opermgrassgrazed
 
OPotatoesm_opotatoes
 
OrchardCropm_orchardcrop
 
OSBarleySilagem_osbarleysilage
 
OSeedGrass1m_oseedgrass1
 
OSeedGrass2m_oseedgrass2
 
OSpringBarleym_ospringbarley
 
OSpringBarleyExtm_ospringbarleyext
 
OSpringBarleyPigsm_ospringbarleypigs
 
OTriticalem_otriticale
 
FarmManagerm_OurManager
 Pointer to the FarmManager. More...
 
OWinterBarleym_owinterbarley
 
OWinterBarleyExtm_owinterbarleyext
 
OWinterRapem_owinterrape
 
OWinterRyem_owinterrye
 
OWinterWheatm_owinterwheat
 
OWinterWheatUndersownm_owinterwheatundersown
 
OWinterWheatUndersownExtm_owinterwheatundersownext
 
PermanentSetAsidem_permanentsetaside
 
vector< PermCropDatam_PermCrops
 
PermanentGrassGrazedm_permgrassgrazed
 
PermanentGrassLowYieldm_permgrasslowyield
 
PermanentGrassTussockym_permgrasstussocky
 
PLBeansm_plbeans
 
PLBeetm_plbeet
 
PLBeetSprm_plbeetspr
 
PLCarrotsm_plcarrots
 
PLFodderLucerne1m_plfodderlucerne1
 
PLFodderLucerne2m_plfodderlucerne2
 
PLMaizem_plmaize
 
PLMaizeSilagem_plmaizesilage
 
PLPotatoesm_plpotatoes
 
PLSpringBarleym_plspringbarley
 
PLSpringBarleySprm_plspringbarleyspr
 
PLSpringWheatm_plspringwheat
 
PLWinterBarleym_plwinterbarley
 
PLWinterRapem_plwinterrape
 
PLWinterRyem_plwinterrye
 
PLWinterTriticalem_plwintertriticale
 
PLWinterWheatm_plwinterwheat
 
PLWinterWheatLatem_plwinterwheatlate
 
Potatoesm_potatoes
 
PotatoesIndustrym_potatoesindustry
 
LowPriority< FarmEvent * > m_queue
 
vector< TTypesOfVegetationm_rotation
 
int m_rotation_sync_index
 
SpringBarleyCloverGrassm_sbarleyclovergrass
 
SeedGrass1m_seedgrass1
 
SeedGrass2m_seedgrass2
 
SetAsidem_setaside
 
SpringBarleym_springbarley
 
SpringBarleyCloverGrassStriglingm_springbarleyclovergrassstrigling
 
SpringBarleyPeaCloverGrassStriglingm_springbarleypeaclovergrassstrigling
 
SpringBarleyPTreatmentm_springbarleyptreatment
 
SpringBarleySeedm_springbarleyseed
 
SpringBarleySilagem_springbarleysilage
 
SpringBarleySKManagementm_springbarleyskmanagement
 
SpringBarleySprm_springbarleyspr
 
SpringBarleyStriglingm_springbarleystrigling
 
SpringBarleyStriglingCulmm_springbarleystriglingculm
 
SpringBarleyStriglingSinglem_springbarleystriglingsingle
 
SpringRapem_springrape
 
bool m_stockfarmer
 
Sugarbeetm_sugarbeet
 
Triticalem_triticale
 
WinterBarleym_winterbarley
 
WinterBarleyStriglingm_winterbarleystrigling
 
WinterRapem_winterrape
 
WinterRapeStriglingm_winterrapestrigling
 
WinterRyem_winterrye
 
WinterRyeStriglingm_winterryestrigling
 
WinterWheatm_winterwheat
 
WinterWheatStriglingm_winterwheatstrigling
 
WinterWheatStriglingCulmm_winterwheatstriglingculm
 
WinterWheatStriglingSinglem_winterwheatstriglingsingle
 
WWheatPControlm_wwheatpcontrol
 
WWheatPToxicControlm_wwheatptoxiccontrol
 
WWheatPTreatmentm_wwheatptreatment
 
YoungForestCropm_youngforest
 

Detailed Description

A farm that can have its rotation defined by the user at runtime.

Definition at line 1422 of file farm.h.

Constructor & Destructor Documentation

◆ UserDefinedFarm17()

UserDefinedFarm17::UserDefinedFarm17 ( FarmManager a_manager)

Definition at line 2342 of file farm.cpp.

2342  : Farm(a_manager) // 31
2343 {
2345  m_stockfarmer = false;
2346  ReadRotation("UserDefinedFarm17.rot");
2347 }

References Farm::m_farmtype, Farm::m_stockfarmer, Farm::ReadRotation(), and tof_UserDefinedFarm17.


The documentation for this class was generated from the following files:
tof_UserDefinedFarm17
Definition: farm.h:254
Farm::m_farmtype
TTypesOfFarm m_farmtype
Definition: farm.h:940
Farm::ReadRotation
void ReadRotation(std::string fname)
Reads a rotation file into the rotation.
Definition: farm.cpp:816
Farm::m_stockfarmer
bool m_stockfarmer
Definition: farm.h:943
Farm::Farm
Farm(FarmManager *a_manager)
Farm constructor - creates an instance of each possible crop type.
Definition: farm.cpp:1058