ALMaSS Skylark ODDox  1.1
The skylark model description following ODdox protocol
Farm Class Reference

The base class for all farm types. More...

#include <farm.h>

Public Member Functions

virtual void Management (void)
 Starts the main management loop for the farm and performs some error checking. More...
 
virtual void InitiateManagement (void)
 Kicks off the farm's management. More...
 
void AddField (LE *a_newfield)
 Adds a field to a farm. More...
 
void RemoveField (LE *a_field)
 Removes a field from a farm. More...
 
 Farm (FarmManager *a_manager)
 Farm constructor - creates an instance of each possible crop type. More...
 
virtual ~Farm (void)
 Farm destructor - deletes all crop instances and empties event queues. More...
 
void SetFarmNumber (int a_farm_num)
 
int GetFarmNumber (void)
 
virtual bool Spraying_herbicides (TTypesOfVegetation)
 
virtual bool Spraying_fungins (TTypesOfVegetation)
 
virtual double Prob_multiplier ()
 
void Assign_rotation (vector< TTypesOfVegetation >a_new_rotation)
 
polylistListOpenFields (int a_openness)
 Returns a list of fields with openness above a_openness. More...
 
void Centroids ()
 Finds farm's centroids - x and y. More...
 
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...
 
int GetAreaOpenFields (int a_openness)
 Returns the area of the fields above an openness of a_openness. More...
 
APoint GetValidCoords ()
 Returns the valid coordinates of the first field owned by a farm. More...
 
int GetMaxOpenness ()
 Returns the maximum openness score of the fields. More...
 
virtual bool SleepAllDay (LE *a_field, double a_user, int a_days)
 Nothing to to today 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 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 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 AutumnHarrow (LE *a_field, double a_user, int a_days)
 Carry out a harrow 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 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 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 WinterPlough (LE *a_field, double a_user, int a_days)
 Carry out a ploughing event in the winter 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...
 
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 SpringHarrow (LE *a_field, double a_user, int a_days)
 Carry out a harrow 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 HerbicideTreat (LE *a_field, double a_user, int a_days)
 Apply herbicide to a_field. More...
 
virtual bool GrowthRegulator (LE *a_field, double a_user, int a_days)
 Apply growth regulator to a_field. More...
 
virtual bool FungicideTreat (LE *a_field, double a_user, int a_days)
 Apply fungicide to a_field. More...
 
virtual bool InsecticideTreat (LE *a_field, double a_user, int a_days)
 Apply insecticide to a_field. More...
 
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...
 
virtual bool Molluscicide (LE *a_field, double a_user, int a_days)
 Apply molluscidie to a_field. More...
 
virtual bool RowCultivation (LE *a_field, double a_user, int a_days)
 Carry out a harrowing between crop rows 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 StriglingSow (LE *a_field, double a_user, int a_days)
 Carry out a mechanical weeding followed by sowing 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 HillingUp (LE *a_field, double a_user, int a_days)
 Do hilling up on a_field, probably of potatoes. More...
 
virtual bool Water (LE *a_field, double a_user, int a_days)
 Carry out a watering on a_field. 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 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 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...
 
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 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 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 CutToHay (LE *a_field, double a_user, int a_days)
 Carry out hay cutting 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 CutToSilage (LE *a_field, double a_user, int a_days)
 Cut vegetation for silage on a_field. 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 StrawChopping (LE *a_field, double a_user, int a_days)
 Carry out straw chopping 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 HayBailing (LE *a_field, double a_user, int a_days)
 Carry out hay bailing on a_field. More...
 
virtual bool BurnStrawStubble (LE *a_field, double a_user, int a_days)
 Burn stubble on a_field. More...
 
virtual bool StubbleHarrowing (LE *a_field, double a_user, int a_days)
 Carry out stubble harrowing on a_field. 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_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_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_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_Slurry (LE *a_field, double a_user, int a_days)
 Apply slurry 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_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_Manure (LE *a_field, double a_user, int a_days)
 Spread manure 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_Sludge (LE *a_field, double a_user, int a_days)
 Spread sewege 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_Calcium (LE *a_field, double a_user, int a_days)
 Calcium applied on a_field owned by an arable 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_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_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_Slurry (LE *a_field, double a_user, int a_days)
 Spready slurry 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_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_Manure (LE *a_field, double a_user, int a_days)
 Spread manure on a_field owned by an 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_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_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_Calcium (LE *a_field, double a_user, int a_days)
 Calcium applied on a_field owned by a stock farmer. More...
 
virtual bool Biocide (LE *a_field, double a_user, int a_days)
 Biocide applied 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 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 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 FlowerCutting (LE *a_field, double a_user, int a_days)
 Flower cutting 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 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...
 
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...
 
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...
 
TTypesOfFarm GetType (void)
 
int GetArea (void)
 Returns the area of arable fields owned by that farm. More...
 
int GetTotalArea (void)
 Returns the area of all fields owned by that farm. More...
 
double GetAreaDouble (void)
 Returns the area of arable fields owned by that farm. More...
 
bool IsStockFarmer (void)
 
virtual void MakeStockFarmer (void)
 
int GetIntensity (void)
 
APoint GetCentroids ()
 
TTypesOfVegetation GetPreviousCrop (int a_index)
 
TTypesOfVegetation GetCrop (int a_index)
 
TTypesOfVegetation GetNextCrop (int a_index)
 
void AddHunter (Hunter *a_hunter)
 
void RemoveHunter (Hunter *a_hunter)
 

Protected Member Functions

int GetFirstDate (TTypesOfVegetation a_tov)
 Gets the start date for a crop type. More...
 
int GetNextCropStartDate (LE *a_field, TTypesOfVegetation &a_curr_veg)
 Returns the start date of the next crop in the rotation. More...
 
virtual int GetFirstCropIndex (TTypesOfLandscapeElement a_type)
 Gets the first crop for the farm. More...
 
virtual int GetNextCropIndex (int a_rot_index)
 Returns 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...
 
bool LeSwitch (FarmEvent *ev)
 Call do function for any crop with an outstanding event. Signal if the crop has terminated. More...
 
void CheckRotationManagementLoop (FarmEvent *ev)
 
void ReadRotation (std::string fname)
 Reads a rotation file into the rotation. More...
 
void AssignPermanentCrop (TTypesOfVegetation tov, int pct)
 Used to assign a permanent crop to an otherwise rotational field polygon. More...
 
int InvIntPartition (vector< tpct > *items, int target)
 Finds all possible sums of the integers in the items array. More...
 

Protected Attributes

FarmManagerm_OurManager
 Pointer to the FarmManager. More...
 
LowPriority< FarmEvent * > m_queue
 
vector< LE * > m_fields
 
vector< TTypesOfVegetationm_rotation
 
vector< PermCropDatam_PermCrops
 
TTypesOfFarm m_farmtype
 
HunterList m_HuntersList
 A list of hunters allocated to this farm. More...
 
bool m_stockfarmer
 
int m_farm_num
 
int m_rotation_sync_index
 
int m_intensity
 
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...
 
Carrotsm_carrots
 
BroadBeansm_broadbeans
 
FodderGrassm_foddergrass
 
CloverGrassGrazed1m_CGG1
 
CloverGrassGrazed2m_CGG2
 
FieldPeasm_fieldpeas
 
FieldPeasSilagem_fieldpeassilage
 
Fodderbeetm_fodderbeet
 
Sugarbeetm_sugarbeet
 
OFodderbeetm_ofodderbeet
 
Maizem_maize
 
MaizeSilagem_maizesilage
 
OMaizeSilagem_omaizesilage
 
OBarleyPeaCloverGrassm_OBarleyPCG
 
OCarrotsm_ocarrots
 
OCloverGrassGrazed1m_OCGG1
 
OCloverGrassGrazed2m_OCGG2
 
OCloverGrassSilage1m_OCGS1
 
OFieldPeasm_ofieldpeas
 
OFieldPeasSilagem_ofieldpeassilage
 
OFirstYearDangerm_ofirstyeardanger
 
OGrazingPigsm_ograzingpigs
 
OrchardCropm_orchardcrop
 
Oatsm_oats
 
OOatsm_ooats
 
OPermanentGrassGrazedm_opermgrassgrazed
 
OPotatoesm_opotatoes
 
OSeedGrass1m_oseedgrass1
 
OSeedGrass2m_oseedgrass2
 
OSpringBarleym_ospringbarley
 
OSpringBarleyExtm_ospringbarleyext
 
OSpringBarleyPigsm_ospringbarleypigs
 
OSBarleySilagem_osbarleysilage
 
OTriticalem_otriticale
 
OWinterBarleym_owinterbarley
 
OWinterBarleyExtm_owinterbarleyext
 
OWinterRapem_owinterrape
 
OWinterRyem_owinterrye
 
OWinterWheatUndersownm_owinterwheatundersown
 
OWinterWheatm_owinterwheat
 
OWinterWheatUndersownExtm_owinterwheatundersownext
 
PermanentGrassGrazedm_permgrassgrazed
 
PermanentGrassLowYieldm_permgrasslowyield
 
PermanentGrassTussockym_permgrasstussocky
 
PermanentSetAsidem_permanentsetaside
 
Potatoesm_potatoes
 
PotatoesIndustrym_potatoesindustry
 
SeedGrass1m_seedgrass1
 
SeedGrass2m_seedgrass2
 
SetAsidem_setaside
 
SpringBarleym_springbarley
 
SpringBarleySprm_springbarleyspr
 
SpringBarleySKManagementm_springbarleyskmanagement
 
SpringBarleyPTreatmentm_springbarleyptreatment
 
SpringBarleyCloverGrassm_sbarleyclovergrass
 
SpringBarleySeedm_springbarleyseed
 
SpringBarleySilagem_springbarleysilage
 
SpringRapem_springrape
 
Triticalem_triticale
 
WinterBarleym_winterbarley
 
WinterRapem_winterrape
 
WinterRyem_winterrye
 
WinterWheatm_winterwheat
 
WWheatPControlm_wwheatpcontrol
 
WWheatPToxicControlm_wwheatptoxiccontrol
 
WWheatPTreatmentm_wwheatptreatment
 
AgroChemIndustryCerealm_agrochemindustrycereal
 
WinterWheatStriglingm_winterwheatstrigling
 
WinterWheatStriglingCulmm_winterwheatstriglingculm
 
WinterWheatStriglingSinglem_winterwheatstriglingsingle
 
SpringBarleyCloverGrassStriglingm_springbarleyclovergrassstrigling
 
SpringBarleyStriglingm_springbarleystrigling
 
SpringBarleyStriglingCulmm_springbarleystriglingculm
 
SpringBarleyStriglingSinglem_springbarleystriglingsingle
 
MaizeStriglingm_maizestrigling
 
WinterRapeStriglingm_winterrapestrigling
 
WinterRyeStriglingm_winterryestrigling
 
WinterBarleyStriglingm_winterbarleystrigling
 
FieldPeasStriglingm_fieldpeasstrigling
 
SpringBarleyPeaCloverGrassStriglingm_springbarleypeaclovergrassstrigling
 
YoungForestCropm_youngforest
 
NorwegianPotatoesm_norwegianpotatoes
 
NorwegianOatsm_norwegianoats
 
NorwegianSpringBarleym_norwegianspringbarley
 
PLWinterWheatm_plwinterwheat
 
PLWinterRapem_plwinterrape
 
PLWinterBarleym_plwinterbarley
 
PLWinterTriticalem_plwintertriticale
 
PLWinterRyem_plwinterrye
 
PLSpringWheatm_plspringwheat
 
PLSpringBarleym_plspringbarley
 
PLMaizem_plmaize
 
PLMaizeSilagem_plmaizesilage
 
PLPotatoesm_plpotatoes
 
PLBeetm_plbeet
 
PLFodderLucerne1m_plfodderlucerne1
 
PLFodderLucerne2m_plfodderlucerne2
 
PLCarrotsm_plcarrots
 
PLSpringBarleySprm_plspringbarleyspr
 
PLWinterWheatLatem_plwinterwheatlate
 
PLBeetSprm_plbeetspr
 
PLBeansm_plbeans
 
NLBeetm_nlbeet
 
NLCarrotsm_nlcarrots
 
NLMaizem_nlmaize
 
NLPotatoesm_nlpotatoes
 
NLSpringBarleym_nlspringbarley
 
NLWinterWheatm_nlwinterwheat
 
NLCabbagem_nlcabbage
 
NLTulipsm_nltulips
 
NLGrassGrazed1m_nlgrassgrazed1
 
NLGrassGrazed1Springm_nlgrassgrazed1spring
 
NLGrassGrazed2m_nlgrassgrazed2
 
NLGrassGrazedLastm_nlgrassgrazedlast
 
NLPermanentGrassGrazedm_nlpermanentgrassgrazed
 
NLBeetSpringm_nlbeetspring
 
NLCarrotsSpringm_nlcarrotsspring
 
NLMaizeSpringm_nlmaizespring
 
NLPotatoesSpringm_nlpotatoesspring
 
NLSpringBarleySpringm_nlspringbarleyspring
 
NLCabbageSpringm_nlcabbagespring
 
NLCatchPeaCropm_nlcatchpeacrop
 
DummyCropPestTestingm_dummycroppesttesting
 

Detailed Description

The base class for all farm types.

Constructor & Destructor Documentation

◆ Farm()

Farm::Farm ( FarmManager a_manager)

Farm constructor - creates an instance of each possible crop type.

1059 {
1060  m_OurManager = a_manager;
1061  m_carrots = new Carrots;
1062  m_broadbeans = new BroadBeans;
1063  m_CGG1 = new CloverGrassGrazed1;
1064  m_CGG2 = new CloverGrassGrazed2;
1065  m_fieldpeas = new FieldPeas;
1067  m_fodderbeet = new Fodderbeet;
1068  m_sugarbeet = new Sugarbeet;
1069  m_ofodderbeet = new OFodderbeet;
1070  m_foddergrass = new FodderGrass;
1071  m_maize = new Maize;
1072  m_maizesilage = new MaizeSilage;
1075  m_ocarrots = new OCarrots;
1079  m_ofieldpeas = new OFieldPeas;
1083  m_orchardcrop = new OrchardCrop;
1084  m_oats = new Oats;
1085  m_ooats = new OOats;
1087  m_opotatoes = new OPotatoes;
1088  m_oseedgrass1 = new OSeedGrass1;
1089  m_oseedgrass2 = new OSeedGrass2;
1096  m_owinterrape = new OWinterRape;
1097  m_owinterrye = new OWinterRye;
1105  m_potatoes = new Potatoes;
1108  m_seedgrass1 = new SeedGrass1;
1109  m_seedgrass2 = new SeedGrass2;
1110  m_setaside = new SetAside;
1117  m_springrape = new SpringRape;
1118  m_triticale = new Triticale;
1119  m_otriticale = new OTriticale;
1121  m_winterrape = new WinterRape;
1122  m_winterrye = new WinterRye;
1123  m_winterwheat = new WinterWheat;
1149  m_plwinterrye = new PLWinterRye;
1152  m_plmaize = new PLMaize;
1154  m_plpotatoes = new PLPotatoes;
1155  m_plbeet = new PLBeet;
1158  m_plcarrots = new PLCarrots;
1161  m_plbeetspr = new PLBeetSpr;
1162  m_plbeans = new PLBeans;
1163 
1164  m_nlbeet = new NLBeet;
1165  m_nlcarrots = new NLCarrots;
1166  m_nlmaize = new NLMaize;
1167  m_nlpotatoes = new NLPotatoes;
1170  m_nlcabbage = new NLCabbage;
1171  m_nltulips = new NLTulips;
1184 
1186 
1187  m_rotation_sync_index = -1;
1188  // Defaults that need to be overridden when necessary
1189  m_stockfarmer = false;
1190  m_intensity = 0;
1191  m_HuntersList.resize(0); // Set the number of hunters to zero at the start.
1192 }

◆ ~Farm()

Farm::~Farm ( void  )
virtual

Farm destructor - deletes all crop instances and empties event queues.

1199  {
1200  delete m_carrots;
1201  delete m_broadbeans;
1202  delete m_CGG2;
1203  delete m_CGG1;
1204  delete m_fieldpeas;
1205  delete m_fieldpeassilage;
1206  delete m_fodderbeet;
1207  delete m_sugarbeet;
1208  delete m_ofodderbeet;
1209  delete m_foddergrass;
1210  delete m_maizesilage;
1211  delete m_omaizesilage;
1212  delete m_maize;
1213  delete m_ocarrots;
1214  delete m_OCGG1;
1215  delete m_OCGG2;
1216  delete m_OCGS1;
1217  delete m_ofieldpeas;
1218  delete m_ofieldpeassilage;
1219  delete m_ofirstyeardanger;
1220  delete m_ograzingpigs;
1221  delete m_orchardcrop;
1222  delete m_ooats;
1223  delete m_oats;
1224  delete m_opermgrassgrazed;
1225  delete m_opotatoes;
1226  delete m_ospringbarley;
1227  delete m_ospringbarleyext;
1228  delete m_osbarleysilage;
1229  delete m_ospringbarleypigs;
1230  delete m_owinterbarley;
1231  delete m_owinterbarleyext;
1232  delete m_owinterrape;
1233  delete m_owinterrye;
1234  delete m_owinterwheatundersown;
1236  delete m_OBarleyPCG;
1237  delete m_permanentsetaside;
1238  delete m_permgrassgrazed;
1239  delete m_permgrasstussocky;
1240  delete m_permgrasslowyield;
1241  delete m_potatoes;
1242  delete m_potatoesindustry;
1243  delete m_sbarleyclovergrass;
1244  delete m_seedgrass2;
1245  delete m_seedgrass1;
1246  delete m_setaside;
1247  delete m_springbarley;
1248  delete m_springbarleyptreatment;
1250  delete m_springbarleyseed;
1251  delete m_springrape;
1252  delete m_springbarleysilage;
1253  delete m_agrochemindustrycereal;
1254  delete m_triticale;
1255  delete m_winterbarley;
1256  delete m_winterrape;
1257  delete m_winterrye;
1258  delete m_winterwheat;
1259  delete m_wwheatpcontrol;
1260  delete m_wwheatptoxiccontrol;
1261  delete m_wwheatptreatment;
1262  delete m_winterwheatstrigling;
1266  delete m_springbarleystrigling;
1269  delete m_maizestrigling;
1270  delete m_winterrapestrigling;
1271  delete m_winterryestrigling;
1272  delete m_winterbarleystrigling;
1273  delete m_fieldpeasstrigling;
1275  delete m_youngforest;
1276  delete m_norwegianoats;
1277  delete m_norwegianspringbarley;
1278 
1279  delete m_plwinterwheat;
1280  delete m_plwinterrape;
1281  delete m_plwinterbarley;
1282  delete m_plwintertriticale;
1283  delete m_plwinterrye;
1284  delete m_plspringwheat;
1285  delete m_plspringbarley;
1286  delete m_plmaize;
1287  delete m_plmaizesilage;
1288  delete m_plpotatoes;
1289  delete m_plbeet;
1290  delete m_plfodderlucerne1;
1291  delete m_plfodderlucerne2;
1292  delete m_plcarrots;
1293  delete m_plspringbarleyspr;
1294  delete m_plwinterwheatlate;
1295  delete m_plbeetspr;
1296  delete m_plbeans;
1297 
1298  delete m_nlbeet;
1299  delete m_nlcarrots;
1300  delete m_nlmaize;
1301  delete m_nlpotatoes;
1302  delete m_nlspringbarley;
1303  delete m_nlwinterwheat;
1304  delete m_nlcabbage;
1305  delete m_nltulips;
1306  delete m_nlgrassgrazed1;
1307  delete m_nlgrassgrazed1spring;
1308  delete m_nlgrassgrazed2;
1309  delete m_nlgrassgrazedlast;
1310  delete m_nlpermanentgrassgrazed;
1311  delete m_nlbeetspring;
1312  delete m_nlcarrotsspring;
1313  delete m_nlmaizespring;
1314  delete m_nlpotatoesspring;
1315  delete m_nlspringbarleyspring;
1316  delete m_nlcabbagespring;
1317  delete m_nlcatchpeacrop;
1318 
1319  delete m_dummycroppesttesting;
1320 
1321  LowPriPair < FarmEvent * > pair;
1322 
1323  while (!m_queue.Empty()) {
1324  pair = m_queue.Bottom();
1325  m_queue.Pop();
1326  delete pair.m_element;
1327  }
1328 }

Member Function Documentation

◆ AddField()

void Farm::AddField ( LE *  a_newfield)

Adds a field to a farm.

1447  {
1448  int i = (int) m_fields.size();
1449 
1450  m_fields.resize( i + 1 );
1451  m_fields[ i ] = a_newfield;
1452  // Must set the rot index to something other than -1, but identify it as not usefully set as yet.
1453  TTypesOfLandscapeElement ele = a_newfield->GetElementType();
1454  switch (ele) {
1456  case tole_YoungForest:
1457  case tole_PermPasture:
1460  case tole_Orchard:
1461  case tole_PlantNursery:
1462  m_fields[i]->SetRotIndex(-2);
1463  break;
1464  default:
1465  m_fields[ i ]->SetRotIndex(-1);
1466  }
1467 }

References tole_Orchard, tole_PermanentSetaside, tole_PermPasture, tole_PermPastureLowYield, tole_PermPastureTussocky, tole_PlantNursery, and tole_YoungForest.

◆ AddHunter()

void Farm::AddHunter ( Hunter *  a_hunter)
inline
922  {
923  m_HuntersList.push_back( a_hunter );
924  }

References m_HuntersList.

◆ AddNewEvent()

void Farm::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.

790  {
791  FarmEvent * ev = new FarmEvent( a_event, a_field, a_todo, a_run, a_lock, a_start, a_first_year, a_crop );
792  m_queue.Push( ev, a_date );
793 }

Referenced by Crop::SimpleEvent_().

◆ Assign_rotation()

void Farm::Assign_rotation ( vector< TTypesOfVegetation a_new_rotation)
1488  {
1489 
1490  m_rotation.clear();
1491  m_rotation = a_new_rotation;
1492 
1493 }

Referenced by FarmManager::Switch_rotation().

◆ AssignPermanentCrop()

void Farm::AssignPermanentCrop ( TTypesOfVegetation  tov,
int  pct 
)
protected

Used to assign a permanent crop to an otherwise rotational field polygon.

2401  {
2402  // Assumes that m_fields has all the fields already in it, and those that are occupied by permanent tole types
2403  // are denoted by -2 or -4 in rotindex, -1 is unassigned - can't use enum because positive values have other meanings
2404 
2405  // Here we can save some time if we have to allocate all the fields to one permanent crop
2406  if (a_pct == 100)
2407  {
2408  for (auto cfi = m_fields.begin(); cfi != m_fields.end(); ++cfi)
2409  {
2410  // Set the field as non-rotating
2411  (*cfi)->SetRotIndex(-4);
2412  // Assign the crop, and weeds are assumed to be undefined
2413  (*cfi)->SetVegType(a_tov, tov_Undefined);
2414  }
2415  return;
2416  }
2417 
2418  tpct a_tpct;
2419  // create a copy of the field vector and call it fields_cpy
2420  vector<LE*> fields_cpy;
2421  fields_cpy.resize(m_fields.size());
2422  copy(m_fields.begin(), m_fields.end(), fields_cpy.begin());
2423  vector<tpct> pcts;
2424  double area = 0.0;
2425 
2426 
2427  // First get the areas of all fields and then convert these to percentages
2428  int sz = (int) fields_cpy.size();
2429  // loop through the fields vector and remove any fields already assigned to permanent crops
2430  for (int i = sz - 1; i >= 0; i--) {
2431  if (fields_cpy[i]->GetRotIndex() < -1) {
2432  fields_cpy.erase(fields_cpy.begin() + i);
2433  }
2434  }
2435  // sum up the area
2436  for (auto cfi = fields_cpy.begin(); cfi != fields_cpy.end(); ++cfi) area += (*cfi)->GetArea();
2437 
2438  // Here we can take action if we only have a single field
2439  int fnos = (int) fields_cpy.size();
2440  if (fnos<1) return; // No fields to allocate, jump out
2441  else if (fnos==1) {
2442  // Use the pct as the chance that our single field is assigned
2443  if (random(100)>=a_pct) return;
2444  else {
2445  // Add field by default
2446  fields_cpy[0]->SetRotIndex(-4);
2447  // Assign the crop
2448  fields_cpy[0]->SetVegType(a_tov, tov_Undefined);
2449  return;
2450  }
2451  }
2452  // By here we have more than one field to potentially allocate to
2453  for (int i=0; i<fnos; i++) {
2454  a_tpct.pct = (int) floor(0.5+((fields_cpy[i]->GetArea()/area)*100));
2455  a_tpct.index = i;
2456  pcts.push_back(a_tpct);
2457  }
2458  // We need to look for combinations of fields that are close to our target.
2459  // First we can sort the array and ignore any that are greater than pct
2460  sort (pcts.begin(), pcts.end(), CompPcts); // results in ordering on increasing pct
2461  // now remove all those with pct>target+10% to save loads of time in the inverse integer partition
2462  int index=-1;
2463  int ind=0;
2464  int apct=a_pct+10; // Lets assume we have a tolerance of 10%
2465  while ((index==-1) && (ind< (int)pcts.size())) {
2466  if (pcts[ind++].pct>apct) index=ind;
2467  }
2468  if (index!=-1) pcts.erase(pcts.begin()+index,pcts.end());
2469  // Now find the best combination of fields to get close to our target & set them
2470  int bits = InvIntPartition(&pcts,a_pct);
2471  int mask=1;
2472  ind = 0;
2473  int used=0;
2474  //double pctused = 0.0;
2475  double check = 0.0;
2476  for (int h=0; h< (int)pcts.size(); h++) check+=fields_cpy[pcts[h].index]->GetArea();
2477  while (bits>0) {
2478  if ((bits & mask) > 0) {
2479  // Set the field as non-rotating
2480  fields_cpy[pcts[ind].index]->SetRotIndex(-4);
2481  // Assign the crop
2482  fields_cpy[pcts[ind].index]->SetVegType(a_tov, tov_Undefined);
2483  used += (int) fields_cpy[pcts[ind].index]->GetArea();
2484  //pctused = used/area;
2485  bits -= mask;
2486  }
2487  mask = mask << 1;
2488  ind++;
2489  }
2490 }

References CompPcts(), GetArea(), tpct::index, InvIntPartition(), m_fields, tpct::pct, and tov_Undefined.

Referenced by OptimisingFarm::InitiateManagement().

◆ AutumnHarrow()

bool Farm::AutumnHarrow ( LE *  a_field,
double  a_user,
int  a_days 
)
virtual

Carry out a harrow event in the autumn on a_field.

262 {
263 
264  if ( (0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
265  a_field->Trace( autumn_harrow );
266  a_field->SetLastTreatment( autumn_harrow );
267  // Apply 90% mortality to the insects
268  a_field->InsectMortality( 0.1 );
269  // Reduce the vegetation to zero
270  a_field->ZeroVeg();
271  int pref=a_field->GetUnsprayedMarginPolyRef();
272  if (pref!=-1){
273  // Must have an unsprayed margin so need to pass the information on to it
274  LE* um=g_landscape_p->SupplyLEPointer(pref);
275  um->SetLastTreatment( autumn_harrow );
276  um->InsectMortality( 0.1 );
277  um->ZeroVeg();
278  }
279  return true;
280  }
281  return false;
282 }

References autumn_harrow, DO_IT_PROB, g_landscape_p, and Landscape::SupplyLEPointer().

Referenced by WinterRapeStrigling::Do(), OWinterBarleyExt::Do(), OWinterBarley::Do(), OWinterRye::Do(), OTriticale::Do(), OWinterWheatUndersown::Do(), OWinterWheatUndersownExt::Do(), OWinterWheat::Do(), OWinterRape::Do(), Triticale::Do(), WinterRyeStrigling::Do(), WinterRye::Do(), WWheatPControl::Do(), WinterWheatStriglingSingle::Do(), WinterWheatStriglingCulm::Do(), WinterWheatStrigling::Do(), WWheatPToxicControl::Do(), WWheatPTreatment::Do(), WinterRape::Do(), WinterBarleyStrigling::Do(), AgroChemIndustryCereal::Do(), WinterBarley::Do(), and WinterWheat::Do().

◆ AutumnPlough()

bool Farm::AutumnPlough ( LE *  a_field,
double  a_user,
int  a_days 
)
virtual

Carry out a ploughing event in the autumn on a_field.

133 {
134 
135  // LE is a pointer to the field element
136  // a_user is a pointer to the farm
137  // a_days is the end of the operation time - today
138  // if a_days <0 then the time to do it is passed
139  // the line below reads 'plough if last day possible OR if not raining and pass a probability test
140  if ( (0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
141  // this bit sets up the events to occur when ploughing occurs
142  // The trace below is for debugging checks
143  a_field->Trace( autumn_plough );
144  // Record the event for this field, so other objects can find out it has happened
145  a_field->SetLastTreatment( autumn_plough );
146  // Apply mortality to the insects present, in this case 90%. This only affects the general insect model, any ALMaSS model species need to take their specific action.
147  a_field->InsectMortality( 0.1 );
148  // Reduce the vegetation, in this case to zero
149  a_field->ZeroVeg();
150  // If the field has a field margin, then do all this to the field margin too. In events that don't occur on an unsprayed margin, e.g. insecticide, then is part is skipped.
151  int pref=a_field->GetUnsprayedMarginPolyRef();
152  if (pref!=-1){
153  // Must have an unsprayed margin so need to pass the information on to it
154  LE* um=g_landscape_p->SupplyLEPointer(pref);
155  um->SetLastTreatment( autumn_plough );
156  um->InsectMortality( 0.1 );
157  um->ZeroVeg();
158  }
159  return true; // completed
160  }
161  return false; // not completed
162 }

References autumn_plough, DO_IT_PROB, g_landscape_p, and Landscape::SupplyLEPointer().

Referenced by NorwegianOats::Do(), WinterRapeStrigling::Do(), NorwegianSpringBarley::Do(), OWinterBarleyExt::Do(), OWinterBarley::Do(), OWinterRye::Do(), Maize::Do(), OTriticale::Do(), MaizeStrigling::Do(), MaizeSilage::Do(), OSpringBarleyExt::Do(), Oats::Do(), SpringBarleySeed::Do(), OSpringBarley::Do(), FieldPeasStrigling::Do(), FieldPeasSilage::Do(), SpringBarleyCloverGrassStrigling::Do(), FieldPeas::Do(), OWinterWheat::Do(), OWinterWheatUndersown::Do(), OWinterWheatUndersownExt::Do(), SpringBarleyCloverGrass::Do(), OFodderbeet::Do(), Triticale::Do(), OWinterRape::Do(), SpringBarleyPeaCloverGrassStrigling::Do(), PotatoesIndustry::Do(), Fodderbeet::Do(), NorwegianPotatoes::Do(), Potatoes::Do(), SpringBarleySKManagement::Do(), SpringBarleySilage::Do(), WinterRyeStrigling::Do(), SpringBarleyStriglingCulm::Do(), SpringBarleyStriglingSingle::Do(), WinterRye::Do(), SpringBarleyStrigling::Do(), SpringBarleyPTreatment::Do(), SpringBarley::Do(), WWheatPControl::Do(), WinterWheatStriglingSingle::Do(), WinterWheatStriglingCulm::Do(), WinterWheatStrigling::Do(), WWheatPTreatment::Do(), WWheatPToxicControl::Do(), WinterRape::Do(), WinterBarleyStrigling::Do(), AgroChemIndustryCereal::Do(), WinterBarley::Do(), NLTulips::Do(), and WinterWheat::Do().

◆ AutumnRoll()

bool Farm::AutumnRoll ( LE *  a_field,
double  a_user,
int  a_days 
)
virtual

Carry out a roll event in the autumn on a_field.

289 {
290 
291  if ( (0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
292  a_field->Trace( autumn_roll );
293  a_field->SetLastTreatment( autumn_roll );
294  a_field->ZeroVeg();
295  int pref=a_field->GetUnsprayedMarginPolyRef();
296  if (pref!=-1){
297  // Must have an unsprayed margin so need to pass the information on to it
298  LE* um=g_landscape_p->SupplyLEPointer(pref);
299  um->SetLastTreatment( autumn_roll );
300  um->ZeroVeg();
301  }
302  return true;
303  }
304  return false;
305 }

References autumn_roll, DO_IT_PROB, g_landscape_p, and Landscape::SupplyLEPointer().

Referenced by OTriticale::Do(), Triticale::Do(), WinterRyeStrigling::Do(), WinterRye::Do(), WWheatPControl::Do(), WinterWheatStriglingSingle::Do(), WinterWheatStrigling::Do(), WinterWheatStriglingCulm::Do(), WWheatPToxicControl::Do(), WWheatPTreatment::Do(), AgroChemIndustryCereal::Do(), and WinterWheat::Do().

◆ AutumnSow()

bool Farm::AutumnSow ( LE *  a_field,
double  a_user,
int  a_days 
)
virtual

Carry out a sowing event in the autumn on a_field.

365 {
366 
367  if ( (0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
368  a_field->Trace( autumn_sow );
369  a_field->SetLastTreatment( autumn_sow );
370  a_field->SetGrowthPhase( sow );
371  a_field->SetLastSownVeg(a_field->GetVegType());
372  // Reduce the vegetation to zero
373  a_field->ZeroVeg();
374  int pref=a_field->GetUnsprayedMarginPolyRef();
375  if (pref!=-1){
376  // Must have an unsprayed margin so need to pass the information on to it
377  LE* um=g_landscape_p->SupplyLEPointer(pref);
378  um->SetLastTreatment( autumn_sow );
379  um->SetGrowthPhase( sow );
380  um->ZeroVeg();
381  um->SetLastSownVeg(um->GetVegType());
382  }
383  return true;
384  }
385  return false;
386 }

References autumn_sow, DO_IT_PROB, g_landscape_p, and Landscape::SupplyLEPointer().

Referenced by WinterRapeStrigling::Do(), OWinterBarleyExt::Do(), OWinterBarley::Do(), OWinterRye::Do(), OTriticale::Do(), OWinterWheatUndersown::Do(), OWinterWheatUndersownExt::Do(), OWinterWheat::Do(), OWinterRape::Do(), Triticale::Do(), WinterRyeStrigling::Do(), WinterRye::Do(), WWheatPControl::Do(), WinterWheatStriglingSingle::Do(), WinterWheatStriglingCulm::Do(), WinterWheatStrigling::Do(), WWheatPToxicControl::Do(), WWheatPTreatment::Do(), WinterRape::Do(), WinterBarleyStrigling::Do(), AgroChemIndustryCereal::Do(), WinterBarley::Do(), and WinterWheat::Do().

◆ BedForming()

bool Farm::BedForming ( LE *  a_field,
double  a_user,
int  a_days 
)
virtual

Do bed forming up on a_field, probably of carrots.

1691 {
1692 
1693  if ((0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
1694  a_field->Trace(bed_forming);
1695  a_field->SetLastTreatment(bed_forming);
1696  a_field->InsectMortality(0.75);
1697  a_field->ZeroVeg();
1698  a_field->SetTramlinesDecay(EL_TRAMLINE_DECAYTIME);
1699  int pref = a_field->GetUnsprayedMarginPolyRef();
1700  if (pref != -1) {
1701  // Must have an unsprayed margin so need to pass the information on to it
1702  LE* um = g_landscape_p->SupplyLEPointer(pref);
1703  um->SetLastTreatment(bed_forming);
1704  um->ZeroVeg();
1705  um->InsectMortality(0.75);
1706  um->SetTramlinesDecay(EL_TRAMLINE_DECAYTIME);
1707  }
1708  return true;
1709  }
1710  return false;
1711 }

References bed_forming, DO_IT_PROB, g_landscape_p, and Landscape::SupplyLEPointer().

◆ Biocide()

bool Farm::Biocide ( LE *  a_field,
double  a_user,
int  a_days 
)
virtual

Biocide applied on a_field.

2416 {
2417  if ((0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
2418  a_field->Trace(biocide);
2419  a_field->SetLastTreatment(biocide);
2420  a_field->SetTramlinesDecay(EL_TRAMLINE_DECAYTIME);
2421  int pref = a_field->GetUnsprayedMarginPolyRef();
2422  if (pref != -1) {
2423  // Must have an unsprayed margin so need to pass the information on to it
2424  LE* um = g_landscape_p->SupplyLEPointer(pref);
2425  um->SetLastTreatment(biocide);
2426  um->SetTramlinesDecay(EL_TRAMLINE_DECAYTIME);
2427  }
2428  return true;
2429  }
2430  return false;
2431 }

References biocide, DO_IT_PROB, g_landscape_p, and Landscape::SupplyLEPointer().

◆ BulbHarvest()

bool Farm::BulbHarvest ( LE *  a_field,
double  a_user,
int  a_days 
)
virtual

Carry out a bulb harvest on a_field.

2466 {
2467  //5 days good weather before
2468  if ((0 >= a_days) || ((g_weather->GetRainPeriod(g_date->Date(), 5) < 0.1) && DoIt(DO_IT_PROB))) {
2469  a_field->Trace(bulb_harvest);
2470  a_field->SetLastTreatment(bulb_harvest);
2471  a_field->SetGrowthPhase(harvest1);
2472  // Here we have to do a little skip to avoid too low insect populations after harvest, but a correct veg biomass
2473  a_field->InsectMortality(0.3);
2474  // remove all vegetation
2475  a_field->ZeroVeg();
2476  double insects = a_field->GetInsectPop();
2477  a_field->ResetDigestability();
2478  a_field->RecalculateBugsNStuff();
2479  a_field->SetInsectPop(insects);
2480  a_field->SetTramlinesDecay(EL_TRAMLINE_DECAYTIME);
2481  int pref = a_field->GetUnsprayedMarginPolyRef();
2482  if (pref != -1) {
2483  // Must have an unsprayed margin so need to pass the information on to it
2484  LE* um = g_landscape_p->SupplyLEPointer(pref);
2485  um->SetLastTreatment(bulb_harvest);
2486  um->SetGrowthPhase(harvest1);
2487  um->InsectMortality(0.3);
2488  um->ZeroVeg();
2489  um->SetTramlinesDecay(EL_TRAMLINE_DECAYTIME);
2490  um->ResetDigestability();
2491  um->RecalculateBugsNStuff();
2492  }
2493  return true;
2494  }
2495  return false;
2496 }

References bulb_harvest, DO_IT_PROB, g_landscape_p, and Landscape::SupplyLEPointer().

◆ BurnStrawStubble()

bool Farm::BurnStrawStubble ( LE *  a_field,
double  a_user,
int  a_days 
)
virtual

Burn stubble on a_field.

2237 {
2238 
2239  if ( (0 >= a_days) && (g_weather->GetRainPeriod(g_date->Date(),3)>0.1))
2240  {
2241  return true;
2242  }
2243  if ( (0 >= a_days) || ((g_weather->GetRainPeriod(g_date->Date(),3)<0.1)
2244  && DoIt(DO_IT_PROB)))
2245  {
2246  a_field->Trace( burn_straw_stubble );
2247  a_field->SetLastTreatment( burn_straw_stubble );
2248  a_field->InsectMortality( 0.4 );
2249  a_field->ReduceVeg( 0.2 );
2250  a_field->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
2251  int pref=a_field->GetUnsprayedMarginPolyRef();
2252  if (pref!=-1){
2253  // Must have an unsprayed margin so need to pass the information on to it
2254  LE* um=g_landscape_p->SupplyLEPointer(pref);
2255  um->SetLastTreatment( burn_straw_stubble );
2256  um->ReduceVeg( 0.2 );
2257  um->InsectMortality( 0.4 );
2258  um->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
2259  }
2260  return true;
2261  }
2262  return false;
2263 }

References burn_straw_stubble, DO_IT_PROB, g_landscape_p, and Landscape::SupplyLEPointer().

Referenced by OSeedGrass1::Do(), OSeedGrass2::Do(), SeedGrass1::Do(), SeedGrass2::Do(), and SpringBarleySeed::Do().

◆ CattleIsOut()

bool Farm::CattleIsOut ( LE *  a_field,
double  a_user,
int  a_days,
int  a_max 
)
virtual

Generate a 'cattle_out' event for every day the cattle are on a_field.

This is the main grazing method and as such is called by all grazed field management plans each day the cattle are out.

1975 {
1979  double biomass = a_field->GetVegBiomass();
1980  if (biomass > 100.0)
1981  {
1982  a_field->SetLastTreatment(cattle_out);
1983  a_field->Trace(cattle_out);
1984  // Reduce the vegetation because of grazing
1985  //double h=a_field->GetVegHeight();
1986  //double reduc = 1-(l_farm_cattle_veg_reduce.value()*((h-15)/15));
1987  //a_field->ReduceVeg_Extended( reduc );
1988  a_field->GrazeVegetation( l_farm_cattle_veg_reduce.value( ), false );
1989  int pref = a_field->GetUnsprayedMarginPolyRef();
1990  if (pref != -1)
1991  {
1992  // Must have an unsprayed margin so need to pass the information on to it
1993  LE* um = g_landscape_p->SupplyLEPointer(pref);
1994  um->SetLastTreatment(cattle_out);
1995  um->GrazeVegetation( l_farm_cattle_veg_reduce.value( ), false );
1996  }
1997  }
1998  int d1 = g_date->DayInYear(10, 9);
1999  if (d1 > a_max) d1 = a_max;
2000  if ((((g_date->DayInYear() > d1) && (10 >= a_days)) && DoIt(10)) || (0 >= a_days))
2001  {
2002  a_field->ToggleCattleGrazing();
2003  int pref = a_field->GetUnsprayedMarginPolyRef();
2004  if (pref != -1){
2005  // Must have an unsprayed margin so need to pass the information on to it
2006  LE* um = g_landscape_p->SupplyLEPointer(pref);
2007  um->ToggleCattleGrazing();
2008  }
2009  return true;
2010  }
2011  return false;
2012 }

References cattle_out, g_landscape_p, l_farm_cattle_veg_reduce(), and Landscape::SupplyLEPointer().

Referenced by PermanentGrassLowYield::Do(), OPermanentGrassGrazed::Do(), OBarleyPeaCloverGrass::Do(), PermanentGrassGrazed::Do(), SpringBarleyCloverGrassStrigling::Do(), SpringBarleyCloverGrass::Do(), SpringBarleyPeaCloverGrassStrigling::Do(), and SetAside::Do().

◆ CattleIsOutLow()

bool Farm::CattleIsOutLow ( LE *  a_field,
double  a_user,
int  a_days,
int  a_max 
)
virtual

Generate a 'cattle_out_low' event for every day the cattle are on a_field.

2019 {
2020 
2021  // Generate a 'cattle_in_out' event for every day the cattle is on the
2022  // field.
2023  double biomass = a_field->GetVegBiomass();
2024  if (biomass > 100.0)
2025  {
2026  a_field->SetLastTreatment(cattle_out_low);
2027  a_field->Trace(cattle_out_low);
2028  // Reduce the vegetation because of grazing
2029  //double h=a_field->GetVegHeight();
2030  //double reduc = 1-(l_farm_cattle_veg_reduce2.value()*((h-15)/15));
2031  //a_field->ReduceVeg_Extended( reduc );
2032  a_field->GrazeVegetation( l_farm_cattle_veg_reduce2.value( ), false );
2033  int pref = a_field->GetUnsprayedMarginPolyRef();
2034  if (pref != -1)
2035  {
2036  // Must have an unsprayed margin so need to pass the information on to it
2037  LE* um = g_landscape_p->SupplyLEPointer(pref);
2038  um->SetLastTreatment(cattle_out_low);
2039  um->GrazeVegetation( l_farm_cattle_veg_reduce2.value( ), false );
2040  }
2041  }
2042  int d1 = g_date->DayInYear(10, 9);
2043  if (d1 > a_max) d1 = a_max;
2044  if ((((g_date->DayInYear() > d1) && (10 >= a_days)) && DoIt(10)) || (0 >= a_days))
2045  {
2046  a_field->ToggleCattleGrazing();
2047  int pref = a_field->GetUnsprayedMarginPolyRef();
2048  if (pref != -1){
2049  // Must have an unsprayed margin so need to pass the information on to it
2050  LE* um = g_landscape_p->SupplyLEPointer(pref);
2051  um->ToggleCattleGrazing();
2052  }
2053  return true;
2054  }
2055  return false;
2056 }

References cattle_out_low, g_landscape_p, l_farm_cattle_veg_reduce2(), and Landscape::SupplyLEPointer().

Referenced by PermanentGrassTussocky::Do(), OPermanentGrassGrazed::Do(), and OBarleyPeaCloverGrass::Do().

◆ CattleOut()

bool Farm::CattleOut ( LE *  a_field,
double  a_user,
int  a_days 
)
virtual

Start a grazing event on a_field today.

This is the main initiate grazing method and as such is called by all grazed field management plans at the moment cattle are put out.

1911 {
1915  if ((0 >= a_days) || DoIt( DO_IT_PROB ))
1916  {
1917  a_field->ToggleCattleGrazing();
1918  a_field->Trace( cattle_out );
1919  a_field->SetLastTreatment( cattle_out );
1920  // Reduce the vegetation because of grazing
1921  //double h=a_field->GetVegHeight();
1922  //double reduc = 1-(l_farm_cattle_veg_reduce.value()*((h-15)/15));
1923  //a_field->ReduceVeg_Extended( reduc );
1924  a_field->GrazeVegetation( l_farm_cattle_veg_reduce.value(), false );
1925  int pref = a_field->GetUnsprayedMarginPolyRef();
1926  if (pref != -1)
1927  {
1928  // Must have an unsprayed margin so need to pass the information on to it
1929  // This happens if all arable fields are given unsprayed margins - they have no effect on grass unless it is sprayed with pesticides
1930  LE* um = g_landscape_p->SupplyLEPointer( pref );
1931  um->ToggleCattleGrazing();
1932  um->SetLastTreatment( cattle_out );
1933  um->GrazeVegetation( l_farm_cattle_veg_reduce.value( ), false );
1934  }
1935  return true;
1936  }
1937  return false;
1938 }

References cattle_out, DO_IT_PROB, g_landscape_p, l_farm_cattle_veg_reduce(), and Landscape::SupplyLEPointer().

Referenced by PermanentGrassLowYield::Do(), OPermanentGrassGrazed::Do(), OBarleyPeaCloverGrass::Do(), PermanentGrassGrazed::Do(), SpringBarleyCloverGrassStrigling::Do(), SpringBarleyCloverGrass::Do(), SpringBarleyPeaCloverGrassStrigling::Do(), and SetAside::Do().

◆ CattleOutLowGrazing()

bool Farm::CattleOutLowGrazing ( LE *  a_field,
double  a_user,
int  a_days 
)
virtual

Start a extensive grazing event on a_field today.

1945 {
1946 
1947  if ( (0 >= a_days)|| DoIt(DO_IT_PROB)) {
1948  a_field->ToggleCattleGrazing();
1949  a_field->Trace( cattle_out_low );
1950  a_field->SetLastTreatment( cattle_out_low );
1951  // Reduce the vegetation because of grazing
1952  //double h=a_field->GetVegHeight();
1953  //double reduc = 1-(l_farm_cattle_veg_reduce.value()*((h-15)/15));
1954  //a_field->ReduceVeg_Extended( reduc );
1955  a_field->GrazeVegetation( l_farm_cattle_veg_reduce2.value( ), false );
1956  int pref=a_field->GetUnsprayedMarginPolyRef();
1957  if (pref!=-1){
1958  // Must have an unsprayed margin so need to pass the information on to it
1959  // This happens if all arable fields are given unsprayed margins - they have no effect on grass unless it is sprayed with pesticides
1960  LE* um=g_landscape_p->SupplyLEPointer(pref);
1961  um->ToggleCattleGrazing();
1962  um->SetLastTreatment( cattle_out_low );
1963  um->GrazeVegetation( l_farm_cattle_veg_reduce2.value( ), false );
1964  }
1965  return true;
1966  }
1967  return false;
1968 }

References cattle_out_low, DO_IT_PROB, g_landscape_p, l_farm_cattle_veg_reduce2(), and Landscape::SupplyLEPointer().

Referenced by PermanentGrassTussocky::Do(), OPermanentGrassGrazed::Do(), and OBarleyPeaCloverGrass::Do().

◆ Centroids()

void Farm::Centroids ( )

Finds farm's centroids - x and y.

Calculate a farm's centroid as an average of its fields' centroids.

5334  {
5337  int sum_centroidx = 0;
5338  int sum_centroidy = 0;
5339  int no_fields = (int)m_fields.size();
5340  for (int i=0; i<no_fields; i++){
5341  sum_centroidx += m_fields[i]->GetCentroidX();
5342  sum_centroidy += m_fields[i]->GetCentroidY();
5343  }
5344  m_farm_centroidx = sum_centroidx/no_fields;
5345  m_farm_centroidy = sum_centroidy/no_fields;
5346 }

References m_farm_centroidx, m_farm_centroidy, and m_fields.

Referenced by FarmManager::FindNeighbours().

◆ CheckRotationManagementLoop()

void Farm::CheckRotationManagementLoop ( FarmEvent ev)
protected

Rotation error check function

839  {
840  if ( ev->m_field->GetMgtLoopDetectDate() == g_date->Date() ) {
841  // The last crop managment plan stopped on the same day as
842  // it was started.
843 
844  // Bump loop counter.
845  ev->m_field->SetMgtLoopDetectCount( ev->m_field->GetMgtLoopDetectCount() + 1 );
846 
847  if ( ev->m_field->GetMgtLoopDetectCount() > ( long )( m_rotation.size() + 2 ) ) {
848  // We have a loop.
849  char errornum[ 20 ];
850  sprintf( errornum, "%d", m_farmtype );
851  g_msg->Warn( WARN_BUG, "Rotation management loop detected in farmtype ", errornum );
852  exit( 1 );
853  }
854  } else {
855  ev->m_field->SetMgtLoopDetectCount( 0 );
856  }
857 }

References FarmEvent::m_field.

◆ CutOrch()

bool Farm::CutOrch ( LE *  a_field,
double  a_user,
int  a_days 
)
virtual

Cut vegetation on orchard crop. //based on cut to silage - values from cutting function of orchard.

2363 {
2364 
2365  if ( (0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
2366  a_field->Trace( mow ); //? tried to do=mow...
2367  a_field->SetLastTreatment( mow );
2368  a_field->SetMownDecay( 12 ); // 12 days of not suitable
2369  //ReduceVeg_Extended( 0.2 );
2370  //a_field->InsectMortality( 0.4 );
2371  a_field->SetGrowthPhase( harvest1 );
2372  //m_DateCut = a_today; ?? what to substitute it with?
2373 
2374  a_field->SetVegParameters( l_el_o_cut_height.value(), l_el_o_cut_total.value(), l_el_o_cut_green.value(), 0 ); //is 0 ok for weed biomass
2375 
2376  int pref=a_field->GetUnsprayedMarginPolyRef();
2377  if (pref!=-1){
2378  // Must have an unsprayed margin so need to pass the information on to it
2379  LE* um=g_landscape_p->SupplyLEPointer(pref);
2380  um->SetLastTreatment( mow );
2381  um->ReduceVeg_Extended( 0.2 ); //are these values ok?
2382  um->InsectMortality( 0.4 );
2383  um->SetVegParameters( l_el_o_cut_height.value(), l_el_o_cut_total.value(), l_el_o_cut_green.value(), 0 );
2384  }
2385  return true;
2386  }
2387  return false;
2388 }

References DO_IT_PROB, g_landscape_p, l_el_o_cut_green, l_el_o_cut_height, l_el_o_cut_total, mow, and Landscape::SupplyLEPointer().

Referenced by OrchardCrop::Do().

◆ CutToHay()

bool Farm::CutToHay ( LE *  a_field,
double  a_user,
int  a_days 
)
virtual

Carry out hay cutting on a_field.

2270 {
2271 
2272  if ( (0 >= a_days) || ((g_weather->GetRainPeriod(g_date->Date(),5)<0.1)
2273  && DoIt(DO_IT_PROB)))
2274  {
2275  a_field->Trace( cut_to_hay );
2276  a_field->SetLastTreatment( cut_to_hay );
2277  a_field->SetGrowthPhase(harvest1);
2278  a_field->InsectMortality(0.4);
2279  a_field->ReduceVeg_Extended( 0.2 );
2280  a_field->SetVegHeight(10);
2281  //a_field->ResetDigestability();
2282  a_field->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
2283  int pref=a_field->GetUnsprayedMarginPolyRef();
2284  if (pref!=-1){
2285  // Must have an unsprayed margin so need to pass the information on to it
2286  LE* um=g_landscape_p->SupplyLEPointer(pref);
2287  um->SetLastTreatment( cut_to_hay );
2288  um->SetGrowthPhase(harvest1);
2289  um->InsectMortality(0.4);
2290  um->ReduceVeg_Extended( 0.2 );
2291  um->SetVegHeight( 10);
2292  um->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
2293  }
2294  return true;
2295  }
2296  return false;
2297 }

References cut_to_hay, DO_IT_PROB, g_landscape_p, and Landscape::SupplyLEPointer().

Referenced by PermanentSetAside::Do(), PermanentGrassLowYield::Do(), OPermanentGrassGrazed::Do(), PermanentGrassGrazed::Do(), and SetAside::Do().

◆ CutToSilage()

bool Farm::CutToSilage ( LE *  a_field,
double  a_user,
int  a_days 
)
virtual

Cut vegetation for silage on a_field.

2330 {
2331 
2332  if ( (0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
2333  a_field->Trace( cut_to_silage );
2334  a_field->SetLastTreatment( cut_to_silage );
2335  a_field->ReduceVeg_Extended( 0.2 );
2336  a_field->InsectMortality( 0.4 );
2337  a_field->SetVegHeight( 10 );
2338  a_field->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
2339  a_field->SetGrowthPhase(harvest1);
2340  //a_field->ResetDigestability();
2341  int pref=a_field->GetUnsprayedMarginPolyRef();
2342  if (pref!=-1){
2343  // Must have an unsprayed margin so need to pass the information on to it
2344  LE* um=g_landscape_p->SupplyLEPointer(pref);
2345  um->SetLastTreatment( cut_to_silage );
2346  um->ReduceVeg_Extended( 0.2 );
2347  um->InsectMortality( 0.4 );
2348  um->SetVegHeight( 10 );
2349  um->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
2350  um->ResetDigestability();
2351  um->SetGrowthPhase(harvest1);
2352  }
2353  return true;
2354  }
2355  return false;
2356 }

References cut_to_silage, DO_IT_PROB, g_landscape_p, and Landscape::SupplyLEPointer().

Referenced by OSBarleySilage::Do(), OBarleyPeaCloverGrass::Do(), and SetAside::Do().

◆ CutWeeds()

bool Farm::CutWeeds ( LE *  a_field,
double  a_user,
int  a_days 
)
virtual

Carry out weed topping on a_field.

2304 {
2305 
2306  if ( (0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB)))
2307  {
2308  a_field->Trace( cut_weeds );
2309  a_field->SetLastTreatment( cut_weeds );
2310  a_field->ReduceVeg( 0.8 );
2311  a_field->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
2312  int pref=a_field->GetUnsprayedMarginPolyRef();
2313  if (pref!=-1){
2314  // Must have an unsprayed margin so need to pass the information on to it
2315  LE* um=g_landscape_p->SupplyLEPointer(pref);
2316  um->SetLastTreatment( cut_weeds );
2317  um->ReduceVeg( 0.8 );
2318  um->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
2319  }
2320  return true;
2321  }
2322  return false;
2323 }

References cut_weeds, DO_IT_PROB, g_landscape_p, and Landscape::SupplyLEPointer().

Referenced by PermanentGrassLowYield::Do(), OPermanentGrassGrazed::Do(), and PermanentGrassGrazed::Do().

◆ DeepPlough()

bool Farm::DeepPlough ( LE *  a_field,
double  a_user,
int  a_days 
)
virtual

Carry out a deep ploughing event on a_field.

418 {
419 
420  if ( (0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
421  a_field->Trace( deep_ploughing );
422  a_field->SetLastTreatment( deep_ploughing );
423  // Apply 90% mortality to the insects
424  a_field->InsectMortality( 0.1 );
425  // Reduce the vegetation to zero
426  a_field->ZeroVeg();
427  int pref=a_field->GetUnsprayedMarginPolyRef();
428  if (pref!=-1){
429  // Must have an unsprayed margin so need to pass the information on to it
430  LE* um=g_landscape_p->SupplyLEPointer(pref);
431  um->SetLastTreatment( deep_ploughing );
432  um->InsectMortality( 0.1 );
433  um->ZeroVeg();
434  }
435  return true;
436  }
437  return false;
438 }

References deep_ploughing, DO_IT_PROB, g_landscape_p, and Landscape::SupplyLEPointer().

Referenced by WinterRapeStrigling::Do(), OWinterWheatUndersownExt::Do(), OWinterWheat::Do(), OWinterWheatUndersown::Do(), SpringRape::Do(), WWheatPControl::Do(), WinterWheatStriglingSingle::Do(), WinterWheatStrigling::Do(), WWheatPToxicControl::Do(), WWheatPTreatment::Do(), WinterWheatStriglingCulm::Do(), WinterRape::Do(), AgroChemIndustryCereal::Do(), and WinterWheat::Do().

◆ DoIt()

bool Farm::DoIt ( double  a_probability)

Return chance out of 0 to 100.

800  {
801  return (g_rand_uni() < (a_probability/100.0));
802 }

References g_rand_uni.

Referenced by PermanentGrassTussocky::Do(), NorwegianOats::Do(), WinterRapeStrigling::Do(), NorwegianSpringBarley::Do(), OrchardCrop::Do(), OSeedGrass1::Do(), BroadBeans::Do(), OSeedGrass2::Do(), PermanentGrassLowYield::Do(), OSBarleySilage::Do(), OFieldPeasSilage::Do(), OFieldPeas::Do(), OPermanentGrassGrazed::Do(), OCarrots::Do(), SeedGrass1::Do(), OBarleyPeaCloverGrass::Do(), PermanentGrassGrazed::Do(), OMaizeSilage::Do(), OWinterBarleyExt::Do(), OWinterBarley::Do(), SeedGrass2::Do(), OWinterRye::Do(), OOats::Do(), Maize::Do(), OTriticale::Do(), MaizeSilage::Do(), MaizeStrigling::Do(), OSpringBarleyPigs::Do(), OSpringBarleyExt::Do(), Oats::Do(), SpringBarleySeed::Do(), OSpringBarley::Do(), SpringBarleyCloverGrassStrigling::Do(), DummyCropPestTesting::Do(), FieldPeas::Do(), FieldPeasSilage::Do(), OPotatoes::Do(), FieldPeasStrigling::Do(), OWinterWheat::Do(), OWinterWheatUndersown::Do(), OWinterWheatUndersownExt::Do(), SpringBarleyCloverGrass::Do(), OFodderbeet::Do(), OWinterRape::Do(), Triticale::Do(), PLFodderLucerne2::Do(), Carrots::Do(), SpringBarleyPeaCloverGrassStrigling::Do(), SetAside::Do(), Sugarbeet::Do(), PotatoesIndustry::Do(), Fodderbeet::Do(), NorwegianPotatoes::Do(), Potatoes::Do(), SpringBarleySKManagement::Do(), SpringBarleySpr::Do(), SpringBarleySilage::Do(), WinterRyeStrigling::Do(), PLCarrots::Do(), SpringBarleyStrigling::Do(), SpringBarleyStriglingSingle::Do(), SpringBarleyStriglingCulm::Do(), WinterRye::Do(), SpringBarleyPTreatment::Do(), SpringBarley::Do(), PLFodderLucerne1::Do(), SpringRape::Do(), WWheatPControl::Do(), WWheatPTreatment::Do(), WinterWheatStrigling::Do(), WinterWheatStriglingCulm::Do(), WinterWheatStriglingSingle::Do(), PLBeans::Do(), WWheatPToxicControl::Do(), WinterBarleyStrigling::Do(), WinterRape::Do(), AgroChemIndustryCereal::Do(), WinterBarley::Do(), PLWinterRye::Do(), PLMaizeSilage::Do(), PLSpringBarley::Do(), PLMaize::Do(), PLWinterTriticale::Do(), PLSpringWheat::Do(), PLWinterBarley::Do(), PLWinterWheatLate::Do(), PLBeet::Do(), PLPotatoes::Do(), PLWinterRape::Do(), WinterWheat::Do(), WinterRape::HerbiZero(), SpringRape::RowcolOne(), and WinterRape::RowcolOne().

◆ DoIt_prob()

bool Farm::DoIt_prob ( double  a_probability)

◆ FA_AmmoniumSulphate()

bool Farm::FA_AmmoniumSulphate ( LE *  a_field,
double  a_user,
int  a_days 
)
virtual

Apply ammonium sulphate to a_field owned by an stock farmer.

991 {
992 
993  if ( (0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
994  a_field->Trace( fa_ammoniumsulphate );
995  a_field->SetLastTreatment( fa_ammoniumsulphate );
996  a_field->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
997  int pref=a_field->GetUnsprayedMarginPolyRef();
998  if (pref!=-1){
999  // Must have an unsprayed margin so need to pass the information on to it
1000  LE* um=g_landscape_p->SupplyLEPointer(pref);
1001  um->SetLastTreatment( fa_ammoniumsulphate );
1002  um->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
1003  }
1004  return true;
1005  }
1006  return false;
1007 }

References DO_IT_PROB, fa_ammoniumsulphate, g_landscape_p, and Landscape::SupplyLEPointer().

Referenced by WinterRyeStrigling::Do(), and WinterRye::Do().

◆ FA_Calcium()

bool Farm::FA_Calcium ( LE *  a_field,
double  a_user,
int  a_days 
)
virtual

Calcium applied on a_field owned by a stock farmer.

1134 {
1135  if ((0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
1136  a_field->Trace(fa_calcium);
1137  a_field->SetLastTreatment(fa_calcium);
1138  a_field->SetTramlinesDecay(EL_TRAMLINE_DECAYTIME);
1139  int pref = a_field->GetUnsprayedMarginPolyRef();
1140  if (pref != -1) {
1141  // Must have an unsprayed margin so need to pass the information on to it
1142  LE* um = g_landscape_p->SupplyLEPointer(pref);
1143  um->SetLastTreatment(fa_calcium);
1144  um->SetTramlinesDecay(EL_TRAMLINE_DECAYTIME);
1145  }
1146  return true;
1147  }
1148  return false;
1149 }

References DO_IT_PROB, fa_calcium, g_landscape_p, and Landscape::SupplyLEPointer().

◆ FA_GreenManure()

bool Farm::FA_GreenManure ( LE *  a_field,
double  a_user,
int  a_days 
)
virtual

Spread green manure on a_field owned by an stock farmer.

1063 {
1064 
1065  if ( (0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
1066  a_field->Trace( fa_greenmanure );
1067  a_field->SetLastTreatment( fa_greenmanure );
1068  a_field->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
1069  int pref=a_field->GetUnsprayedMarginPolyRef();
1070  if (pref!=-1){
1071  // Must have an unsprayed margin so need to pass the information on to it
1072  LE* um=g_landscape_p->SupplyLEPointer(pref);
1073  um->SetLastTreatment( fa_greenmanure );
1074  um->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
1075  }
1076  return true;
1077  }
1078  return false;
1079 }

References DO_IT_PROB, fa_greenmanure, g_landscape_p, and Landscape::SupplyLEPointer().

◆ FA_ManganeseSulphate()

bool Farm::FA_ManganeseSulphate ( LE *  a_field,
double  a_user,
int  a_days 
)
virtual

Apply manganese sulphate to a_field owned by an stock farmer.

1014 {
1015  if ((0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
1016  a_field->Trace(fa_manganesesulphate);
1017  a_field->SetLastTreatment(fa_manganesesulphate);
1018  a_field->SetTramlinesDecay(EL_TRAMLINE_DECAYTIME);
1019  int pref = a_field->GetUnsprayedMarginPolyRef();
1020  if (pref != -1) {
1021  // Must have an unsprayed margin so need to pass the information on to it
1022  LE* um = g_landscape_p->SupplyLEPointer(pref);
1023  um->SetLastTreatment(fa_manganesesulphate);
1024  um->SetTramlinesDecay(EL_TRAMLINE_DECAYTIME);
1025  }
1026  return true;
1027  }
1028  return false;
1029 }

References DO_IT_PROB, fa_manganesesulphate, g_landscape_p, and Landscape::SupplyLEPointer().

◆ FA_Manure()

bool Farm::FA_Manure ( LE *  a_field,
double  a_user,
int  a_days 
)
virtual

Spread manure on a_field owned by an stock farmer.

1037 {
1038 
1039  if ( (0 >= a_days) || ((g_weather->GetTemp()>0)&&
1040  !g_weather->Raining() && DoIt(DO_IT_PROB)))
1041 {
1042  a_field->Trace( fa_manure );
1043  a_field->SetLastTreatment( fa_manure );
1044  a_field->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
1045  int pref=a_field->GetUnsprayedMarginPolyRef();
1046  if (pref!=-1){
1047  // Must have an unsprayed margin so need to pass the information on to it
1048  LE* um=g_landscape_p->SupplyLEPointer(pref);
1049  um->SetLastTreatment( fa_manure );
1050  um->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
1051  }
1052  return true;
1053  }
1054  return false;
1055 }

References DO_IT_PROB, fa_manure, g_landscape_p, and Landscape::SupplyLEPointer().

Referenced by WinterRapeStrigling::Do(), OSBarleySilage::Do(), OBarleyPeaCloverGrass::Do(), OMaizeSilage::Do(), OWinterBarleyExt::Do(), OWinterBarley::Do(), OWinterRye::Do(), OOats::Do(), Maize::Do(), OTriticale::Do(), MaizeStrigling::Do(), MaizeSilage::Do(), OSpringBarleyExt::Do(), Oats::Do(), OSpringBarley::Do(), FieldPeasStrigling::Do(), FieldPeasSilage::Do(), FieldPeas::Do(), SpringBarleyCloverGrassStrigling::Do(), OPotatoes::Do(), OWinterWheat::Do(), OWinterWheatUndersown::Do(), OWinterWheatUndersownExt::Do(), OFodderbeet::Do(), SpringBarleyCloverGrass::Do(), Triticale::Do(), OWinterRape::Do(), SpringBarleyPeaCloverGrassStrigling::Do(), Fodderbeet::Do(), SpringBarleySKManagement::Do(), SpringBarleySilage::Do(), WinterRyeStrigling::Do(), SpringBarleyStrigling::Do(), SpringBarleyStriglingSingle::Do(), WinterRye::Do(), SpringBarleyStriglingCulm::Do(), SpringBarleyPTreatment::Do(), SpringBarley::Do(), SpringRape::Do(), WWheatPControl::Do(), WinterWheatStriglingSingle::Do(), WWheatPToxicControl::Do(), WinterWheatStrigling::Do(), WinterWheatStriglingCulm::Do(), WWheatPTreatment::Do(), WinterBarleyStrigling::Do(), WinterRape::Do(), AgroChemIndustryCereal::Do(), WinterBarley::Do(), NLTulips::Do(), and WinterWheat::Do().

◆ FA_NPK()

bool Farm::FA_NPK ( LE *  a_field,
double  a_user,
int  a_days 
)
virtual

Apply NPK fertilizer to a_field owned by an stock farmer.

918 {
919 
920  if ( (0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
921  a_field->Trace( fa_npk );
922  a_field->SetLastTreatment( fa_npk );
923  a_field->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
924  int pref=a_field->GetUnsprayedMarginPolyRef();
925  if (pref!=-1){
926  // Must have an unsprayed margin so need to pass the information on to it
927  LE* um=g_landscape_p->SupplyLEPointer(pref);
928  um->SetLastTreatment( fa_npk );
929  um->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
930  }
931  return true;
932  }
933  return false;
934 }

References DO_IT_PROB, fa_npk, g_landscape_p, and Landscape::SupplyLEPointer().

Referenced by OMaizeSilage::Do(), PermanentGrassGrazed::Do(), Maize::Do(), MaizeSilage::Do(), OTriticale::Do(), MaizeStrigling::Do(), SpringBarleyCloverGrassStrigling::Do(), OFodderbeet::Do(), SpringBarleyCloverGrass::Do(), Triticale::Do(), Carrots::Do(), SpringBarleyPeaCloverGrassStrigling::Do(), Sugarbeet::Do(), NLCabbageSpring::Do(), PotatoesIndustry::Do(), NorwegianPotatoes::Do(), Fodderbeet::Do(), Potatoes::Do(), SpringBarleySKManagement::Do(), SpringBarleySilage::Do(), SpringBarleySpr::Do(), SpringBarleyPTreatment::Do(), SpringBarleyStriglingCulm::Do(), SpringBarleyStrigling::Do(), SpringBarleyStriglingSingle::Do(), SpringBarley::Do(), WWheatPControl::Do(), WinterWheatStriglingSingle::Do(), WinterWheatStrigling::Do(), WWheatPTreatment::Do(), WinterWheatStriglingCulm::Do(), WWheatPToxicControl::Do(), WinterBarleyStrigling::Do(), AgroChemIndustryCereal::Do(), WinterBarley::Do(), and WinterWheat::Do().

◆ FA_NPKS()

bool Farm::FA_NPKS ( LE *  a_field,
double  a_user,
int  a_days 
)
virtual

Apply NPKS fertilizer, on a_field owned by a stock farmer.

892 {
893 
894  if ((0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
895  a_field->Trace(fa_npks);
896  a_field->SetLastTreatment(fa_npks);
897  a_field->SetTramlinesDecay(EL_TRAMLINE_DECAYTIME);
898  int pref = a_field->GetUnsprayedMarginPolyRef();
899  if (pref != -1) {
900  // Must have an unsprayed margin so need to pass the information on to it
901  LE* um = g_landscape_p->SupplyLEPointer(pref);
902  um->SetLastTreatment(sleep_all_day);
903  um->SetGrowthPhase(harvest1);
904  um->InsectMortality(0.4);
905  um->SetTramlinesDecay(EL_TRAMLINE_DECAYTIME);
906  }
907 
908  return true;
909  }
910  return false;
911 }

References DO_IT_PROB, fa_npks, g_landscape_p, sleep_all_day, and Landscape::SupplyLEPointer().

◆ FA_PK()

bool Farm::FA_PK ( LE *  a_field,
double  a_user,
int  a_days 
)
virtual

Apply PK fertilizer to a_field owned by an stock farmer.

942 {
943 
944  if ( (0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
945  a_field->Trace( fa_pk );
946  a_field->SetLastTreatment( fa_pk );
947  a_field->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
948  int pref=a_field->GetUnsprayedMarginPolyRef();
949  if (pref!=-1){
950  // Must have an unsprayed margin so need to pass the information on to it
951  LE* um=g_landscape_p->SupplyLEPointer(pref);
952  um->SetLastTreatment( fa_pk );
953  um->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
954  }
955  return true;
956  }
957  return false;
958 }

References DO_IT_PROB, fa_pk, g_landscape_p, and Landscape::SupplyLEPointer().

◆ FA_RSM()

bool Farm::FA_RSM ( LE *  a_field,
double  a_user,
int  a_days 
)
virtual

RSM (ammonium nitrate solution) applied on a_field owned by a stock farmer.

1112 {
1113  if ((0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
1114  a_field->Trace(fa_rsm);
1115  a_field->SetLastTreatment(fa_rsm);
1116  a_field->SetTramlinesDecay(EL_TRAMLINE_DECAYTIME);
1117  int pref = a_field->GetUnsprayedMarginPolyRef();
1118  if (pref != -1) {
1119  // Must have an unsprayed margin so need to pass the information on to it
1120  LE* um = g_landscape_p->SupplyLEPointer(pref);
1121  um->SetLastTreatment(fa_rsm);
1122  um->SetTramlinesDecay(EL_TRAMLINE_DECAYTIME);
1123  }
1124  return true;
1125  }
1126  return false;
1127 }

References DO_IT_PROB, fa_rsm, g_landscape_p, and Landscape::SupplyLEPointer().

◆ FA_Sludge()

bool Farm::FA_Sludge ( LE *  a_field,
double  a_user,
int  a_days 
)
virtual

Spread sewege sludge on a_field owned by an stock farmer.

1087 {
1088 
1089  if ( (0 >= a_days) || ((g_weather->GetTemp()>0)&&
1090  !g_weather->Raining() && DoIt(DO_IT_PROB)))
1091 {
1092  a_field->Trace( fa_sludge );
1093  a_field->SetLastTreatment( fa_sludge );
1094  a_field->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
1095  int pref=a_field->GetUnsprayedMarginPolyRef();
1096  if (pref!=-1){
1097  // Must have an unsprayed margin so need to pass the information on to it
1098  LE* um=g_landscape_p->SupplyLEPointer(pref);
1099  um->SetLastTreatment( fa_sludge );
1100  um->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
1101  }
1102  return true;
1103  }
1104  return false;
1105 }

References DO_IT_PROB, fa_sludge, g_landscape_p, and Landscape::SupplyLEPointer().

Referenced by WinterRyeStrigling::Do(), and WinterRye::Do().

◆ FA_Slurry()

bool Farm::FA_Slurry ( LE *  a_field,
double  a_user,
int  a_days 
)
virtual

Spready slurry on a_field owned by an stock farmer.

966 {
967 
968  if ( (0 >= a_days) || ((g_weather->GetTemp()>0)&&
969  !g_weather->Raining() && DoIt(DO_IT_PROB)))
970 {
971  a_field->Trace( fa_slurry );
972  a_field->SetLastTreatment( fa_slurry );
973  a_field->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
974  int pref=a_field->GetUnsprayedMarginPolyRef();
975  if (pref!=-1){
976  // Must have an unsprayed margin so need to pass the information on to it
977  LE* um=g_landscape_p->SupplyLEPointer(pref);
978  um->SetLastTreatment( fa_slurry );
979  um->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
980  }
981  return true;
982  }
983  return false;
984 }

References DO_IT_PROB, fa_slurry, g_landscape_p, and Landscape::SupplyLEPointer().

Referenced by OSBarleySilage::Do(), OPermanentGrassGrazed::Do(), OCarrots::Do(), OBarleyPeaCloverGrass::Do(), OMaizeSilage::Do(), OWinterBarleyExt::Do(), OWinterBarley::Do(), OWinterRye::Do(), OOats::Do(), MaizeSilage::Do(), OTriticale::Do(), Maize::Do(), MaizeStrigling::Do(), OSpringBarleyExt::Do(), Oats::Do(), OSpringBarley::Do(), OPotatoes::Do(), SpringBarleyCloverGrassStrigling::Do(), OWinterWheat::Do(), OWinterWheatUndersown::Do(), OWinterWheatUndersownExt::Do(), OFodderbeet::Do(), SpringBarleyCloverGrass::Do(), Triticale::Do(), OWinterRape::Do(), Carrots::Do(), SpringBarleyPeaCloverGrassStrigling::Do(), Sugarbeet::Do(), PotatoesIndustry::Do(), Fodderbeet::Do(), Potatoes::Do(), NorwegianPotatoes::Do(), SpringBarleySKManagement::Do(), SpringBarleySilage::Do(), WinterRyeStrigling::Do(), SpringBarleyStriglingSingle::Do(), SpringBarleyPTreatment::Do(), SpringBarleyStrigling::Do(), SpringBarleyStriglingCulm::Do(), WinterRye::Do(), SpringBarley::Do(), WWheatPControl::Do(), WWheatPTreatment::Do(), WinterWheatStriglingSingle::Do(), WWheatPToxicControl::Do(), WinterWheatStrigling::Do(), WinterWheatStriglingCulm::Do(), WinterBarleyStrigling::Do(), AgroChemIndustryCereal::Do(), WinterBarley::Do(), and WinterWheat::Do().

◆ FlowerCutting()

bool Farm::FlowerCutting ( LE *  a_field,
double  a_user,
int  a_days 
)
virtual

Flower cutting applied on a_field.

2438 {
2439  if ((0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
2440  a_field->Trace(flower_cutting);
2441  a_field->ReduceVeg_Extended(0.8);
2442  a_field->InsectMortality(0.9);
2443  a_field->SetVegHeight(35);
2444  a_field->SetLastTreatment(flower_cutting);
2445  a_field->SetTramlinesDecay(EL_TRAMLINE_DECAYTIME);
2446  int pref = a_field->GetUnsprayedMarginPolyRef();
2447  if (pref != -1) {
2448  // Must have an unsprayed margin so need to pass the information on to it
2449  LE* um = g_landscape_p->SupplyLEPointer(pref);
2450  um->ReduceVeg_Extended(0.8);
2451  um->InsectMortality(0.9);
2452  um->SetVegHeight(30);
2453  um->SetLastTreatment(flower_cutting);
2454  um->SetTramlinesDecay(EL_TRAMLINE_DECAYTIME);
2455  }
2456  return true;
2457  }
2458  return false;
2459 }

References DO_IT_PROB, flower_cutting, g_landscape_p, and Landscape::SupplyLEPointer().

◆ FP_AmmoniumSulphate()

bool Farm::FP_AmmoniumSulphate ( LE *  a_field,
double  a_user,
int  a_days 
)
virtual

Apply Ammonium Sulphate to a_field owned by an arable farmer.

751 {
752 
753  if ((0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
754  a_field->Trace(fp_ammoniumsulphate);
755  a_field->SetLastTreatment(fp_ammoniumsulphate);
756  a_field->SetTramlinesDecay(EL_TRAMLINE_DECAYTIME);
757  int pref = a_field->GetUnsprayedMarginPolyRef();
758  if (pref != -1) {
759  // Must have an unsprayed margin so need to pass the information on to it
760  LE* um = g_landscape_p->SupplyLEPointer(pref);
761  um->SetLastTreatment(fp_ammoniumsulphate);
762  um->SetTramlinesDecay(EL_TRAMLINE_DECAYTIME);
763  }
764  return true;
765  }
766  return false;
767 }

References DO_IT_PROB, fp_ammoniumsulphate, g_landscape_p, and Landscape::SupplyLEPointer().

◆ FP_Calcium()

bool Farm::FP_Calcium ( LE *  a_field,
double  a_user,
int  a_days 
)
virtual

Calcium applied on a_field owned by an arable farmer.

870 {
871  if ((0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
872  a_field->Trace(fp_calcium);
873  a_field->SetLastTreatment(fp_calcium);
874  a_field->SetTramlinesDecay(EL_TRAMLINE_DECAYTIME);
875  int pref = a_field->GetUnsprayedMarginPolyRef();
876  if (pref != -1) {
877  // Must have an unsprayed margin so need to pass the information on to it
878  LE* um = g_landscape_p->SupplyLEPointer(pref);
879  um->SetLastTreatment(fp_calcium);
880  um->SetTramlinesDecay(EL_TRAMLINE_DECAYTIME);
881  }
882  return true;
883  }
884  return false;
885 }

References DO_IT_PROB, fp_calcium, g_landscape_p, and Landscape::SupplyLEPointer().

◆ FP_GreenManure()

bool Farm::FP_GreenManure ( LE *  a_field,
double  a_user,
int  a_days 
)
virtual

Spread green manure on a_field owned by an arable farmer.

799 {
800 
801  if ( (0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
802  a_field->Trace( fp_greenmanure );
803  a_field->SetLastTreatment( fp_greenmanure );
804  a_field->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
805  int pref=a_field->GetUnsprayedMarginPolyRef();
806  if (pref!=-1){
807  // Must have an unsprayed margin so need to pass the information on to it
808  LE* um=g_landscape_p->SupplyLEPointer(pref);
809  um->SetLastTreatment( fp_greenmanure );
810  um->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
811  }
812  return true;
813  }
814  return false;
815 }

References DO_IT_PROB, fp_greenmanure, g_landscape_p, and Landscape::SupplyLEPointer().

◆ FP_LiquidNH3()

bool Farm::FP_LiquidNH3 ( LE *  a_field,
double  a_user,
int  a_days 
)
virtual

Apply liquid ammonia fertilizer to a_field owned by an arable farmer.

678 {
679 
680  if ( (0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
681  a_field->Trace( fp_liquidNH3 );
682  a_field->SetLastTreatment( fp_liquidNH3 );
683  a_field->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
684  int pref=a_field->GetUnsprayedMarginPolyRef();
685  if (pref!=-1){
686  // Must have an unsprayed margin so need to pass the information on to it
687  LE* um=g_landscape_p->SupplyLEPointer(pref);
688  um->SetLastTreatment(fp_liquidNH3);
689  um->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
690  }
691  return true;
692  }
693  return false;
694 }

References DO_IT_PROB, fp_liquidNH3, g_landscape_p, and Landscape::SupplyLEPointer().

Referenced by SpringBarleySeed::Do(), SpringBarleySKManagement::Do(), SpringBarleySilage::Do(), SpringBarleySpr::Do(), SpringBarleyPTreatment::Do(), SpringBarleyStriglingSingle::Do(), SpringBarleyStriglingCulm::Do(), SpringBarleyStrigling::Do(), and SpringBarley::Do().

◆ FP_ManganeseSulphate()

bool Farm::FP_ManganeseSulphate ( LE *  a_field,
double  a_user,
int  a_days 
)
virtual

Apply Manganse Sulphate to a_field owned by an arable farmer.

728 {
729 
730  if ( (0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
731  a_field->Trace( fp_manganesesulphate );
732  a_field->SetLastTreatment( fp_manganesesulphate );
733  a_field->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
734  int pref=a_field->GetUnsprayedMarginPolyRef();
735  if (pref!=-1){
736  // Must have an unsprayed margin so need to pass the information on to it
737  LE* um=g_landscape_p->SupplyLEPointer(pref);
738  um->SetLastTreatment( fp_manganesesulphate );
739  um->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
740  }
741  return true;
742  }
743  return false;
744 }

References DO_IT_PROB, fp_manganesesulphate, g_landscape_p, and Landscape::SupplyLEPointer().

Referenced by WinterRyeStrigling::Do(), WinterRye::Do(), WWheatPControl::Do(), WinterWheatStriglingCulm::Do(), WinterWheatStriglingSingle::Do(), WWheatPToxicControl::Do(), WinterWheatStrigling::Do(), WWheatPTreatment::Do(), WinterBarleyStrigling::Do(), AgroChemIndustryCereal::Do(), WinterBarley::Do(), and WinterWheat::Do().

◆ FP_Manure()

bool Farm::FP_Manure ( LE *  a_field,
double  a_user,
int  a_days 
)
virtual

Spread manure on a_field owned by an arable farmer.

774 {
775 
776  if ( (0 >= a_days) || ((g_weather->GetTemp()>0)&&
777  !g_weather->Raining() && DoIt(DO_IT_PROB))) {
778  a_field->Trace( fp_manure );
779  a_field->SetLastTreatment( fp_manure );
780  a_field->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
781  int pref=a_field->GetUnsprayedMarginPolyRef();
782  if (pref!=-1){
783  // Must have an unsprayed margin so need to pass the information on to it
784  LE* um=g_landscape_p->SupplyLEPointer(pref);
785  um->SetLastTreatment( fp_manure );
786  um->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
787  }
788  return true;
789  }
790  return false;
791 }

References DO_IT_PROB, fp_manure, g_landscape_p, and Landscape::SupplyLEPointer().

Referenced by OWinterBarleyExt::Do(), OWinterBarley::Do(), OWinterRye::Do(), OSpringBarleyExt::Do(), OSpringBarley::Do(), FieldPeasSilage::Do(), OPotatoes::Do(), FieldPeasStrigling::Do(), FieldPeas::Do(), OWinterWheatUndersown::Do(), OWinterWheat::Do(), OWinterWheatUndersownExt::Do(), OWinterRape::Do(), and NLTulips::Do().

◆ FP_NPK()

bool Farm::FP_NPK ( LE *  a_field,
double  a_user,
int  a_days 
)
virtual

Apply NPK fertilizer, on a_field owned by an arable farmer.

630 {
631 
632  if ( (0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
633  a_field->Trace( fp_npk );
634  a_field->SetLastTreatment( fp_npk );
635  a_field->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
636  int pref=a_field->GetUnsprayedMarginPolyRef();
637  if (pref!=-1){
638  // Must have an unsprayed margin so need to pass the information on to it
639  LE* um=g_landscape_p->SupplyLEPointer(pref);
640  um->SetLastTreatment(fp_npk);
641  um->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
642  }
643  return true;
644  }
645  return false;
646 }

References DO_IT_PROB, fp_npk, g_landscape_p, and Landscape::SupplyLEPointer().

Referenced by OSeedGrass1::Do(), OSeedGrass2::Do(), SeedGrass1::Do(), PermanentGrassGrazed::Do(), SeedGrass2::Do(), SpringBarleySeed::Do(), Carrots::Do(), PotatoesIndustry::Do(), NLCabbageSpring::Do(), NorwegianPotatoes::Do(), Potatoes::Do(), SpringBarleySKManagement::Do(), SpringBarleySilage::Do(), SpringBarleySpr::Do(), WinterRyeStrigling::Do(), SpringBarleyPTreatment::Do(), SpringBarleyStrigling::Do(), SpringBarleyStriglingCulm::Do(), SpringBarleyStriglingSingle::Do(), WinterRye::Do(), SpringBarley::Do(), WWheatPControl::Do(), NLPermanentGrassGrazed::Do(), WinterWheatStriglingSingle::Do(), WinterWheatStrigling::Do(), WinterWheatStriglingCulm::Do(), NLGrassGrazed2::Do(), WWheatPTreatment::Do(), WWheatPToxicControl::Do(), NLGrassGrazedLast::Do(), WinterBarleyStrigling::Do(), AgroChemIndustryCereal::Do(), NLPotatoesSpring::Do(), WinterBarley::Do(), and WinterWheat::Do().

◆ FP_NPKS()

bool Farm::FP_NPKS ( LE *  a_field,
double  a_user,
int  a_days 
)
virtual

Apply NPKS fertilizer, on a_field owned by an arable farmer.

603 {
604 
605  if ( (0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
606  a_field->Trace( fp_npks );
607  a_field->SetLastTreatment( fp_npks );
608  a_field->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
609  int pref=a_field->GetUnsprayedMarginPolyRef();
610 if (pref!=-1){
611  // Must have an unsprayed margin so need to pass the information on to it
612  LE* um=g_landscape_p->SupplyLEPointer(pref);
613  um->SetLastTreatment(sleep_all_day);
614  um->SetGrowthPhase( harvest1 );
615  um->InsectMortality( 0.4 );
616  um->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
617 }
618 
619  return true;
620  }
621  return false;
622 }

References DO_IT_PROB, fp_npks, g_landscape_p, sleep_all_day, and Landscape::SupplyLEPointer().

Referenced by WinterRapeStrigling::Do(), SpringRape::Do(), and WinterRape::Do().

◆ FP_PK()

bool Farm::FP_PK ( LE *  a_field,
double  a_user,
int  a_days 
)
virtual

Apply PK fertilizer, on a_field owned by an arable farmer.

654 {
655 
656  if ( (0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
657  a_field->Trace( fp_pk );
658  a_field->SetLastTreatment( fp_pk );
659  a_field->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
660  int pref=a_field->GetUnsprayedMarginPolyRef();
661  if (pref!=-1){
662  // Must have an unsprayed margin so need to pass the information on to it
663  LE* um=g_landscape_p->SupplyLEPointer(pref);
664  um->SetLastTreatment(fp_pk);
665  um->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
666  }
667  return true;
668  }
669  return false;
670 }

References DO_IT_PROB, fp_pk, g_landscape_p, and Landscape::SupplyLEPointer().

Referenced by SpringBarleySeed::Do(), PLFodderLucerne2::Do(), SpringBarleySKManagement::Do(), SpringBarleySpr::Do(), SpringBarleySilage::Do(), SpringBarleyStrigling::Do(), SpringBarleyStriglingSingle::Do(), SpringBarleyPTreatment::Do(), SpringBarleyStriglingCulm::Do(), SpringBarley::Do(), and PLBeet::Do().

◆ FP_RSM()

bool Farm::FP_RSM ( LE *  a_field,
double  a_user,
int  a_days 
)
virtual

RSM (ammonium nitrate solution) applied on a_field owned by an arable farmer.

848 {
849  if ((0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
850  a_field->Trace(fp_rsm);
851  a_field->SetLastTreatment(fp_rsm);
852  a_field->SetTramlinesDecay(EL_TRAMLINE_DECAYTIME);
853  int pref = a_field->GetUnsprayedMarginPolyRef();
854  if (pref != -1) {
855  // Must have an unsprayed margin so need to pass the information on to it
856  LE* um = g_landscape_p->SupplyLEPointer(pref);
857  um->SetLastTreatment(fp_rsm);
858  um->SetTramlinesDecay(EL_TRAMLINE_DECAYTIME);
859  }
860  return true;
861  }
862  return false;
863 }

References DO_IT_PROB, fp_rsm, g_landscape_p, and Landscape::SupplyLEPointer().

◆ FP_Sludge()

bool Farm::FP_Sludge ( LE *  a_field,
double  a_user,
int  a_days 
)
virtual

Spread sewege on a_field owned by an arable farmer.

823 {
824  //
825  if ( (0 >= a_days) || ((g_weather->GetTemp()>0)&&
826  !g_weather->Raining() && DoIt(DO_IT_PROB)))
827 {
828  a_field->Trace( fp_sludge );
829  a_field->SetLastTreatment( fp_sludge );
830  a_field->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
831  int pref=a_field->GetUnsprayedMarginPolyRef();
832  if (pref!=-1){
833  // Must have an unsprayed margin so need to pass the information on to it
834  LE* um=g_landscape_p->SupplyLEPointer(pref);
835  um->SetLastTreatment( fp_sludge );
836  um->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
837  }
838  return true;
839  }
840  return false;
841 }

References DO_IT_PROB, fp_sludge, g_landscape_p, and Landscape::SupplyLEPointer().

Referenced by WinterBarleyStrigling::Do(), and WinterBarley::Do().

◆ FP_Slurry()

bool Farm::FP_Slurry ( LE *  a_field,
double  a_user,
int  a_days 
)
virtual

Apply slurry to a_field owned by an arable farmer.

702 {
703 
704  if ( (0 >= a_days) || ((g_weather->GetTemp()>0)&&
705  !g_weather->Raining() && DoIt(DO_IT_PROB)))
706 {
707  a_field->Trace( fp_slurry );
708  a_field->SetLastTreatment( fp_slurry );
709  a_field->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
710  int pref=a_field->GetUnsprayedMarginPolyRef();
711  if (pref!=-1){
712  // Must have an unsprayed margin so need to pass the information on to it
713  LE* um=g_landscape_p->SupplyLEPointer(pref);
714  um->SetLastTreatment(fp_slurry);
715  um->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
716  }
717  return true;
718  }
719  return false;
720 }

References DO_IT_PROB, fp_slurry, g_landscape_p, and Landscape::SupplyLEPointer().

Referenced by WinterRapeStrigling::Do(), OCarrots::Do(), OWinterBarleyExt::Do(), OWinterBarley::Do(), OWinterRye::Do(), OSpringBarleyPigs::Do(), OSpringBarleyExt::Do(), OSpringBarley::Do(), OPotatoes::Do(), OWinterWheat::Do(), OWinterWheatUndersown::Do(), OWinterWheatUndersownExt::Do(), OWinterRape::Do(), Carrots::Do(), SpringRape::Do(), WWheatPControl::Do(), WinterWheatStriglingCulm::Do(), WinterWheatStrigling::Do(), PLBeans::Do(), WinterWheatStriglingSingle::Do(), WWheatPToxicControl::Do(), WWheatPTreatment::Do(), WinterRape::Do(), AgroChemIndustryCereal::Do(), PLWinterRye::Do(), NLPotatoes::Do(), PLSpringBarley::Do(), PLMaizeSilage::Do(), PLMaize::Do(), PLWinterTriticale::Do(), PLWinterWheat::Do(), PLWinterBarley::Do(), PLSpringWheat::Do(), PLWinterWheatLate::Do(), PLPotatoes::Do(), PLWinterRape::Do(), and WinterWheat::Do().

◆ FungicideTreat()

bool Farm::FungicideTreat ( LE *  a_field,
double  a_user,
int  a_days 
)
virtual

Apply fungicide to a_field.

Reimplemented in OptimisingFarm.

1280 {
1281 
1282  if (0 >= a_days)
1283  {
1284  if ( ( ! a_field->GetSignal() & LE_SIG_NO_FUNGICIDE ))
1285  {
1286  a_field->Trace( fungicide_treat );
1287  a_field->SetLastTreatment( fungicide_treat );
1288  a_field->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
1290  }
1291  return true;
1292  }
1293  else if ( (g_weather->GetWind()<4.5) &&
1294  (!g_weather->Raining()) && DoIt(DO_IT_PROB)) {
1295  if ( ! (a_field->GetSignal() & LE_SIG_NO_FUNGICIDE) ) {
1296  a_field->Trace( fungicide_treat );
1297  a_field->SetLastTreatment( fungicide_treat );
1298  a_field->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
1300  }
1301  return true;
1302  }
1303  return false;
1304 }

References Landscape::CheckForPesticideRecord(), DO_IT_PROB, fungicide, fungicide_treat, and g_landscape_p.

Referenced by WinterRapeStrigling::Do(), SeedGrass1::Do(), SeedGrass2::Do(), SpringBarleySeed::Do(), FieldPeas::Do(), FieldPeasStrigling::Do(), SpringBarleyCloverGrassStrigling::Do(), FieldPeasSilage::Do(), SpringBarleyCloverGrass::Do(), Triticale::Do(), SpringBarleyPeaCloverGrassStrigling::Do(), PotatoesIndustry::Do(), NorwegianPotatoes::Do(), Potatoes::Do(), SpringBarleySKManagement::Do(), SpringBarleySilage::Do(), SpringBarleySpr::Do(), WinterRyeStrigling::Do(), SpringBarleyStriglingSingle::Do(), SpringBarleyStrigling::Do(), WinterRye::Do(), SpringBarleyStriglingCulm::Do(), SpringBarleyPTreatment::Do(), SpringBarley::Do(), SpringRape::Do(), WWheatPControl::Do(), WinterWheatStrigling::Do(), WinterWheatStriglingCulm::Do(), WWheatPToxicControl::Do(), WinterWheatStriglingSingle::Do(), WWheatPTreatment::Do(), WinterRape::Do(), WinterBarleyStrigling::Do(), AgroChemIndustryCereal::Do(), WinterBarley::Do(), and WinterWheat::Do().

◆ GetArea()

int Farm::GetArea ( void  )

Returns the area of arable fields owned by that farm.

1331  {
1332  int area = 0;
1333  for (unsigned int i = 0; i < m_fields.size(); i++) {
1334  if (m_fields[i]->GetElementType() == tole_Field) area += (int)m_fields[i]->GetArea();
1335  }
1336  return area;
1337 }

References tole_Field.

Referenced by OptimisingFarm::ActualProfit(), AssignPermanentCrop(), FarmManager::DumpFarmAreas(), and OptimisingFarm::Match_crop_to_field().

◆ GetAreaDouble()

double Farm::GetAreaDouble ( void  )

Returns the area of arable fields owned by that farm.

1350  {
1351  double area = 0;
1352  for ( unsigned int i = 0; i < m_fields.size(); i++ ) {
1353  if (m_fields[i]->GetElementType()==tole_Field) area += m_fields[i]->GetArea();
1354  }
1355  return area;
1356 }

References tole_Field.

Referenced by OptimisingFarm::findTotalArea(), and FarmManager::Save_diff_farm_types_areas().

◆ GetAreaOpenFields()

int Farm::GetAreaOpenFields ( int  a_openness)

Returns the area of the fields above an openness of a_openness.

Returns the area of fields owned by that farm with an openness above a_openness

1370 {
1371  int area = 0;
1372  for (unsigned int i = 0; i < m_fields.size(); i++) {
1373  if (m_fields[i]->GetOpenness() > a_openness) area += int(m_fields[i]->GetArea());
1374  }
1375  return area;
1376 }

◆ GetCentroids()

APoint Farm::GetCentroids ( )
inline
908 { APoint pt; pt.m_x = m_farm_centroidx; pt.m_y = m_farm_centroidy; return pt; }

References m_farm_centroidx, and m_farm_centroidy.

◆ GetCrop()

TTypesOfVegetation Farm::GetCrop ( int  a_index)
inline
914  {
915  return m_rotation[a_index];
916  }

References m_rotation.

◆ GetFarmNumber()

int Farm::GetFarmNumber ( void  )
inline
782 { return m_farm_num; }

References m_farm_num.

Referenced by FarmManager::FarmManagement(), and InvIntPartition().

◆ GetFirstCropIndex()

int Farm::GetFirstCropIndex ( TTypesOfLandscapeElement  a_type)
protectedvirtual

Gets the first crop for the farm.

This method also synchronises farm rotations either within or between farms if needed. This is useful to try simple what if scenarios.

1385  {
1386  // If g_farm_fixed_rotation, then determine the first
1387  // crop number in the rotation rotation number.
1388  if ( g_farm_fixed_rotation_enable.value() ) {
1389 
1390  if ( !g_farm_fixed_rotation_farms_async.value() ) {
1391  // We are running all the farms synchronized, so
1392  // simply set the first crop to run on all farm fields.
1393  return 0;
1394  }
1395 
1396  // Each farm runs its fields sync'ed but independently from
1397  // the other farmers.
1398 
1399  // Determine if this farm has selected its own start index
1400  // and set it if not. m_rotation_sync_index is initialized
1401  // to -1 by the Farm::Farm() constructor.
1402  if ( -1 == m_rotation_sync_index ) {
1403  m_rotation_sync_index = (int) (rand() % m_rotation.size());
1404  }
1405  // Return farm localized rotation index.
1406  return m_rotation_sync_index;
1407  }
1408 
1409  // Not synchronised, but we want to follow our rotation sequence, so check
1410  // if we have started this process, if not set the sync value.
1411  // afterwards just increment this.
1412  if ( -1 == m_rotation_sync_index ) {
1413  if (m_rotation.size() > 0) m_rotation_sync_index = (int)(rand() % m_rotation.size()); else m_rotation_sync_index = 0;
1414  }
1415  else m_rotation_sync_index = (int) ((m_rotation_sync_index+1) % m_rotation.size());
1416  return m_rotation_sync_index;
1417 }

◆ GetFirstDate()

int Farm::GetFirstDate ( TTypesOfVegetation  a_tov)
protected

Gets the start date for a crop type.

1582  {
1583  switch (a_tov2) {
1584  case tov_Carrots:
1585  return m_carrots->GetFirstDate();
1586  case tov_BroadBeans:
1587  return m_broadbeans->GetFirstDate();
1588  case tov_FodderGrass:
1589  return m_foddergrass->GetFirstDate();
1591  return m_CGG1->GetFirstDate();
1593  return m_CGG2->GetFirstDate();
1594  case tov_FieldPeas:
1595  return m_fieldpeas->GetFirstDate();
1596  case tov_FieldPeasSilage:
1597  return m_fieldpeassilage->GetFirstDate();
1598  case tov_FodderBeet:
1599  return m_fodderbeet->GetFirstDate();
1600  case tov_SugarBeet:
1601  return m_sugarbeet->GetFirstDate();
1602  case tov_OFodderBeet:
1603  return m_ofodderbeet->GetFirstDate();
1604  case tov_Maize:
1605  return m_maize->GetFirstDate();
1606  case tov_OMaizeSilage:
1607  return m_omaizesilage->GetFirstDate();
1608  case tov_MaizeSilage:
1609  return m_maizesilage->GetFirstDate();
1611  return m_OBarleyPCG->GetFirstDate();
1612  case tov_OCarrots:
1613  return m_ocarrots->GetFirstDate();
1615  return m_OCGG1->GetFirstDate();
1617  return m_OCGG2->GetFirstDate();
1619  return m_OCGS1->GetFirstDate();
1620  case tov_OFieldPeas:
1621  return m_ofieldpeas->GetFirstDate();
1622  case tov_OFirstYearDanger:
1623  return m_ofirstyeardanger->GetFirstDate();
1624  case tov_OGrazingPigs:
1625  return m_ograzingpigs->GetFirstDate();
1626  case tov_OrchardCrop:
1627  return m_orchardcrop->GetFirstDate();
1628  case tov_OOats:
1629  return m_ooats->GetFirstDate();
1630  case tov_Oats:
1631  return m_oats->GetFirstDate();
1633  return m_opermgrassgrazed->GetFirstDate();
1634  case tov_OPotatoes:
1635  return m_opotatoes->GetFirstDate();
1636  case tov_OSpringBarley:
1637  return m_ospringbarley->GetFirstDate();
1638  case tov_OSBarleySilage:
1639  return m_osbarleysilage->GetFirstDate();
1640  case tov_OSpringBarleyExt:
1641  return m_ospringbarleyext->GetFirstDate();
1642  case tov_OSpringBarleyPigs:
1644  case tov_OWinterBarley:
1645  return m_owinterbarley->GetFirstDate();
1646  case tov_OWinterBarleyExt:
1647  return m_owinterbarleyext->GetFirstDate();
1648  case tov_OWinterRape:
1649  return m_owinterrape->GetFirstDate();
1650  case tov_OWinterRye:
1651  return m_owinterrye->GetFirstDate();
1654  case tov_OWinterWheat:
1655  return m_owinterwheat->GetFirstDate();
1659  return m_permgrassgrazed->GetFirstDate();
1662  case tov_PermanentGrassTussocky: // Only used for tole_PermPastureTussocky
1664  case tov_PermanentSetaside:
1666  case tov_Potatoes:
1667  return m_potatoes->GetFirstDate();
1668  case tov_SeedGrass1:
1669  return m_seedgrass1->GetFirstDate();
1670  case tov_SeedGrass2:
1671  return m_seedgrass2->GetFirstDate();
1672  case tov_Setaside:
1673  return m_setaside->GetFirstDate();
1674  case tov_SpringBarley:
1675  return m_springbarley->GetFirstDate();
1676  case tov_SpringBarleySpr:
1677  return m_springbarleyspr->GetFirstDate();
1684  case tov_SpringBarleySeed:
1685  return m_springbarleyseed->GetFirstDate();
1694  case tov_SpringRape:
1695  return m_springrape->GetFirstDate();
1696  case tov_Triticale:
1697  return m_triticale->GetFirstDate();
1698  case tov_OTriticale:
1699  return m_otriticale->GetFirstDate();
1700  case tov_WinterBarley:
1701  return m_winterbarley->GetFirstDate();
1702  case tov_WinterRape:
1703  return m_winterrape->GetFirstDate();
1704  case tov_WinterRye:
1705  return m_winterrye->GetFirstDate();
1706  case tov_WinterWheat:
1707  return m_winterwheat->GetFirstDate();
1714  case tov_WWheatPControl:
1715  return m_wwheatpcontrol->GetFirstDate();
1718  case tov_WWheatPTreatment:
1719  return m_wwheatptreatment->GetFirstDate();
1722  case tov_YoungForest:
1723  return m_youngforest->GetFirstDate();
1724  case tov_NorwegianPotatoes:
1726  case tov_NorwegianOats:
1727  return m_norwegianoats->GetFirstDate();
1730 
1731  case tov_PLWinterWheat:
1732  return m_plwinterwheat->GetFirstDate();
1733  case tov_PLWinterRape:
1734  return m_plwinterrape->GetFirstDate();
1735  case tov_PLWinterBarley:
1736  return m_plwinterbarley->GetFirstDate();
1737  case tov_PLWinterTriticale:
1739  case tov_PLWinterRye:
1740  return m_plwinterrye->GetFirstDate();
1741  case tov_PLSpringWheat:
1742  return m_plspringwheat->GetFirstDate();
1743  case tov_PLSpringBarley:
1744  return m_plspringbarley->GetFirstDate();
1745  case tov_PLMaize:
1746  return m_plmaize->GetFirstDate();
1747  case tov_PLMaizeSilage:
1748  return m_plmaizesilage->GetFirstDate();
1749  case tov_PLPotatoes:
1750  return m_plpotatoes->GetFirstDate();
1751  case tov_PLBeet:
1752  return m_plbeet->GetFirstDate();
1753  case tov_PLFodderLucerne1:
1754  return m_plfodderlucerne1->GetFirstDate();
1755  case tov_PLFodderLucerne2:
1756  return m_plfodderlucerne2->GetFirstDate();
1757  case tov_PLCarrots:
1758  return m_plcarrots->GetFirstDate();
1759  case tov_PLSpringBarleySpr:
1761  case tov_PLWinterWheatLate:
1763  case tov_PLBeetSpr:
1764  return m_plbeetspr->GetFirstDate();
1765  case tov_PLBeans:
1766  return m_plbeans->GetFirstDate();
1767 
1768  case tov_NLBeet:
1769  return m_nlbeet->GetFirstDate();
1770  case tov_NLCarrots:
1771  return m_nlcarrots->GetFirstDate();
1772  case tov_NLMaize:
1773  return m_nlmaize->GetFirstDate();
1774  case tov_NLPotatoes:
1775  return m_nlpotatoes->GetFirstDate();
1776  case tov_NLSpringBarley:
1777  return m_nlspringbarley->GetFirstDate();
1778  case tov_NLWinterWheat:
1779  return m_nlwinterwheat->GetFirstDate();
1780  case tov_NLCabbage:
1781  return m_nlcabbage->GetFirstDate();
1782  case tov_NLTulips:
1783  return m_nltulips->GetFirstDate();
1784  case tov_NLGrassGrazed1:
1785  return m_nlgrassgrazed1->GetFirstDate();
1788  case tov_NLGrassGrazed2:
1789  return m_nlgrassgrazed2->GetFirstDate();
1790  case tov_NLGrassGrazedLast:
1794  case tov_NLBeetSpring:
1795  return m_nlbeetspring->GetFirstDate();
1796  case tov_NLCarrotsSpring:
1797  return m_nlcarrotsspring->GetFirstDate();
1798  case tov_NLMaizeSpring:
1799  return m_nlmaizespring->GetFirstDate();
1800  case tov_NLPotatoesSpring:
1801  return m_nlpotatoesspring->GetFirstDate();
1804  case tov_NLCabbageSpring:
1805  return m_nlcabbagespring->GetFirstDate();
1806  case tov_NLCatchPeaCrop:
1807  return m_nlcatchpeacrop->GetFirstDate();
1808 
1811 
1812  default:
1813  return 0;
1814  }
1815 }

References tov_AgroChemIndustryCereal, tov_BroadBeans, tov_Carrots, tov_CloverGrassGrazed1, tov_CloverGrassGrazed2, tov_DummyCropPestTesting, tov_FieldPeas, tov_FieldPeasSilage, tov_FodderBeet, tov_FodderGrass, tov_Maize, tov_MaizeSilage, tov_NLBeet, tov_NLBeetSpring, tov_NLCabbage, tov_NLCabbageSpring, tov_NLCarrots, tov_NLCarrotsSpring, tov_NLCatchPeaCrop, tov_NLGrassGrazed1, tov_NLGrassGrazed1Spring, tov_NLGrassGrazed2, tov_NLGrassGrazedLast, tov_NLMaize, tov_NLMaizeSpring, tov_NLPermanentGrassGrazed, tov_NLPotatoes, tov_NLPotatoesSpring, tov_NLSpringBarley, tov_NLSpringBarleySpring, tov_NLTulips, tov_NLWinterWheat, tov_NorwegianOats, tov_NorwegianPotatoes, tov_NorwegianSpringBarley, tov_Oats, tov_OBarleyPeaCloverGrass, tov_OCarrots, tov_OCloverGrassGrazed1, tov_OCloverGrassGrazed2, tov_OCloverGrassSilage1, tov_OFieldPeas, tov_OFirstYearDanger, tov_OFodderBeet, tov_OGrazingPigs, tov_OMaizeSilage, tov_OOats, tov_OPermanentGrassGrazed, tov_OPotatoes, tov_OrchardCrop, tov_OSBarleySilage, tov_OSpringBarley, tov_OSpringBarleyExt, tov_OSpringBarleyPigs, tov_OTriticale, tov_OWinterBarley, tov_OWinterBarleyExt, tov_OWinterRape, tov_OWinterRye, tov_OWinterWheat, tov_OWinterWheatUndersown, tov_OWinterWheatUndersownExt, tov_PermanentGrassGrazed, tov_PermanentGrassLowYield, tov_PermanentGrassTussocky, tov_PermanentSetaside, tov_PLBeans, tov_PLBeet, tov_PLBeetSpr, tov_PLCarrots, tov_PLFodderLucerne1, tov_PLFodderLucerne2, tov_PLMaize, tov_PLMaizeSilage, tov_PLPotatoes, tov_PLSpringBarley, tov_PLSpringBarleySpr, tov_PLSpringWheat, tov_PLWinterBarley, tov_PLWinterRape, tov_PLWinterRye, tov_PLWinterTriticale, tov_PLWinterWheat, tov_PLWinterWheatLate, tov_Potatoes, tov_SeedGrass1, tov_SeedGrass2, tov_Setaside, tov_SpringBarley, tov_SpringBarleyCloverGrass, tov_SpringBarleyPTreatment, tov_SpringBarleySeed, tov_SpringBarleySilage, tov_SpringBarleySKManagement, tov_SpringBarleySpr, tov_SpringBarleyStrigling, tov_SpringBarleyStriglingCulm, tov_SpringBarleyStriglingSingle, tov_SpringRape, tov_SugarBeet, tov_Triticale, tov_WinterBarley, tov_WinterRape, tov_WinterRye, tov_WinterWheat, tov_WinterWheatStrigling, tov_WinterWheatStriglingCulm, tov_WinterWheatStriglingSingle, tov_WWheatPControl, tov_WWheatPToxicControl, tov_WWheatPTreatment, and tov_YoungForest.

◆ GetIntensity()

int Farm::GetIntensity ( void  )
inline
907 { return m_intensity; }

References m_intensity.

◆ GetMaxOpenness()

int Farm::GetMaxOpenness ( )
inline

Returns the maximum openness score of the fields.

803  {
804  int op = 0;
805  for (int i = 0; i < m_fields.size(); i++)
806  {
807  int openness = m_fields[i]->GetOpenness();
808  if (openness > op) op = openness;
809  }
810  return op;
811  }

References m_fields.

◆ GetNextCrop()

TTypesOfVegetation Farm::GetNextCrop ( int  a_index)
inline
917  {
918  int ind = a_index + 1;
919  if (ind >= (int)m_rotation.size()) ind = ind - (int)m_rotation.size();
920  return m_rotation[ind];
921  }

References m_rotation.

◆ GetNextCropIndex()

int Farm::GetNextCropIndex ( int  a_rot_index)
protectedvirtual

Returns the next crop in the rotation.

Also provides the possibility of over-riding rotations using configuration settings

1427  {
1428  if ( !g_farm_enable_crop_rotation.value() ) {
1429  // Rotation not enabled.
1430  return a_rot_index;
1431  }
1432 
1433  if ( a_rot_index == -1 )
1434  return -1;
1435 
1436  if ( ( unsigned int ) ( ++a_rot_index ) == m_rotation.size() ) //AM comm: the last crop was the last element of the vector - so go back to the element zero; otherwise just add 1 to the index
1437  a_rot_index = 0;
1438 
1439  return a_rot_index;
1440 }

◆ GetNextCropStartDate()

int Farm::GetNextCropStartDate ( LE *  a_field,
TTypesOfVegetation a_curr_veg 
)
protected

Returns the start date of the next crop in the rotation.

864  {
865  TTypesOfVegetation l_tov2;
866 
867  if ( a_field->GetRotIndex() < 0 || g_farm_fixed_crop_enable.value() //|| g_farm_test_crop.value()
868  ) {
869  l_tov2 = a_curr_veg; // don't do it if no rotation
870  } else {
871  l_tov2 = m_rotation[ GetNextCropIndex( a_field->GetRotIndex() ) ];
872  }
873  a_curr_veg = l_tov2;
874  return GetFirstDate( l_tov2 );
875 }

References g_farm_fixed_crop_enable.

◆ GetNoFields()

int Farm::GetNoFields ( )
inline

Returns the number of the fields owned.

794 { return (int) m_fields.size(); }

References m_fields.

◆ GetNoOpenFields()

int Farm::GetNoOpenFields ( int  a_openness)

Returns the number of the fields above an openness of a_openness.

Returns the number of fields owned by that farm with an openness above a_openness

1360 {
1361  int num = 0;
1362  for (unsigned int i = 0; i < m_fields.size(); i++) {
1363  if (m_fields[i]->GetOpenness() > a_openness) num++;
1364  }
1365  return num;
1366 }

◆ GetPreviousCrop()

TTypesOfVegetation Farm::GetPreviousCrop ( int  a_index)
inline
909  {
910  int ind = a_index - 1;
911  if (ind < 0) ind = (int)m_rotation.size() - 1;
912  return m_rotation[ind];
913  }

References m_rotation.

◆ GetTotalArea()

int Farm::GetTotalArea ( void  )

Returns the area of all fields owned by that farm.

1340  {
1341  int area = 0;
1342  for (unsigned int i = 0; i < m_fields.size(); i++)
1343  {
1344  area += (int)m_fields[i]->GetArea();
1345  }
1346  return area;
1347 }

◆ GetType()

TTypesOfFarm Farm::GetType ( void  )
inline
901 { return m_farmtype; }

References m_farmtype.

Referenced by PermanentSetAside::Do(), PermanentGrassTussocky::Do(), OrchardCrop::Do(), OSeedGrass1::Do(), OSeedGrass2::Do(), BroadBeans::Do(), YoungForestCrop::Do(), PermanentGrassLowYield::Do(), SeedGrass1::Do(), PermanentGrassGrazed::Do(), NLCatchPeaCrop::Do(), SeedGrass2::Do(), MaizeSilage::Do(), OTriticale::Do(), Maize::Do(), NLMaizeSpring::Do(), Oats::Do(), FieldPeas::Do(), FieldPeasSilage::Do(), DummyCropPestTesting::Do(), OFodderbeet::Do(), Triticale::Do(), PLFodderLucerne2::Do(), Carrots::Do(), NLMaize::Do(), NLBeetSpring::Do(), NLCarrotsSpring::Do(), SetAside::Do(), NLBeet::Do(), NLCarrots::Do(), Sugarbeet::Do(), NLCabbageSpring::Do(), NLSpringBarleySpring::Do(), PotatoesIndustry::Do(), NorwegianPotatoes::Do(), Fodderbeet::Do(), Potatoes::Do(), NLCabbage::Do(), SpringBarleySilage::Do(), SpringBarleySpr::Do(), PLCarrots::Do(), WinterRye::Do(), NLSpringBarley::Do(), NLWinterWheat::Do(), PLSpringBarleySpr::Do(), SpringBarley::Do(), PLFodderLucerne1::Do(), SpringRape::Do(), NLPermanentGrassGrazed::Do(), PLBeetSpr::Do(), NLGrassGrazed1Spring::Do(), NLGrassGrazed2::Do(), PLBeans::Do(), NLGrassGrazedLast::Do(), WinterRape::Do(), NLGrassGrazed1::Do(), NLPotatoesSpring::Do(), WinterBarley::Do(), PLWinterRye::Do(), NLPotatoes::Do(), PLMaizeSilage::Do(), PLMaize::Do(), PLSpringBarley::Do(), NLTulips::Do(), PLWinterTriticale::Do(), PLBeet::Do(), PLWinterWheatLate::Do(), PLWinterBarley::Do(), PLWinterWheat::Do(), PLSpringWheat::Do(), PLPotatoes::Do(), PLWinterRape::Do(), and WinterWheat::Do().

◆ GetValidCoords()

APoint Farm::GetValidCoords ( )
inline

Returns the valid coordinates of the first field owned by a farm.

800 { APoint pt; pt.m_x = m_fields[0]->GetValidX(); pt.m_y = m_fields[0]->GetValidY(); return pt; }

References m_fields.

◆ GrowthRegulator()

bool Farm::GrowthRegulator ( LE *  a_field,
double  a_user,
int  a_days 
)
virtual

Apply growth regulator to a_field.

1251 {
1252 
1253  if (0 >= a_days)
1254  {
1255  if ( (!g_weather->Raining()) && (g_weather->GetWind()<4.5) &&
1256  (!(a_field->GetSignal() & LE_SIG_NO_GROWTH_REG) )) {
1257  a_field->Trace( growth_regulator );
1258  a_field->SetLastTreatment( growth_regulator );
1259  a_field->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
1260  }
1261  return true;
1262  }
1263  else if ( (g_weather->GetWind()<4.5) &&
1264  (!g_weather->Raining()) && DoIt(DO_IT_PROB)) {
1265  if ( ! (a_field->GetSignal() & LE_SIG_NO_GROWTH_REG) ) {
1266  a_field->Trace( growth_regulator );
1267  a_field->SetLastTreatment( growth_regulator );
1268  a_field->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
1269  }
1270  return true;
1271  }
1272  return false;
1273 }

References DO_IT_PROB, and growth_regulator.

Referenced by SeedGrass2::Do(), SpringBarleySeed::Do(), FieldPeas::Do(), FieldPeasStrigling::Do(), SpringBarleyCloverGrassStrigling::Do(), FieldPeasSilage::Do(), SpringBarleyCloverGrass::Do(), Triticale::Do(), SpringBarleyPeaCloverGrassStrigling::Do(), PotatoesIndustry::Do(), NorwegianPotatoes::Do(), Potatoes::Do(), SpringBarleySKManagement::Do(), SpringBarleySpr::Do(), WinterRyeStrigling::Do(), SpringBarleySilage::Do(), SpringBarleyStrigling::Do(), SpringBarleyStriglingCulm::Do(), SpringBarleyStriglingSingle::Do(), WinterRye::Do(), SpringBarleyPTreatment::Do(), SpringBarley::Do(), WWheatPControl::Do(), WWheatPTreatment::Do(), WWheatPToxicControl::Do(), WinterWheatStrigling::Do(), WinterWheatStriglingSingle::Do(), WinterWheatStriglingCulm::Do(), WinterBarleyStrigling::Do(), AgroChemIndustryCereal::Do(), WinterBarley::Do(), and WinterWheat::Do().

◆ HandleEvents()

void Farm::HandleEvents ( void  )
protectedvirtual

If there are events to carry out do this, and perhaps start a new crop.

Call the management plan for the current crop and it this return done=true starts the next management.

Sets the new index to the rotation.

Save the new veg type as the LE vegetation type

Reimplemented in OptimisingFarm.

882  {
883  if ( m_queue.Empty() )
884  return;
885 
886  LowPriPair < FarmEvent * > pair = m_queue.Bottom();
887  FarmEvent * ev = pair.m_element;
888  while ( pair.m_pri <= g_date->Date() ) {
889  m_queue.Pop();
891  if ( LeSwitch( ev ) ) {
892  // This crop management plan has terminated.
893 
894  // First check for an infinite loop in the rotation scheme,
895  // ie. a scenario where all crops decide not to run given
896  // the date.
898 
899  // Outdate any remaining events for this field.
900  ev->m_field->BumpRunNum();
901 
902  // Crop treatment done, select and initiate new crop if in rotation.
903  TTypesOfVegetation new_veg = ev->m_field->GetVegType();
904 
905  if ( ev->m_field->GetRotIndex() >= 0 ) {
906  int new_index = GetNextCropIndex( ev->m_field->GetRotIndex() );
907  new_veg = m_rotation[ new_index ];
908  // Running in fixed crop mode?
909  if ( g_farm_fixed_crop_enable.value() ) {
910  new_veg = g_letype->TranslateVegTypes( g_farm_fixed_crop_type.value() );
911  }
913  ev->m_field->SetRotIndex( new_index );
915  ev->m_field->SetVegType(new_veg, tov_Undefined);
916  }
917 
918  // Reset the event list for this field.
919  ev->m_field->ResetTrace();
920  // Reset event timeout counter.
921  ev->m_field->SetVegStore( 0 );
922 
923  // The next bit simply determines the start date of the next crop in
924  // the rotation and passes this to the start crop event.
925  // The crop is responsible for raising an error if the next crop is
926  // not possible or otherwise handling the problem
927 
928  // 19/5-2003: Note: This code was moved out into a dedicated
929  // method of the Farm class, GetNextCropStartDate(), as precisely
930  // the same piece of code needs to be run during initialization of
931  // farm management.
932  TTypesOfVegetation l_tov = new_veg;
933  int l_nextcropstartdate = GetNextCropStartDate( ev->m_field, l_tov );
934 
935  // Create 'start' event for today and put it on the queue.
936  AddNewEvent( new_veg, g_date->Date(), ev->m_field, PROG_START, ev->m_field->GetRunNum(), false, l_nextcropstartdate, false, l_tov );
937 
938  // Set starting date for rotation mgmt loop detection.
939  ev->m_field->SetMgtLoopDetectDate( g_date->Date() );
940  }
941 
942  delete ev;
943 
944  if ( m_queue.Empty() )
945  return;
946  pair = m_queue.Bottom();
947  ev = pair.m_element;
948  }
949 }

References g_farm_fixed_crop_enable, FarmEvent::m_field, PROG_START, and tov_Undefined.

◆ Harvest()

bool Farm::Harvest ( LE *  a_field,
double  a_user,
int  a_days 
)
virtual

Carry out a harvest on a_field.

Reimplemented in OptimisingFarm.

1770 {
1771  //5 days good weather before
1772  if ((0 >= a_days) || ((g_weather->GetRainPeriod(g_date->Date(), 5) < 0.1) && DoIt(DO_IT_PROB))) {
1773  a_field->Trace(harvest);
1774  a_field->SetLastTreatment(harvest);
1775  a_field->SetGrowthPhase(harvest1);
1776  // Here we have to do a little skip to avoid too low insect populations after harvest, but a correct veg biomass
1777  a_field->InsectMortality(0.4);
1778  double insects = a_field->GetInsectPop();
1779  a_field->ResetDigestability();
1780  a_field->RecalculateBugsNStuff();
1781  a_field->SetInsectPop(insects);
1782  a_field->SetTramlinesDecay(EL_TRAMLINE_DECAYTIME);
1783  int pref = a_field->GetUnsprayedMarginPolyRef();
1784  // Are we a cereal crop? If so we need to have some spilled grain
1785  double someseed = 0.0;
1786  double somemaize = 0.0;
1787  if (dynamic_cast<VegElement*>(a_field)->IsMatureCereal()) {
1788  someseed = m_OurManager->GetSpilledGrain();
1789  a_field->SetStubble(true);
1790  }
1791  else if (dynamic_cast<VegElement*>(a_field)->IsMaize()) {
1792  // Maize in stubble
1793  a_field->SetStubble(true);
1794  somemaize = m_OurManager->GetSpilledMaize();
1795  }
1796  a_field->SetBirdSeed( someseed );
1797  a_field->SetBirdMaize( somemaize );
1798  if (pref != -1){
1799  // Must have an unsprayed margin so need to pass the information on to it
1800  LE* um = g_landscape_p->SupplyLEPointer(pref);
1801  um->SetLastTreatment(harvest);
1802  um->SetGrowthPhase(harvest1);
1803  um->InsectMortality(0.4);
1804  um->SetTramlinesDecay(EL_TRAMLINE_DECAYTIME);
1805  um->ResetDigestability();
1806  um->RecalculateBugsNStuff();
1807  um->SetBirdSeed( someseed );
1808  um->SetBirdMaize( somemaize );
1809  if ((somemaize > 0) || (someseed > 0)) um->SetStubble(true);
1810  }
1811  return true;
1812  }
1813  return false;
1814 }

References DO_IT_PROB, g_landscape_p, harvest, and Landscape::SupplyLEPointer().

Referenced by NorwegianOats::Do(), OSeedGrass1::Do(), NorwegianSpringBarley::Do(), WinterRapeStrigling::Do(), BroadBeans::Do(), OSeedGrass2::Do(), OFieldPeas::Do(), OFieldPeasSilage::Do(), OCarrots::Do(), SeedGrass1::Do(), OMaizeSilage::Do(), OBarleyPeaCloverGrass::Do(), OWinterBarleyExt::Do(), SeedGrass2::Do(), OWinterBarley::Do(), OWinterRye::Do(), OOats::Do(), MaizeSilage::Do(), Maize::Do(), MaizeStrigling::Do(), OSpringBarleyPigs::Do(), OTriticale::Do(), OSpringBarleyExt::Do(), Oats::Do(), SpringBarleySeed::Do(), OSpringBarley::Do(), FieldPeas::Do(), FieldPeasSilage::Do(), SpringBarleyCloverGrassStrigling::Do(), OPotatoes::Do(), FieldPeasStrigling::Do(), OWinterWheat::Do(), OWinterWheatUndersown::Do(), OWinterWheatUndersownExt::Do(), OFodderbeet::Do(), SpringBarleyCloverGrass::Do(), Triticale::Do(), OWinterRape::Do(), Carrots::Do(), SpringBarleyPeaCloverGrassStrigling::Do(), PotatoesIndustry::Do(), Potatoes::Do(), NorwegianPotatoes::Do(), Fodderbeet::Do(), SpringBarleySKManagement::Do(), SpringBarleySpr::Do(), SpringBarleySilage::Do(), WinterRyeStrigling::Do(), SpringBarleyStriglingSingle::Do(), WinterRye::Do(), SpringBarleyStrigling::Do(), SpringBarleyPTreatment::Do(), SpringBarleyStriglingCulm::Do(), SpringBarley::Do(), SpringRape::Do(), WWheatPControl::Do(), WinterWheatStriglingSingle::Do(), WWheatPToxicControl::Do(), WinterWheatStriglingCulm::Do(), WinterWheatStrigling::Do(), WWheatPTreatment::Do(), WinterBarleyStrigling::Do(), WinterRape::Do(), AgroChemIndustryCereal::Do(), WinterBarley::Do(), and WinterWheat::Do().

◆ HarvestLong()

bool Farm::HarvestLong ( LE *  a_field,
double  a_user,
int  a_days 
)
virtual

Carry out a harvest on a_field.

1822 {
1823 
1824  //5 days good weather before
1825  if ((0 >= a_days) ||
1826  ((g_weather->GetRainPeriod(g_date->Date(), 5)<0.1) && DoIt(DO_IT_PROB_LONG))
1827  ) {
1828  a_field->Trace(harvest);
1829  a_field->SetLastTreatment(harvest);
1830  a_field->SetGrowthPhase(harvest1);
1831  // Here we have to do a little skip to avoid too low insect populations after harvest, but a correct veg biomass
1832  a_field->InsectMortality(0.4);
1833  double insects = a_field->GetInsectPop();
1834  a_field->ResetDigestability();
1835  a_field->RecalculateBugsNStuff();
1836  a_field->SetInsectPop(insects);
1837  a_field->SetTramlinesDecay(EL_TRAMLINE_DECAYTIME);
1838  int pref = a_field->GetUnsprayedMarginPolyRef();
1839  double someseed = 0.0; //No bird seed or maize forage on sugar beet (which is currently (March 2015) the only crop using HarvestLong.
1840  a_field->SetBirdSeed( someseed );
1841  a_field->SetBirdMaize( someseed );
1842  if (pref != -1){
1843  // Must have an unsprayed margin so need to pass the information on to it
1844  LE* um = g_landscape_p->SupplyLEPointer(pref);
1845  um->SetLastTreatment(harvest);
1846  um->SetGrowthPhase(harvest1);
1847  um->InsectMortality(0.4);
1848  um->SetTramlinesDecay(EL_TRAMLINE_DECAYTIME);
1849  um->ResetDigestability();
1850  um->RecalculateBugsNStuff();
1851  um->SetBirdSeed( someseed );
1852  um->SetBirdMaize( someseed );
1853  }
1854  return true;
1855  }
1856  return false;
1857 }

References DO_IT_PROB_LONG, g_landscape_p, harvest, and Landscape::SupplyLEPointer().

Referenced by Sugarbeet::Do().

◆ HayBailing()

bool Farm::HayBailing ( LE *  a_field,
double  a_user,
int  a_days 
)
virtual

Carry out hay bailing on a_field.

2185 {
2186 
2187  if ( (0 >= a_days) ||
2188  ((g_weather->GetRainPeriod(g_date->Date(),5)<0.1) && DoIt(DO_IT_PROB))
2189  ) {
2190  a_field->Trace( hay_bailing );
2191  a_field->SetLastTreatment( hay_bailing );
2192  a_field->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
2193  int pref=a_field->GetUnsprayedMarginPolyRef();
2194  if (pref!=-1){
2195  // Must have an unsprayed margin so need to pass the information on to it
2196  LE* um=g_landscape_p->SupplyLEPointer(pref);
2197  um->SetLastTreatment( hay_bailing );
2198  um->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
2199  }
2200  return true;
2201  }
2202  return false;
2203 }

References DO_IT_PROB, g_landscape_p, hay_bailing, and Landscape::SupplyLEPointer().

Referenced by NorwegianOats::Do(), WinterRapeStrigling::Do(), NorwegianSpringBarley::Do(), PermanentGrassLowYield::Do(), OPermanentGrassGrazed::Do(), PermanentGrassGrazed::Do(), OWinterBarleyExt::Do(), OWinterBarley::Do(), OWinterRye::Do(), OOats::Do(), OSpringBarleyPigs::Do(), OTriticale::Do(), OSpringBarleyExt::Do(), Oats::Do(), SpringBarleySeed::Do(), OSpringBarley::Do(), SpringBarleyCloverGrassStrigling::Do(), OWinterWheatUndersownExt::Do(), OWinterWheat::Do(), OWinterWheatUndersown::Do(), SpringBarleyCloverGrass::Do(), Triticale::Do(), SpringBarleyPeaCloverGrassStrigling::Do(), SpringBarleySKManagement::Do(), WinterRyeStrigling::Do(), SpringBarleySpr::Do(), SpringBarleyStriglingSingle::Do(), WinterRye::Do(), SpringBarleyStriglingCulm::Do(), SpringBarleyPTreatment::Do(), SpringBarleyStrigling::Do(), SpringBarley::Do(), SpringRape::Do(), WWheatPControl::Do(), WinterWheatStriglingCulm::Do(), WinterWheatStrigling::Do(), WWheatPTreatment::Do(), WWheatPToxicControl::Do(), WinterWheatStriglingSingle::Do(), WinterBarleyStrigling::Do(), WinterRape::Do(), AgroChemIndustryCereal::Do(), WinterBarley::Do(), and WinterWheat::Do().

◆ HayTurning()

bool Farm::HayTurning ( LE *  a_field,
double  a_user,
int  a_days 
)
virtual

Carry out hay turning on a_field.

2160 {
2161 
2162  if ( (0 >= a_days) ||
2163  ((g_weather->GetRainPeriod(g_date->Date(),5)<0.1) && DoIt(DO_IT_PROB))
2164  ) {
2165  a_field->Trace( hay_turning );
2166  a_field->SetLastTreatment( hay_turning );
2167  a_field->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
2168  int pref=a_field->GetUnsprayedMarginPolyRef();
2169  if (pref!=-1){
2170  // Must have an unsprayed margin so need to pass the information on to it
2171  LE* um=g_landscape_p->SupplyLEPointer(pref);
2172  um->SetLastTreatment( hay_turning );
2173  um->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
2174  }
2175  return true;
2176  }
2177  return false;
2178 }

References DO_IT_PROB, g_landscape_p, hay_turning, and Landscape::SupplyLEPointer().

Referenced by OSeedGrass1::Do(), OSeedGrass2::Do(), PermanentGrassLowYield::Do(), OPermanentGrassGrazed::Do(), SeedGrass1::Do(), PermanentGrassGrazed::Do(), SeedGrass2::Do(), OWinterRye::Do(), OTriticale::Do(), OWinterWheatUndersown::Do(), OWinterWheatUndersownExt::Do(), OWinterWheat::Do(), Triticale::Do(), WinterRyeStrigling::Do(), WinterRye::Do(), WWheatPControl::Do(), WinterWheatStriglingCulm::Do(), WWheatPTreatment::Do(), WWheatPToxicControl::Do(), WinterWheatStrigling::Do(), WinterWheatStriglingSingle::Do(), WinterBarleyStrigling::Do(), AgroChemIndustryCereal::Do(), WinterBarley::Do(), and WinterWheat::Do().

◆ HeavyCultivatorAggregate()

bool Farm::HeavyCultivatorAggregate ( LE *  a_field,
double  a_user,
int  a_days 
)
virtual

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.

218 {
219  if ((0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
220  a_field->Trace(heavy_cultivator_aggregate);
221  a_field->SetLastTreatment(heavy_cultivator_aggregate);
222  a_field->InsectMortality(0.1); // The same global mortality as for normal plough
223  a_field->ZeroVeg(); // Zero veg as with stubble harrowing
224  int pref = a_field->GetUnsprayedMarginPolyRef();
225  if (pref != -1) {
226  // Must have an unsprayed margin so need to pass the information on to it
227  LE* um = g_landscape_p->SupplyLEPointer(pref);
228  um->SetLastTreatment(heavy_cultivator_aggregate);
229  um->InsectMortality(0.1);
230  um->ZeroVeg();
231  }
232  return true; // completed
233  }
234  return false; // not completed
235 }

References DO_IT_PROB, g_landscape_p, heavy_cultivator_aggregate, and Landscape::SupplyLEPointer().

◆ HerbicideTreat()

bool Farm::HerbicideTreat ( LE *  a_field,
double  a_user,
int  a_days 
)
virtual

Apply herbicide to a_field.

Reimplemented in OptimisingFarm.

1157 {
1158 
1159  if (0 >= a_days) // Must do this
1160  {
1161  if (((a_field->GetSignal() & LE_SIG_NO_HERBICIDE)==0 ))
1162  {
1163  a_field->Trace( herbicide_treat );
1164  a_field->SetLastTreatment( herbicide_treat );
1165  if ( l_farm_herbicide_kills.value())
1166  {
1167  a_field->ReduceWeedBiomass( 0.05 );
1168  }
1169  a_field->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
1170  a_field->SetHerbicideDelay( EL_HERBICIDE_DELAYTIME );
1172 
1173  }
1174  return true;
1175  }
1176  else if ((g_weather->GetWind()<4.5) && (!g_weather->Raining()) && DoIt(DO_IT_PROB))
1177  {
1178  if ( !(a_field->GetSignal() & LE_SIG_NO_HERBICIDE) )
1179  {
1180  a_field->Trace( herbicide_treat );
1181  a_field->SetLastTreatment( herbicide_treat );
1182  if ( l_farm_herbicide_kills.value())
1183  {
1184  a_field->ReduceWeedBiomass( 0.05 );
1185  }
1186  a_field->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
1187  a_field->SetHerbicideDelay( EL_HERBICIDE_DELAYTIME );
1189  }
1190  return true;
1191  }
1192  return false;
1193 }

References Landscape::CheckForPesticideRecord(), DO_IT_PROB, g_landscape_p, herbicide, herbicide_treat, and l_farm_herbicide_kills().

Referenced by PermanentGrassLowYield::Do(), SeedGrass1::Do(), PermanentGrassGrazed::Do(), SeedGrass2::Do(), MaizeStrigling::Do(), Maize::Do(), MaizeSilage::Do(), Oats::Do(), SpringBarleySeed::Do(), FieldPeasSilage::Do(), FieldPeas::Do(), SpringBarleyCloverGrass::Do(), Triticale::Do(), Carrots::Do(), PotatoesIndustry::Do(), Sugarbeet::Do(), NorwegianPotatoes::Do(), Fodderbeet::Do(), Potatoes::Do(), SpringBarleySKManagement::Do(), SpringBarleySilage::Do(), SpringBarleySpr::Do(), WinterRye::Do(), NLWinterWheat::Do(), SpringBarleyPTreatment::Do(), SpringBarley::Do(), PLFodderLucerne1::Do(), SpringRape::Do(), WWheatPControl::Do(), WWheatPTreatment::Do(), WWheatPToxicControl::Do(), WinterBarleyStrigling::Do(), WinterRape::Do(), AgroChemIndustryCereal::Do(), WinterBarley::Do(), WinterWheat::Do(), and WinterRape::HerbiZero().

◆ HillingUp()

bool Farm::HillingUp ( LE *  a_field,
double  a_user,
int  a_days 
)
virtual

Do hilling up on a_field, probably of potatoes.

1664 {
1665 
1666  if ( (0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
1667  a_field->Trace( hilling_up );
1668  a_field->SetLastTreatment( hilling_up );
1669  a_field->InsectMortality( 0.75 );
1670  a_field->ReduceWeedBiomass( 0.25 );
1671  a_field->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
1672  int pref=a_field->GetUnsprayedMarginPolyRef();
1673  if (pref!=-1){
1674  // Must have an unsprayed margin so need to pass the information on to it
1675  LE* um=g_landscape_p->SupplyLEPointer(pref);
1676  um->SetLastTreatment( hilling_up );
1677  um->ReduceWeedBiomass( 0.25 );
1678  um->InsectMortality( 0.75 );
1679  um->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
1680  }
1681  return true;
1682  }
1683  return false;
1684 }

References DO_IT_PROB, g_landscape_p, hilling_up, and Landscape::SupplyLEPointer().

Referenced by OPotatoes::Do(), PotatoesIndustry::Do(), Potatoes::Do(), and NorwegianPotatoes::Do().

◆ InitiateManagement()

void Farm::InitiateManagement ( void  )
virtual

Kicks off the farm's management.

Reimplemented in OptimisingFarm, and UserDefinedFarm.

1514  {
1515  for ( unsigned int i = 0; i < m_fields.size(); i++ ) {
1516  int rot_index = m_fields[ i ]->GetRotIndex();
1518  // If the field has been designated as non-rotating and therefore already has its veg type, then skip it.
1519  if ( rot_index < -1 ) {
1520  // Check for any type of permanent element type with management plan.
1521  TTypesOfLandscapeElement ele = m_fields[ i ]->GetElementType();
1522  switch (ele) {
1524  new_veg = tov_PermanentGrassLowYield;
1525  break;
1526  case tole_YoungForest:
1527  new_veg = tov_YoungForest;
1528  break;
1529  case tole_PermPasture:
1530  new_veg = tov_PermanentGrassGrazed;
1531  break;
1533  new_veg = tov_PermanentGrassTussocky;
1534  break;
1536  new_veg = tov_PermanentSetaside;
1537  break;
1538  case tole_Orchard:
1539  new_veg = tov_OrchardCrop;
1540  break;
1541  case tole_PlantNursery:
1542  new_veg = tov_PlantNursery;
1543  break;
1544  default:
1545  if (rot_index != -4) {
1546  // Error
1547  g_msg->Warn("Unexpected negative value in Farm::InitiateManagement","");
1548  exit(0);
1549  }
1550  else
1551  {
1552  new_veg = m_fields[i]->GetVegType();
1553  }
1554  }
1555  }
1556  else {
1557  rot_index = GetFirstCropIndex( m_fields[ i ]->GetElementType() );
1558  new_veg = m_rotation[ rot_index ];
1559  }
1560  // Running in fixed crop mode?
1561  if ( g_farm_fixed_crop_enable.value() ) {
1562  int fv = g_farm_fixed_crop_type.value();
1563  new_veg = g_letype->TranslateVegTypes( fv );
1564  }
1565  m_fields[ i ]->SetVegType( new_veg, tov_Undefined );
1566  m_fields[ i ]->SetRotIndex( rot_index );
1567  m_fields[ i ]->SetGrowthPhase( janfirst );
1568  // Reset event timeout counter. We are now 800 days from
1569  // oblivion.
1570  long prog_start_date = g_date->Date();
1571  m_fields[ i ]->SetVegStore( 0 );
1572  TTypesOfVegetation l_tov = new_veg;
1573  int l_nextcropstartdate = GetNextCropStartDate( m_fields[ i ], l_tov );
1574  AddNewEvent( new_veg, prog_start_date, m_fields[ i ], PROG_START, 0, false, l_nextcropstartdate, true, l_tov );
1575  }
1576 }

References g_farm_fixed_crop_enable, PROG_START, tole_Orchard, tole_PermanentSetaside, tole_PermPasture, tole_PermPastureLowYield, tole_PermPastureTussocky, tole_PlantNursery, tole_YoungForest, tov_OrchardCrop, tov_PermanentGrassGrazed, tov_PermanentGrassLowYield, tov_PermanentGrassTussocky, tov_PermanentSetaside, tov_PlantNursery, tov_Undefined, and tov_YoungForest.

Referenced by UserDefinedFarm::InitiateManagement(), and OptimisingFarm::InitiateManagement().

◆ InsecticideTreat()

bool Farm::InsecticideTreat ( LE *  a_field,
double  a_user,
int  a_days 
)
virtual

Apply insecticide to a_field.

Reimplemented in OptimisingFarm.

1349 {
1350 
1351  if (0 >= a_days)
1352  {
1353  if (( ! (a_field->GetSignal() & LE_SIG_NO_INSECTICIDE) ))
1354  {
1355  // **CJT** Turn this code on to use the pesticide engine with insecticides
1356  // g_pest->DailyQueueAdd( a_field, l_pest_insecticide_amount.value());
1357  //
1358  a_field->Trace( insecticide_treat );
1359  a_field->SetLastTreatment( insecticide_treat );
1360  if ( l_farm_insecticide_kills.value())
1361  {
1362  a_field->Insecticide( 0.36 );
1363  }
1364  a_field->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
1366  }
1367  return true;
1368  }
1369  else if ( (g_weather->GetWind()<4.5) &&
1370  (!g_weather->Raining()) && DoIt(DO_IT_PROB)) {
1371  if ( ! (a_field->GetSignal() & LE_SIG_NO_INSECTICIDE )) {
1372 // **CJT** Turn this code on to use the pesticide engine with insecticides
1373 // g_pest->DailyQueueAdd( a_field, l_pest_insecticide_amount.value());
1374 //
1375  a_field->Trace( insecticide_treat );
1376  a_field->SetLastTreatment( insecticide_treat );
1377  if ( l_farm_insecticide_kills.value()) {
1378  a_field->Insecticide( 0.36 );
1379  }
1380  a_field->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
1382  }
1383  return true;
1384  }
1385  return false;
1386 }

References Landscape::CheckForPesticideRecord(), DO_IT_PROB, g_landscape_p, insecticide, insecticide_treat, and l_farm_insecticide_kills().

Referenced by WinterRapeStrigling::Do(), Oats::Do(), DummyCropPestTesting::Do(), FieldPeasSilage::Do(), FieldPeasStrigling::Do(), FieldPeas::Do(), SpringBarleyCloverGrassStrigling::Do(), SpringBarleyCloverGrass::Do(), Triticale::Do(), Carrots::Do(), SpringBarleyPeaCloverGrassStrigling::Do(), PotatoesIndustry::Do(), Sugarbeet::Do(), Potatoes::Do(), Fodderbeet::Do(), NorwegianPotatoes::Do(), SpringBarleySKManagement::Do(), SpringBarleySpr::Do(), WinterRyeStrigling::Do(), SpringBarleySilage::Do(), SpringBarleyStrigling::Do(), SpringBarleyStriglingSingle::Do(), SpringBarleyStriglingCulm::Do(), WinterRye::Do(), SpringBarley::Do(), SpringRape::Do(), WinterWheatStrigling::Do(), WinterWheatStriglingCulm::Do(), WinterWheatStriglingSingle::Do(), WinterBarleyStrigling::Do(), WinterRape::Do(), WinterBarley::Do(), and WinterWheat::Do().

◆ InvIntPartition()

int Farm::InvIntPartition ( vector< tpct > *  items,
int  target 
)
protected

Finds all possible sums of the integers in the items array.

2493  {
2494  //Figure out how many bitmasks we need...
2495  //4 bits have a maximum value of 15, so we need 15 masks.
2496  //Calculated as:
2497  // (2 ^ ItemCount) - 1
2498  long long int sz = (long long int) items->size();
2499  if (sz>80) {
2500  // This is a warning that we did no consider all combinations of fields but 2^63 combinations should be enough :)
2501  g_msg->Warn("Too many potential fields in UserDefinedFarm::InvIntPartition: ",sz);
2502  g_msg->Warn("Farm Number: ",GetFarmNumber());
2503  sz = 63;
2504  }
2505  long int calcs = (1 << sz);
2506  //Spit out the corresponding calculation for each bitmask
2507  int sum;
2508  int found = 0;
2509  int diff = 100;
2510  for (long int i=1; i<calcs; i++) {
2511  //Get the items from our array that correspond to
2512  //the on bits in our mask
2513  sum = 0;
2514  int mask = 1;
2515  for (int bit=0; bit<sz; bit++) {
2516  if ((i & mask) > 0) {
2517  sum+=(*items)[bit].pct;
2518  }
2519  mask = mask << 1;
2520  }
2521 
2522  if (abs(sum-target) < diff ){
2523  found = i;
2524  diff = abs(sum-target);
2525  if (diff<1) break; //added 01.11.12 to prevent from checking all the combinations when the right one is found
2526  }
2527  }
2528  return found;
2529 }

References GetFarmNumber().

Referenced by AssignPermanentCrop().

◆ IsStockFarmer()

bool Farm::IsStockFarmer ( void  )
inline
905 { return m_stockfarmer; }

References m_stockfarmer.

Referenced by WinterRapeStrigling::Do(), OPermanentGrassGrazed::Do(), OCarrots::Do(), PermanentGrassGrazed::Do(), NLCatchPeaCrop::Do(), OWinterBarleyExt::Do(), OWinterBarley::Do(), OWinterRye::Do(), OOats::Do(), OTriticale::Do(), Oats::Do(), OSpringBarleyExt::Do(), OSpringBarley::Do(), FieldPeasSilage::Do(), FieldPeasStrigling::Do(), FieldPeas::Do(), OPotatoes::Do(), OWinterWheat::Do(), OWinterWheatUndersown::Do(), OWinterWheatUndersownExt::Do(), PLFodderLucerne2::Do(), OWinterRape::Do(), Carrots::Do(), NLBeetSpring::Do(), NLMaize::Do(), NLCarrotsSpring::Do(), SetAside::Do(), NLCarrots::Do(), NLCabbageSpring::Do(), NLSpringBarleySpring::Do(), PotatoesIndustry::Do(), NorwegianPotatoes::Do(), Potatoes::Do(), NLCabbage::Do(), SpringBarleySKManagement::Do(), WinterRyeStrigling::Do(), PLCarrots::Do(), SpringBarleySilage::Do(), SpringBarleySpr::Do(), NLSpringBarley::Do(), WinterRye::Do(), SpringBarleyPTreatment::Do(), SpringBarleyStriglingSingle::Do(), SpringBarleyStrigling::Do(), SpringBarleyStriglingCulm::Do(), SpringBarley::Do(), PLFodderLucerne1::Do(), SpringRape::Do(), WWheatPControl::Do(), NLPermanentGrassGrazed::Do(), WWheatPToxicControl::Do(), WinterWheatStrigling::Do(), WWheatPTreatment::Do(), WinterWheatStriglingCulm::Do(), NLGrassGrazed2::Do(), WinterWheatStriglingSingle::Do(), PLBeans::Do(), NLGrassGrazedLast::Do(), WinterBarleyStrigling::Do(), WinterRape::Do(), AgroChemIndustryCereal::Do(), NLPotatoesSpring::Do(), WinterBarley::Do(), PLWinterRye::Do(), PLMaizeSilage::Do(), PLSpringBarley::Do(), PLMaize::Do(), NLTulips::Do(), PLWinterTriticale::Do(), PLWinterWheat::Do(), PLWinterWheatLate::Do(), PLSpringWheat::Do(), PLBeet::Do(), PLWinterBarley::Do(), PLPotatoes::Do(), PLWinterRape::Do(), WinterWheat::Do(), and WinterRape::HerbiZero().

◆ LeSwitch()

bool Farm::LeSwitch ( FarmEvent ev)
protected

Call do function for any crop with an outstanding event. Signal if the crop has terminated.

386  {
387  // Ignore this event if it is from the execution of
388  // a previous management plan.
389  if (ev->m_field->GetRunNum() > ev->m_run)
390  return false;
391  // Store what we are trying to do this time.
392  // ***FN*** To be cleaned up later.
393  ev->m_field->m_tried_to_do = ev->m_todo;
394  bool done;
395 
396  switch (ev->m_event) {
397  case tov_Carrots:
398  done = m_carrots->Do( this, ev->m_field, ev );
399  break;
400  case tov_BroadBeans:
401  done = m_broadbeans->Do( this, ev->m_field, ev );
402  break;
403  case tov_FodderGrass:
404  done = m_foddergrass->Do( this, ev->m_field, ev );
405  break;
407  done = m_CGG1->Do( this, ev->m_field, ev );
408  break;
410  done = m_CGG2->Do( this, ev->m_field, ev );
411  break;
412  case tov_FieldPeas:
413  done = m_fieldpeas->Do( this, ev->m_field, ev );
414  break;
415  case tov_FieldPeasSilage:
416  done = m_fieldpeassilage->Do( this, ev->m_field, ev );
417  break;
418  case tov_FodderBeet:
419  done = m_fodderbeet->Do( this, ev->m_field, ev );
420  break;
421  case tov_SugarBeet:
422  done = m_sugarbeet->Do( this, ev->m_field, ev );
423  break;
424  case tov_OFodderBeet:
425  done = m_ofodderbeet->Do( this, ev->m_field, ev );
426  break;
427  case tov_Maize:
428  done = m_maize->Do( this, ev->m_field, ev );
429  break;
431  done = m_OBarleyPCG->Do( this, ev->m_field, ev );
432  break;
433  case tov_OCarrots:
434  done = m_ocarrots->Do( this, ev->m_field, ev );
435  break;
437  done = m_OCGS1->Do( this, ev->m_field, ev );
438  break;
440  done = m_OCGG1->Do( this, ev->m_field, ev );
441  break;
443  done = m_OCGG2->Do( this, ev->m_field, ev );
444  break;
445  case tov_OFieldPeas:
446  done = m_ofieldpeas->Do( this, ev->m_field, ev );
447  break;
449  done = m_ofieldpeassilage->Do( this, ev->m_field, ev );
450  break;
451  case tov_OGrazingPigs:
452  done = m_ograzingpigs->Do( this, ev->m_field, ev );
453  break;
454  case tov_OrchardCrop:
455  done = m_orchardcrop->Do( this, ev->m_field, ev );
456  break;
457  case tov_OOats:
458  done = m_ooats->Do( this, ev->m_field, ev );
459  break;
460  case tov_Oats:
461  done = m_oats->Do( this, ev->m_field, ev );
462  break;
464  done = m_opermgrassgrazed->Do( this, ev->m_field, ev );
465  break;
466  case tov_OPotatoes:
467  done = m_opotatoes->Do( this, ev->m_field, ev );
468  break;
469  case tov_OSpringBarley:
470  done = m_ospringbarley->Do( this, ev->m_field, ev );
471  break;
472  case tov_OSBarleySilage:
473  done = m_osbarleysilage->Do( this, ev->m_field, ev );
474  break;
475  case tov_OSeedGrass1:
476  done = m_oseedgrass1->Do( this, ev->m_field, ev );
477  break;
478  case tov_OSeedGrass2:
479  done = m_oseedgrass2->Do( this, ev->m_field, ev );
480  break;
482  done = m_ospringbarleyext->Do( this, ev->m_field, ev );
483  break;
485  done = m_ospringbarleypigs->Do( this, ev->m_field, ev );
486  break;
487  case tov_OWinterBarley:
488  done = m_owinterbarley->Do( this, ev->m_field, ev );
489  break;
491  done = m_owinterbarleyext->Do( this, ev->m_field, ev );
492  break;
494  done = m_owinterwheatundersown->Do( this, ev->m_field, ev );
495  break;
496  case tov_OWinterWheat:
497  done = m_owinterwheat->Do( this, ev->m_field, ev );
498  break;
500  done = m_owinterwheatundersownext->Do( this, ev->m_field, ev );
501  break;
502  case tov_OWinterRape:
503  done = m_owinterrape->Do( this, ev->m_field, ev );
504  break;
505  case tov_OWinterRye:
506  done = m_owinterrye->Do( this, ev->m_field, ev );
507  break;
509  done = m_permgrassgrazed->Do( this, ev->m_field, ev );
510  break;
512  done = m_permgrasslowyield->Do( this, ev->m_field, ev );
513  break;
515  done = m_permgrasstussocky->Do( this, ev->m_field, ev );
516  break;
518  done = m_permanentsetaside->Do( this, ev->m_field, ev );
519  break;
520  case tov_Potatoes:
521  done = m_potatoes->Do( this, ev->m_field, ev );
522  break;
524  done = m_potatoesindustry->Do( this, ev->m_field, ev );
525  break;
526  case tov_SeedGrass1:
527  done = m_seedgrass1->Do( this, ev->m_field, ev );
528  break;
529  case tov_SeedGrass2:
530  done = m_seedgrass2->Do( this, ev->m_field, ev );
531  break;
532  case tov_Setaside:
533  done = m_setaside->Do( this, ev->m_field, ev );
534  break;
535  case tov_SpringBarley:
536  done = m_springbarley->Do( this, ev->m_field, ev );
537  break;
538  case tov_SpringBarleySpr:
539  done = m_springbarleyspr->Do( this, ev->m_field, ev );
540  break;
542  done = m_springbarleyptreatment->Do( this, ev->m_field, ev );
543  break;
545  done = m_springbarleyskmanagement->Do( this, ev->m_field, ev );
546  break;
548  done = m_sbarleyclovergrass->Do( this, ev->m_field, ev );
549  break;
551  done = m_springbarleyseed->Do( this, ev->m_field, ev );
552  break;
554  done = m_springbarleysilage->Do( this, ev->m_field, ev );
555  break;
556  case tov_SpringRape:
557  done = m_springrape->Do( this, ev->m_field, ev );
558  break;
559  case tov_Triticale:
560  done = m_triticale->Do( this, ev->m_field, ev );
561  break;
562  case tov_OTriticale:
563  done = m_otriticale->Do( this, ev->m_field, ev );
564  break;
565  case tov_WinterBarley:
566  done = m_winterbarley->Do( this, ev->m_field, ev );
567  break;
568  case tov_WinterRape:
569  done = m_winterrape->Do( this, ev->m_field, ev );
570  break;
571  case tov_WinterRye:
572  done = m_winterrye->Do( this, ev->m_field, ev );
573  break;
574  case tov_WinterWheat:
575  done = m_winterwheat->Do( this, ev->m_field, ev );
576  break;
577  case tov_WWheatPControl:
578  done = m_wwheatpcontrol->Do( this, ev->m_field, ev );
579  break;
581  done = m_wwheatptoxiccontrol->Do( this, ev->m_field, ev );
582  break;
584  done = m_wwheatptreatment->Do( this, ev->m_field, ev );
585  break;
587  done = m_agrochemindustrycereal->Do( this, ev->m_field, ev );
588  break;
590  done = m_winterwheatstrigling->Do( this, ev->m_field, ev );
591  break;
593  done = m_winterwheatstriglingsingle->Do( this, ev->m_field, ev );
594  break;
596  done = m_winterwheatstriglingculm->Do( this, ev->m_field, ev );
597  break;
599  done = m_springbarleyclovergrassstrigling->Do( this, ev->m_field, ev );
600  break;
602  done = m_springbarleystrigling->Do( this, ev->m_field, ev );
603  break;
605  done = m_springbarleystriglingsingle->Do( this, ev->m_field, ev );
606  break;
608  done = m_springbarleystriglingculm->Do( this, ev->m_field, ev );
609  break;
610  case tov_MaizeStrigling:
611  done = m_maizestrigling->Do( this, ev->m_field, ev );
612  break;
613  case tov_MaizeSilage:
614  done = m_maizesilage->Do( this, ev->m_field, ev );
615  break;
616  case tov_OMaizeSilage:
617  done = m_omaizesilage->Do( this, ev->m_field, ev );
618  break;
620  done = m_winterrapestrigling->Do( this, ev->m_field, ev );
621  break;
623  done = m_winterryestrigling->Do( this, ev->m_field, ev );
624  break;
626  done = m_winterbarleystrigling->Do( this, ev->m_field, ev );
627  break;
629  done = m_fieldpeasstrigling->Do( this, ev->m_field, ev );
630  break;
632  done = m_springbarleypeaclovergrassstrigling->Do( this, ev->m_field, ev );
633  break;
634  case tov_PlantNursery:
635  // uses youngforest management because this effectively does nothing, but stops the crop management creating looping error
636  case tov_YoungForest:
637  done = m_youngforest->Do(this, ev->m_field, ev);
638  break;
640  done = m_norwegianpotatoes->Do(this, ev->m_field, ev);
641  break;
642  case tov_NorwegianOats:
643  done = m_norwegianoats->Do(this, ev->m_field, ev);
644  break;
646  done = m_norwegianspringbarley->Do(this, ev->m_field, ev);
647  break;
648 
649  case tov_PLWinterWheat:
650  done = m_plwinterwheat->Do(this, ev->m_field, ev);
651  break;
652  case tov_PLWinterRape:
653  done = m_plwinterrape->Do(this, ev->m_field, ev);
654  break;
655  case tov_PLWinterBarley:
656  done = m_plwinterbarley->Do(this, ev->m_field, ev);
657  break;
659  done = m_plwintertriticale->Do(this, ev->m_field, ev);
660  break;
661  case tov_PLWinterRye:
662  done = m_plwinterrye->Do(this, ev->m_field, ev);
663  break;
664  case tov_PLSpringWheat:
665  done = m_plspringwheat->Do(this, ev->m_field, ev);
666  break;
667  case tov_PLSpringBarley:
668  done = m_plspringbarley->Do(this, ev->m_field, ev);
669  break;
670  case tov_PLMaize:
671  done = m_plmaize->Do(this, ev->m_field, ev);
672  break;
673  case tov_PLMaizeSilage:
674  done = m_plmaizesilage->Do(this, ev->m_field, ev);
675  break;
676  case tov_PLPotatoes:
677  done = m_plpotatoes->Do(this, ev->m_field, ev);
678  break;
679  case tov_PLBeet:
680  done = m_plbeet->Do(this, ev->m_field, ev);
681  break;
683  done = m_plfodderlucerne1->Do(this, ev->m_field, ev);
684  break;
686  done = m_plfodderlucerne2->Do(this, ev->m_field, ev);
687  break;
688  case tov_PLCarrots:
689  done = m_plcarrots->Do(this, ev->m_field, ev);
690  break;
692  done = m_plspringbarleyspr->Do(this, ev->m_field, ev);
693  break;
695  done = m_plwinterwheatlate->Do(this, ev->m_field, ev);
696  break;
697  case tov_PLBeetSpr:
698  done = m_plbeetspr->Do(this, ev->m_field, ev);
699  break;
700  case tov_PLBeans:
701  done = m_plbeans->Do(this, ev->m_field, ev);
702  break;
703 
704  case tov_NLBeet:
705  done = m_nlbeet->Do(this, ev->m_field, ev);
706  break;
707  case tov_NLCarrots:
708  done = m_nlcarrots->Do(this, ev->m_field, ev);
709  break;
710  case tov_NLMaize:
711  done = m_nlmaize->Do(this, ev->m_field, ev);
712  break;
713  case tov_NLPotatoes:
714  done = m_nlpotatoes->Do(this, ev->m_field, ev);
715  break;
716  case tov_NLSpringBarley:
717  done = m_nlspringbarley->Do(this, ev->m_field, ev);
718  break;
719  case tov_NLWinterWheat:
720  done = m_nlwinterwheat->Do(this, ev->m_field, ev);
721  break;
722  case tov_NLCabbage:
723  done = m_nlcabbage->Do(this, ev->m_field, ev);
724  break;
725  case tov_NLTulips:
726  done = m_nltulips->Do(this, ev->m_field, ev);
727  break;
728  case tov_NLGrassGrazed1:
729  done = m_nlgrassgrazed1->Do(this, ev->m_field, ev);
730  break;
732  done = m_nlgrassgrazed1spring->Do(this, ev->m_field, ev);
733  break;
734  case tov_NLGrassGrazed2:
735  done = m_nlgrassgrazed2->Do(this, ev->m_field, ev);
736  break;
738  done = m_nlgrassgrazedlast->Do(this, ev->m_field, ev);
739  break;
741  done = m_nlpermanentgrassgrazed->Do(this, ev->m_field, ev);
742  break;
743  case tov_NLBeetSpring:
744  done = m_nlbeetspring->Do(this, ev->m_field, ev);
745  break;
746  case tov_NLCarrotsSpring:
747  done = m_nlcarrotsspring->Do(this, ev->m_field, ev);
748  break;
749  case tov_NLMaizeSpring:
750  done = m_nlmaizespring->Do(this, ev->m_field, ev);
751  break;
753  done = m_nlpotatoesspring->Do(this, ev->m_field, ev);
754  break;
756  done = m_nlspringbarleyspring->Do(this, ev->m_field, ev);
757  break;
758  case tov_NLCabbageSpring:
759  done = m_nlcabbagespring->Do(this, ev->m_field, ev);
760  break;
761  case tov_NLCatchPeaCrop:
762  done = m_nlcatchpeacrop->Do(this, ev->m_field, ev);
763  break;
764 
766  done = m_dummycroppesttesting->Do(this, ev->m_field, ev);
767  break;
768 
769  case tov_Lawn:
770  // No current actions
771  done = true;
772  break;
773  /* case tov_OFirstYearDanger: done = m_ofirstyeardanger->Do( this, ev->m_field, ev ); break; */
774  default:
775  char veg_type[ 20 ];
776  sprintf( veg_type, "%d", ev->m_event );
777  g_msg->Warn( WARN_FILE, "Farm::LeSwitch(): ""Unknown crop type: ", veg_type );
778  exit( 1 );
779 
780  }
781  return done;
782 }

References FarmEvent::m_event, FarmEvent::m_field, FarmEvent::m_run, FarmEvent::m_todo, tov_AgroChemIndustryCereal, tov_BroadBeans, tov_Carrots, tov_CloverGrassGrazed1, tov_CloverGrassGrazed2, tov_DummyCropPestTesting, tov_FieldPeas, tov_FieldPeasSilage, tov_FieldPeasStrigling, tov_FodderBeet, tov_FodderGrass, tov_Lawn, tov_Maize, tov_MaizeSilage, tov_MaizeStrigling, tov_NLBeet, tov_NLBeetSpring, tov_NLCabbage, tov_NLCabbageSpring, tov_NLCarrots, tov_NLCarrotsSpring, tov_NLCatchPeaCrop, tov_NLGrassGrazed1, tov_NLGrassGrazed1Spring, tov_NLGrassGrazed2, tov_NLGrassGrazedLast, tov_NLMaize, tov_NLMaizeSpring, tov_NLPermanentGrassGrazed, tov_NLPotatoes, tov_NLPotatoesSpring, tov_NLSpringBarley, tov_NLSpringBarleySpring, tov_NLTulips, tov_NLWinterWheat, tov_NorwegianOats, tov_NorwegianPotatoes, tov_NorwegianSpringBarley, tov_Oats, tov_OBarleyPeaCloverGrass, tov_OCarrots, tov_OCloverGrassGrazed1, tov_OCloverGrassGrazed2, tov_OCloverGrassSilage1, tov_OFieldPeas, tov_OFieldPeasSilage, tov_OFodderBeet, tov_OGrazingPigs, tov_OMaizeSilage, tov_OOats, tov_OPermanentGrassGrazed, tov_OPotatoes, tov_OrchardCrop, tov_OSBarleySilage, tov_OSeedGrass1, tov_OSeedGrass2, tov_OSpringBarley, tov_OSpringBarleyExt, tov_OSpringBarleyPigs, tov_OTriticale, tov_OWinterBarley, tov_OWinterBarleyExt, tov_OWinterRape, tov_OWinterRye, tov_OWinterWheat, tov_OWinterWheatUndersown, tov_OWinterWheatUndersownExt, tov_PermanentGrassGrazed, tov_PermanentGrassLowYield, tov_PermanentGrassTussocky, tov_PermanentSetaside, tov_PlantNursery, tov_PLBeans, tov_PLBeet, tov_PLBeetSpr, tov_PLCarrots, tov_PLFodderLucerne1, tov_PLFodderLucerne2, tov_PLMaize, tov_PLMaizeSilage, tov_PLPotatoes, tov_PLSpringBarley, tov_PLSpringBarleySpr, tov_PLSpringWheat, tov_PLWinterBarley, tov_PLWinterRape, tov_PLWinterRye, tov_PLWinterTriticale, tov_PLWinterWheat, tov_PLWinterWheatLate, tov_Potatoes, tov_PotatoesIndustry, tov_SeedGrass1, tov_SeedGrass2, tov_Setaside, tov_SpringBarley, tov_SpringBarleyCloverGrass, tov_SpringBarleyCloverGrassStrigling, tov_SpringBarleyPeaCloverGrassStrigling, tov_SpringBarleyPTreatment, tov_SpringBarleySeed, tov_SpringBarleySilage, tov_SpringBarleySKManagement, tov_SpringBarleySpr, tov_SpringBarleyStrigling, tov_SpringBarleyStriglingCulm, tov_SpringBarleyStriglingSingle, tov_SpringRape, tov_SugarBeet, tov_Triticale, tov_WinterBarley, tov_WinterBarleyStrigling, tov_WinterRape, tov_WinterRapeStrigling, tov_WinterRye, tov_WinterRyeStrigling, tov_WinterWheat, tov_WinterWheatStrigling, tov_WinterWheatStriglingCulm, tov_WinterWheatStriglingSingle, tov_WWheatPControl, tov_WWheatPToxicControl, tov_WWheatPTreatment, and tov_YoungForest.

◆ ListOpenFields()

polylist * Farm::ListOpenFields ( int  a_openness)

Returns a list of fields with openness above a_openness.

Returns the list of fields more open than a_openness.

9400 {
9401  polylist* p_list = new polylist;
9402  int nf = (int) m_fields.size();
9403  for ( int i = 0; i < nf; i++ )
9404  {
9405  if ( m_fields[ i ]->GetOpenness() >= a_openness )
9406  {
9407  p_list->push_back( m_fields[i]->GetPoly());
9408  }
9409  }
9410  return p_list;
9411 }

References m_fields.

◆ MakeStockFarmer()

virtual void Farm::MakeStockFarmer ( void  )
inlinevirtual

◆ Management()

void Farm::Management ( void  )
virtual

Starts the main management loop for the farm and performs some error checking.

361  {
362  HandleEvents();
363  for ( unsigned int i = 0; i < m_fields.size(); i++ ) {
364  // Check for infinite loop in management plan.
365  int count = m_fields[ i ]->GetVegStore();
366  if ( count >= 0 )
367  m_fields[ i ]->SetVegStore( ++count );
368  if ( count > 800 ) {
369  // More than two years where nothing happened.
370  // Raise 'Merry Christmas'!
371  char error_num[ 20 ];
372  sprintf( error_num, "%d", m_fields[ i ]->GetVegType() );
373  g_msg->Warn( WARN_BUG, "I the Farm Manager caught infinite loop in tov type:", error_num );
374  sprintf( error_num, "%d", m_fields[ i ]->m_tried_to_do );
375  g_msg->Warn( WARN_BUG, "It was last seen trying to perform action # ""(or thereabouts):", error_num );
376  exit( 1 );
377  }
378  }
379 }

◆ Molluscicide()

bool Farm::Molluscicide ( LE *  a_field,
double  a_user,
int  a_days 
)
virtual

Apply molluscidie to a_field.

1482 {
1483 
1484  if (0 >= a_days) {
1485  if ( (!g_weather->Raining()) && (g_weather->GetWind()<4.5) &&
1486  (! (a_field->GetSignal() & LE_SIG_NO_MOLLUSC ))) {
1487  a_field->Trace( molluscicide );
1488  a_field->SetLastTreatment( molluscicide );
1489  a_field->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
1491  }
1492  return true;
1493  }
1494  else if ( (0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
1495  if ( ! (a_field->GetSignal() & LE_SIG_NO_MOLLUSC) ) {
1496  a_field->Trace( molluscicide );
1497  a_field->SetLastTreatment( molluscicide );
1498  a_field->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
1500  }
1501  return true;
1502  }
1503  return false;
1504 }

References Landscape::CheckForPesticideRecord(), DO_IT_PROB, g_landscape_p, insecticide, and molluscicide.

◆ PigsAreOut()

bool Farm::PigsAreOut ( LE *  a_field,
double  a_user,
int  a_days 
)
virtual

Start a pig grazing event on a_field today or soon.

2113 {
2114 
2115  if ( (0 >= a_days)|| DoIt(50/a_days)) {
2116  a_field->TogglePigGrazing();
2117  int pref=a_field->GetUnsprayedMarginPolyRef();
2118  if (pref!=-1){
2119  // Must have an unsprayed margin so need to pass the information on to it
2120  LE* um=g_landscape_p->SupplyLEPointer(pref);
2121  um->TogglePigGrazing();
2122  }
2123  return true;
2124  }
2125  return false;
2126 }

References g_landscape_p, and Landscape::SupplyLEPointer().

Referenced by OGrazingPigs::Do().

◆ PigsAreOutForced()

bool Farm::PigsAreOutForced ( LE *  a_field,
double  a_user,
int  a_days 
)
virtual

Start a pig grazing event on a_field today - no exceptions.

2091 {
2092  a_field->SetLastTreatment( pigs_out );
2093  a_field->Trace( pigs_out );
2094  // Reduce the vegetation because of grazing
2095  a_field->ReduceVeg_Extended( l_farm_pig_veg_reduce.value() );
2096  // make this a function of grazing pressure
2097  //and field size - perhaps in a later life
2098  int pref=a_field->GetUnsprayedMarginPolyRef();
2099  if (pref!=-1){
2100  // Must have an unsprayed margin so need to pass the information on to it
2101  LE* um=g_landscape_p->SupplyLEPointer(pref);
2102  um->SetLastTreatment( pigs_out );
2103  um->ReduceVeg_Extended( l_farm_pig_veg_reduce.value() );
2104  }
2105  return false;
2106 }

References g_landscape_p, l_farm_pig_veg_reduce(), pigs_out, and Landscape::SupplyLEPointer().

Referenced by OGrazingPigs::Do().

◆ PigsOut()

bool Farm::PigsOut ( LE *  a_field,
double  a_user,
int  a_days 
)
virtual

Generate a 'pigs_out' event for every day the cattle are on a_field.

2063 {
2064 
2065  if ( (0 >= a_days)|| DoIt(DO_IT_PROB))
2066  {
2067  a_field->TogglePigGrazing();
2068  a_field->Trace( pigs_out );
2069  a_field->SetLastTreatment( pigs_out );
2070  // Reduce the vegetation because of grazing
2071  a_field->ReduceVeg_Extended( l_farm_pig_veg_reduce.value());
2072  // make this a function of grazing pressure
2073  //and field size - perhaps in a later life
2074  int pref=a_field->GetUnsprayedMarginPolyRef();
2075  if (pref!=-1){
2076  // Must have an unsprayed margin so need to pass the information on to it
2077  LE* um=g_landscape_p->SupplyLEPointer(pref);
2078  um->SetLastTreatment( pigs_out );
2079  um->ReduceVeg_Extended( l_farm_pig_veg_reduce.value() );
2080  }
2081  return true;
2082  }
2083  return false;
2084 }

References DO_IT_PROB, g_landscape_p, l_farm_pig_veg_reduce(), pigs_out, and Landscape::SupplyLEPointer().

Referenced by OGrazingPigs::Do().

◆ PreseedingCultivator()

bool Farm::PreseedingCultivator ( LE *  a_field,
double  a_user,
int  a_days 
)
virtual

Carry out preseeding cultivation on a_field (tilling set including cultivator and string roller to compact soil)

312 {
313  if ((0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
314  a_field->Trace(preseeding_cultivator);
315  a_field->SetLastTreatment(preseeding_cultivator);
316  // Apply 90% mortality to the insects as for harrowing
317  a_field->InsectMortality(0.1);
318  // Reduce the vegetation to zero as for harrowing
319  a_field->ZeroVeg();
320  int pref = a_field->GetUnsprayedMarginPolyRef();
321  if (pref != -1) {
322  // Must have an unsprayed margin so need to pass the information on to it
323  LE* um = g_landscape_p->SupplyLEPointer(pref);
324  um->SetLastTreatment(preseeding_cultivator);
325  um->InsectMortality(0.1);
326  um->ZeroVeg();
327  }
328  return true;
329  }
330  return false;
331 }

References DO_IT_PROB, g_landscape_p, preseeding_cultivator, and Landscape::SupplyLEPointer().

Referenced by NLCabbageSpring::Do(), and NLGrassGrazed1Spring::Do().

◆ PreseedingCultivatorSow()

bool Farm::PreseedingCultivatorSow ( LE *  a_field,
double  a_user,
int  a_days 
)
virtual

Carry out preseeding cultivation together with sow on a_field (tilling and sowing set including cultivator and string roller to compact soil)

338 {
339  if ((0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
340  a_field->Trace(preseeding_cultivator_sow);
341  a_field->SetLastTreatment(preseeding_cultivator_sow);
342  a_field->SetGrowthPhase(sow); // as with AutumnSow treatment
343  a_field->SetLastSownVeg(a_field->GetVegType()); // as with AutumnSow treatment
344  // Reduce the vegetation to zero
345  a_field->ZeroVeg();
346  int pref = a_field->GetUnsprayedMarginPolyRef();
347  if (pref != -1) {
348  // Must have an unsprayed margin so need to pass the information on to it
349  LE* um = g_landscape_p->SupplyLEPointer(pref);
350  um->SetLastTreatment(preseeding_cultivator_sow);
351  um->SetGrowthPhase(sow);
352  um->ZeroVeg();
353  um->SetLastSownVeg(um->GetVegType());
354  }
355  return true;
356  }
357  return false;
358 }

References DO_IT_PROB, g_landscape_p, preseeding_cultivator_sow, and Landscape::SupplyLEPointer().

◆ Prob_multiplier()

◆ ProductApplication()

bool Farm::ProductApplication ( LE *  a_field,
double  a_user,
int  a_days,
double  a_applicationrate,
PlantProtectionProducts  a_ppp 
)
virtual

Apply test pesticide to a_field.

1446 {
1447  // NOTE Differs from normal pesticide in that it will be done on the last
1448  // day if not managed before
1449  if (0 >= a_days) {
1450  a_field->Trace(product_treat);
1451  a_field->SetLastTreatment(product_treat);
1452  if (l_farm_insecticide_kills.value())
1453  {
1454  a_field->Insecticide(cfg_CustomInsecticideKillProp.value());
1455  }
1456  a_field->SetTramlinesDecay(EL_TRAMLINE_DECAYTIME);
1458  g_pest->DailyQueueAdd(a_field, a_applicationrate, a_ppp);
1459  return true;
1460  }
1461  else {
1462  if ((!g_weather->Raining()) && (g_weather->GetWind() < 4.5)) {
1463  a_field->Trace(product_treat);
1464  a_field->SetLastTreatment(product_treat);
1465  if (l_farm_insecticide_kills.value()) {
1466  a_field->Insecticide(cfg_CustomInsecticideKillProp.value());
1467  }
1468  a_field->SetTramlinesDecay(EL_TRAMLINE_DECAYTIME);
1470  g_pest->DailyQueueAdd(a_field, a_applicationrate, a_ppp);
1471  return true;
1472  }
1473  }
1474  return false;
1475 }

References cfg_CustomInsecticideKillProp(), Landscape::CheckForPesticideRecord(), g_landscape_p, g_pest, l_farm_insecticide_kills(), product_treat, and testpesticide.

Referenced by OrchardCrop::Do(), SpringBarleyPTreatment::Do(), SpringRape::Do(), WWheatPTreatment::Do(), WWheatPToxicControl::Do(), WinterRape::Do(), AgroChemIndustryCereal::Do(), and WinterWheat::Do().

◆ ProductApplication_DateLimited()

bool Farm::ProductApplication_DateLimited ( LE *  a_field,
double  ,
int  ,
double  a_applicationrate,
PlantProtectionProducts  a_ppp 
)
virtual

Special pesticide trial functionality.

This methods tests for date limitations

2397 {
2399  int year = g_landscape_p->SupplyYearNumber();
2400  if (year < cfg_productapplicstartyear.value()) return false;
2401  if (year > cfg_productapplicendyear.value()) return false;
2402  a_field->Trace(trial_insecticidetreat); // Debug function only
2403  a_field->SetLastTreatment(trial_insecticidetreat);
2404  a_field->InsectMortality(cfg_CustomInsecticideKillProp.value()); // Change this manually if it is really a herbicide
2405  a_field->SetTramlinesDecay(EL_TRAMLINE_DECAYTIME);
2406  a_field->SetSprayedToday(true);
2407  g_pest->DailyQueueAdd(a_field, a_applicationrate, a_ppp);
2408  return true;
2409 }

References cfg_CustomInsecticideKillProp(), cfg_productapplicendyear, cfg_productapplicstartyear, g_landscape_p, g_pest, Landscape::SupplyYearNumber(), and trial_insecticidetreat.

Referenced by SpringBarleyCloverGrass::Do(), SpringBarleySpr::Do(), SpringBarleySilage::Do(), SpringBarley::Do(), WWheatPControl::Do(), and WinterRape::Do().

◆ ReadRotation()

void Farm::ReadRotation ( std::string  fname)
protected

◆ RemoveField()

void Farm::RemoveField ( LE *  a_field)

Removes a field from a farm.

1473  {
1474  int nf = (int) m_fields.size();
1475  for ( int i = 0; i < nf; i++ ) {
1476  if ( m_fields[ i ] == a_field ) {
1477  m_fields.erase( m_fields.begin() + i );
1478  return;
1479  }
1480  }
1481  // If we reach here there is something wrong because the field is not a
1482  // member of this farm
1483  g_msg->Warn( WARN_BUG, "Farm::RemoveField(LE* a_field): ""Unknown field! ", "" );
1484  exit( 1 );
1485 }

◆ RemoveHunter()

void Farm::RemoveHunter ( Hunter *  a_hunter)
inline
925  {
926  for (int h = 0; h < m_HuntersList.size(); h++) {
927  if (m_HuntersList[ h ] == a_hunter) {
928  m_HuntersList.erase( m_HuntersList.begin() + h );
929  }
930  }
931  }

References m_HuntersList.

◆ RowCultivation()

bool Farm::RowCultivation ( LE *  a_field,
double  a_user,
int  a_days 
)
virtual

Carry out a harrowing between crop rows on a_field.

1511 {
1512 
1513  if ( (0 >= a_days) && (g_weather->GetRainPeriod(g_date->Date(),3)<0.1) )
1514  {
1515  // Too much rain, just give up and claim we did it.
1516  return true;
1517  }
1518 
1519  if ( (0 >= a_days) ||
1520  ((g_weather->GetRainPeriod(g_date->Date(),3)<0.1) && DoIt(DO_IT_PROB))
1521  ) {
1522  a_field->Trace( row_cultivation );
1523  a_field->SetLastTreatment( row_cultivation );
1524  a_field->ReduceWeedBiomass( 0.5 );
1525  a_field->InsectMortality( 0.25 );
1526  a_field->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
1527  int pref=a_field->GetUnsprayedMarginPolyRef();
1528  if (pref!=-1){
1529  // Must have an unsprayed margin so need to pass the information on to it
1530  LE* um=g_landscape_p->SupplyLEPointer(pref);
1531  um->SetLastTreatment( row_cultivation );
1532  um->InsectMortality( 0.25 );
1533  um->ReduceWeedBiomass( 0.5 );
1534  um->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
1535  }
1536  return true;
1537  }
1538  return false;
1539 }

References DO_IT_PROB, g_landscape_p, row_cultivation, and Landscape::SupplyLEPointer().

Referenced by WinterRapeStrigling::Do(), BroadBeans::Do(), OCarrots::Do(), OMaizeSilage::Do(), Maize::Do(), MaizeSilage::Do(), MaizeStrigling::Do(), OFodderbeet::Do(), OWinterRape::Do(), Carrots::Do(), Sugarbeet::Do(), Fodderbeet::Do(), SpringRape::Do(), WinterRape::Do(), SpringRape::RowcolOne(), and WinterRape::RowcolOne().

◆ SetFarmNumber()

void Farm::SetFarmNumber ( int  a_farm_num)
inline
781 { m_farm_num = a_farm_num; }

References m_farm_num.

◆ ShallowHarrow()

bool Farm::ShallowHarrow ( LE *  a_field,
double  a_user,
int  a_days 
)
virtual

Carry out a shallow harrow event on a_field, e.g., after grass cutting event.

499 {
500 
501  if ((0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
502  a_field->Trace(shallow_harrow);
503  a_field->SetLastTreatment(shallow_harrow);
504  // 30% insect mortality
505  a_field->InsectMortality(0.7);
506  // remove vegetation partly
507  a_field->ReduceVeg(0.8);
508  int pref = a_field->GetUnsprayedMarginPolyRef();
509  if (pref != -1) {
510  // Must have an unsprayed margin so need to pass the information on to it
511  LE* um = g_landscape_p->SupplyLEPointer(pref);
512  um->SetLastTreatment(shallow_harrow);
513  um->InsectMortality(0.7);
514  um->ReduceVeg(0.8);
515  }
516  return true;
517  }
518  return false;
519 }

References DO_IT_PROB, g_landscape_p, shallow_harrow, and Landscape::SupplyLEPointer().

Referenced by PLFodderLucerne2::Do().

◆ SleepAllDay()

bool Farm::SleepAllDay ( LE *  a_field,
double  a_user,
int  a_days 
)
virtual

Nothing to to today on a_field.

242 {
243  if (0 >= a_days) {
244  a_field->Trace(sleep_all_day);
245  a_field->SetLastTreatment(sleep_all_day);
246  int pref = a_field->GetUnsprayedMarginPolyRef();
247  if (pref != -1) {
248  // Must have an unsprayed margin so need to pass the information on to it
249  LE* um = g_landscape_p->SupplyLEPointer(pref);
250  um->SetLastTreatment(sleep_all_day);
251  }
252  return true;
253  }
254  return false;
255 }

References g_landscape_p, sleep_all_day, and Landscape::SupplyLEPointer().

◆ Spraying_fungins()

◆ Spraying_herbicides()

◆ SpringHarrow()

bool Farm::SpringHarrow ( LE *  a_field,
double  a_user,
int  a_days 
)
virtual

Carry out a harrow event in the spring on a_field.

472 {
473 
474  if ( (0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
475  a_field->Trace( spring_harrow );
476  a_field->SetLastTreatment( spring_harrow );
477  // 30% insect mortality
478  a_field->InsectMortality( 0.7 );
479  // remove all vegetation
480  a_field->ZeroVeg();
481  int pref=a_field->GetUnsprayedMarginPolyRef();
482  if (pref!=-1){
483  // Must have an unsprayed margin so need to pass the information on to it
484  LE* um=g_landscape_p->SupplyLEPointer(pref);
485  um->SetLastTreatment( spring_harrow );
486  um->InsectMortality( 0.7 );
487  um->ZeroVeg();
488  }
489  return true;
490  }
491  return false;
492 }

References DO_IT_PROB, g_landscape_p, spring_harrow, and Landscape::SupplyLEPointer().

Referenced by NorwegianOats::Do(), NorwegianSpringBarley::Do(), BroadBeans::Do(), OSBarleySilage::Do(), OFieldPeas::Do(), OFieldPeasSilage::Do(), OCarrots::Do(), OMaizeSilage::Do(), OBarleyPeaCloverGrass::Do(), OOats::Do(), MaizeStrigling::Do(), MaizeSilage::Do(), Maize::Do(), OSpringBarleyPigs::Do(), OSpringBarleyExt::Do(), Oats::Do(), SpringBarleySeed::Do(), OSpringBarley::Do(), FieldPeasSilage::Do(), FieldPeasStrigling::Do(), OPotatoes::Do(), FieldPeas::Do(), SpringBarleyCloverGrassStrigling::Do(), OFodderbeet::Do(), SpringBarleyCloverGrass::Do(), Carrots::Do(), SpringBarleyPeaCloverGrassStrigling::Do(), Sugarbeet::Do(), PotatoesIndustry::Do(), Potatoes::Do(), NorwegianPotatoes::Do(), Fodderbeet::Do(), SpringBarleySKManagement::Do(), SpringBarleySilage::Do(), SpringBarleySpr::Do(), SpringBarleyStrigling::Do(), SpringBarleyPTreatment::Do(), SpringBarleyStriglingSingle::Do(), SpringBarleyStriglingCulm::Do(), SpringBarley::Do(), and SpringRape::Do().

◆ SpringPlough()

bool Farm::SpringPlough ( LE *  a_field,
double  a_user,
int  a_days 
)
virtual

Carry out a ploughing event in the spring on a_field.

445 {
446 
447  if ((a_days <= 0) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
448  a_field->Trace( spring_plough );
449  a_field->SetLastTreatment( spring_plough );
450  // Apply 90% mortality to the insects
451  a_field->InsectMortality( 0.1 );
452  // Reduce the vegetation to zero
453  a_field->ZeroVeg();
454  int pref=a_field->GetUnsprayedMarginPolyRef();
455  if (pref!=-1){
456  // Must have an unsprayed margin so need to pass the information on to it
457  LE* um=g_landscape_p->SupplyLEPointer(pref);
458  um->SetLastTreatment( spring_plough );
459  um->InsectMortality( 0.1);
460  um->ZeroVeg();
461  }
462  return true;
463  }
464  return false;
465 }

References DO_IT_PROB, g_landscape_p, spring_plough, and Landscape::SupplyLEPointer().

Referenced by NorwegianOats::Do(), NorwegianSpringBarley::Do(), BroadBeans::Do(), OSBarleySilage::Do(), OFieldPeas::Do(), OFieldPeasSilage::Do(), OCarrots::Do(), OBarleyPeaCloverGrass::Do(), OMaizeSilage::Do(), OOats::Do(), MaizeStrigling::Do(), OSpringBarleyPigs::Do(), MaizeSilage::Do(), Maize::Do(), Oats::Do(), NLMaizeSpring::Do(), OSpringBarleyExt::Do(), SpringBarleySeed::Do(), OSpringBarley::Do(), FieldPeasSilage::Do(), SpringBarleyCloverGrassStrigling::Do(), FieldPeasStrigling::Do(), OPotatoes::Do(), FieldPeas::Do(), SpringBarleyCloverGrass::Do(), OFodderbeet::Do(), Carrots::Do(), NLBeetSpring::Do(), NLCarrotsSpring::Do(), SpringBarleyPeaCloverGrassStrigling::Do(), NLCarrots::Do(), Sugarbeet::Do(), NLSpringBarleySpring::Do(), PotatoesIndustry::Do(), NLCabbageSpring::Do(), Potatoes::Do(), NorwegianPotatoes::Do(), Fodderbeet::Do(), SpringBarleySKManagement::Do(), SpringBarleySpr::Do(), SpringBarleySilage::Do(), SpringBarleyStriglingSingle::Do(), SpringBarleyStriglingCulm::Do(), SpringBarleyPTreatment::Do(), SpringBarleyStrigling::Do(), PLSpringBarleySpr::Do(), SpringBarley::Do(), SpringRape::Do(), PLBeetSpr::Do(), and NLPotatoesSpring::Do().

◆ SpringRoll()

bool Farm::SpringRoll ( LE *  a_field,
double  a_user,
int  a_days 
)
virtual

Carry out a roll event in the spring on a_field.

526 {
527 
528  if ( (0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
529  a_field->Trace( spring_roll );
530  a_field->SetLastTreatment( spring_roll );
531  int pref=a_field->GetUnsprayedMarginPolyRef();
532  if (pref!=-1){
533  // Must have an unsprayed margin so need to pass the information on to it
534  LE* um=g_landscape_p->SupplyLEPointer(pref);
535  um->SetLastTreatment( spring_roll );
536  }
537  return true;
538  }
539  return false;
540 }

References DO_IT_PROB, g_landscape_p, spring_roll, and Landscape::SupplyLEPointer().

Referenced by NorwegianOats::Do(), NorwegianSpringBarley::Do(), BroadBeans::Do(), OSBarleySilage::Do(), OFieldPeas::Do(), OFieldPeasSilage::Do(), OBarleyPeaCloverGrass::Do(), OWinterRye::Do(), OOats::Do(), OSpringBarleyPigs::Do(), OTriticale::Do(), OSpringBarleyExt::Do(), Oats::Do(), OSpringBarley::Do(), SpringBarleySeed::Do(), FieldPeasSilage::Do(), FieldPeasStrigling::Do(), SpringBarleyCloverGrassStrigling::Do(), FieldPeas::Do(), OWinterWheat::Do(), OWinterWheatUndersown::Do(), OWinterWheatUndersownExt::Do(), SpringBarleyCloverGrass::Do(), OFodderbeet::Do(), Triticale::Do(), SpringBarleyPeaCloverGrassStrigling::Do(), Sugarbeet::Do(), Fodderbeet::Do(), SpringBarleySKManagement::Do(), SpringBarleySpr::Do(), WinterRyeStrigling::Do(), SpringBarleySilage::Do(), WinterRye::Do(), SpringBarleyPTreatment::Do(), SpringBarleyStriglingSingle::Do(), SpringBarleyStrigling::Do(), SpringBarleyStriglingCulm::Do(), SpringBarley::Do(), WWheatPControl::Do(), WWheatPToxicControl::Do(), WWheatPTreatment::Do(), WinterWheatStrigling::Do(), WinterWheatStriglingSingle::Do(), WinterWheatStriglingCulm::Do(), AgroChemIndustryCereal::Do(), and WinterWheat::Do().

◆ SpringSow()

bool Farm::SpringSow ( LE *  a_field,
double  a_user,
int  a_days 
)
virtual

Carry out a sowing event in the spring on a_field.

547 {
548 
549  if ( (0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
550  a_field->Trace( spring_sow );
551  a_field->SetLastTreatment( spring_sow );
552  a_field->SetGrowthPhase( sow );
553  a_field->SetLastSownVeg(a_field->GetVegType());
554  // Reduce the vegetation to zero - should not strictly be necessary, but prevents any false starts in the crop growth.
555  a_field->ZeroVeg();
556  int pref=a_field->GetUnsprayedMarginPolyRef();
557  if (pref!=-1){
558  // Must have an unsprayed margin so need to pass the information on to it
559  LE* um=g_landscape_p->SupplyLEPointer(pref);
560  um->SetLastTreatment( spring_sow );
561  um->SetGrowthPhase( sow );
562  um->ZeroVeg();
563  um->SetLastSownVeg(um->GetVegType());
564  }
565  return true;
566  }
567  return false;
568 }

References DO_IT_PROB, g_landscape_p, spring_sow, and Landscape::SupplyLEPointer().

Referenced by NorwegianOats::Do(), NorwegianSpringBarley::Do(), BroadBeans::Do(), OSBarleySilage::Do(), OFieldPeas::Do(), OFieldPeasSilage::Do(), OCarrots::Do(), OMaizeSilage::Do(), OBarleyPeaCloverGrass::Do(), OWinterBarleyExt::Do(), OWinterBarley::Do(), OWinterRye::Do(), OOats::Do(), MaizeStrigling::Do(), MaizeSilage::Do(), OSpringBarleyPigs::Do(), Maize::Do(), OSpringBarleyExt::Do(), Oats::Do(), SpringBarleySeed::Do(), OSpringBarley::Do(), SpringBarleyCloverGrassStrigling::Do(), FieldPeasSilage::Do(), FieldPeasStrigling::Do(), OPotatoes::Do(), FieldPeas::Do(), SpringBarleyCloverGrass::Do(), OFodderbeet::Do(), Carrots::Do(), SpringBarleyPeaCloverGrassStrigling::Do(), Sugarbeet::Do(), PotatoesIndustry::Do(), NorwegianPotatoes::Do(), Fodderbeet::Do(), Potatoes::Do(), SpringBarleySKManagement::Do(), SpringBarleySpr::Do(), SpringBarleySilage::Do(), SpringBarleyStriglingSingle::Do(), SpringBarleyStrigling::Do(), SpringBarleyPTreatment::Do(), SpringBarleyStriglingCulm::Do(), SpringBarley::Do(), and SpringRape::Do().

◆ SpringSowWithFerti()

bool Farm::SpringSowWithFerti ( LE *  a_field,
double  a_user,
int  a_days 
)
virtual

Carry out a sowing event with start fertilizer in the spring on a_field.

575 {
576 
577  if ((0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
578  a_field->Trace(spring_sow_with_ferti);
579  a_field->SetLastTreatment(spring_sow_with_ferti);
580  a_field->SetGrowthPhase(sow);
581  a_field->SetLastSownVeg(a_field->GetVegType());
582  // Reduce the vegetation to zero - should not strictly be necessary, but prevents any false starts in the crop growth.
583  a_field->ZeroVeg();
584  int pref = a_field->GetUnsprayedMarginPolyRef();
585  if (pref != -1) {
586  // Must have an unsprayed margin so need to pass the information on to it
587  LE* um = g_landscape_p->SupplyLEPointer(pref);
588  um->SetLastTreatment(spring_sow_with_ferti);
589  um->SetGrowthPhase(sow);
590  um->ZeroVeg();
591  um->SetLastSownVeg(um->GetVegType());
592  }
593  return true;
594  }
595  return false;
596 }

References DO_IT_PROB, g_landscape_p, spring_sow_with_ferti, and Landscape::SupplyLEPointer().

◆ StrawChopping()

bool Farm::StrawChopping ( LE *  a_field,
double  a_user,
int  a_days 
)
virtual

Carry out straw chopping on a_field.

2133 {
2134 
2135  if ( (0 >= a_days) ||
2136  ((g_weather->GetRainPeriod(g_date->Date(),5)<0.1) && DoIt(DO_IT_PROB))
2137  ) {
2138  a_field->Trace( straw_chopping );
2139  a_field->SetLastTreatment( straw_chopping );
2140  a_field->InsectMortality( 0.4 );
2141  a_field->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
2142  int pref=a_field->GetUnsprayedMarginPolyRef();
2143  if (pref!=-1){
2144  // Must have an unsprayed margin so need to pass the information on to it
2145  LE* um=g_landscape_p->SupplyLEPointer(pref);
2146  um->SetLastTreatment( straw_chopping );
2147  um->InsectMortality( 0.4 );
2148  um->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
2149  }
2150  return true;
2151  }
2152  return false;
2153 }

References DO_IT_PROB, g_landscape_p, straw_chopping, and Landscape::SupplyLEPointer().

Referenced by OSeedGrass1::Do(), WinterRapeStrigling::Do(), OSeedGrass2::Do(), OFieldPeas::Do(), SeedGrass1::Do(), OWinterBarleyExt::Do(), SeedGrass2::Do(), OWinterBarley::Do(), OWinterRye::Do(), OOats::Do(), OSpringBarleyPigs::Do(), OTriticale::Do(), OSpringBarleyExt::Do(), Oats::Do(), OSpringBarley::Do(), FieldPeas::Do(), FieldPeasStrigling::Do(), FieldPeasSilage::Do(), OWinterWheat::Do(), OWinterWheatUndersown::Do(), OWinterWheatUndersownExt::Do(), OWinterRape::Do(), Triticale::Do(), SpringBarleySKManagement::Do(), WinterRyeStrigling::Do(), SpringBarleySpr::Do(), SpringBarleyStrigling::Do(), SpringBarleyStriglingSingle::Do(), WinterRye::Do(), SpringBarleyPTreatment::Do(), SpringBarleyStriglingCulm::Do(), SpringBarley::Do(), SpringRape::Do(), WWheatPControl::Do(), WinterWheatStriglingCulm::Do(), WWheatPToxicControl::Do(), WWheatPTreatment::Do(), WinterWheatStriglingSingle::Do(), WinterWheatStrigling::Do(), WinterRape::Do(), WinterBarleyStrigling::Do(), AgroChemIndustryCereal::Do(), WinterBarley::Do(), and WinterWheat::Do().

◆ StrawCovering()

bool Farm::StrawCovering ( LE *  a_field,
double  a_user,
int  a_days 
)
virtual

Straw covering applied on a_field.

2503 {
2504  if ((0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
2505  a_field->Trace(straw_covering);
2506  a_field->SetLastTreatment(straw_covering);
2507  a_field->SetTramlinesDecay(EL_TRAMLINE_DECAYTIME);
2508  int pref = a_field->GetUnsprayedMarginPolyRef();
2509  if (pref != -1) {
2510  // Must have an unsprayed margin so need to pass the information on to it
2511  LE* um = g_landscape_p->SupplyLEPointer(pref);
2512  um->SetLastTreatment(straw_covering);
2513  um->SetTramlinesDecay(EL_TRAMLINE_DECAYTIME);
2514  }
2515  return true;
2516  }
2517  return false;
2518 }

References DO_IT_PROB, g_landscape_p, straw_covering, and Landscape::SupplyLEPointer().

◆ StrawRemoval()

bool Farm::StrawRemoval ( LE *  a_field,
double  a_user,
int  a_days 
)
virtual

Straw covering applied on a_field.

2525 {
2526  if ((0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
2527  a_field->Trace(straw_removal);
2528  a_field->SetLastTreatment(straw_removal);
2529  a_field->SetTramlinesDecay(EL_TRAMLINE_DECAYTIME);
2530  int pref = a_field->GetUnsprayedMarginPolyRef();
2531  if (pref != -1) {
2532  // Must have an unsprayed margin so need to pass the information on to it
2533  LE* um = g_landscape_p->SupplyLEPointer(pref);
2534  um->SetLastTreatment(straw_removal);
2535  um->SetTramlinesDecay(EL_TRAMLINE_DECAYTIME);
2536  }
2537  return true;
2538  }
2539  return false;
2540 }

References DO_IT_PROB, g_landscape_p, straw_removal, and Landscape::SupplyLEPointer().

◆ Strigling()

bool Farm::Strigling ( LE *  a_field,
double  a_user,
int  a_days 
)
virtual

Carry out a mechanical weeding on a_field.

1546 {
1547 
1548  // Force strigling if it has not been done already!!! This happens regardless of weather as of 26/10/2005
1549  if ( (0 >= a_days) )// && (g_weather->GetRainPeriod(g_date->Date(),3)>0.1) )
1550  {
1551  a_field->Trace( strigling );
1552  a_field->SetLastTreatment( strigling );
1553  a_field->ReduceWeedBiomass( 0.05 );
1554  a_field->InsectMortality( 0.7 );
1555  a_field->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
1556  a_field->SetHerbicideDelay( EL_STRIGLING_DELAYTIME );
1557  int pref=a_field->GetUnsprayedMarginPolyRef();
1558  if (pref!=-1){
1559  // Must have an unsprayed margin so need to pass the information on to it
1560  LE* um=g_landscape_p->SupplyLEPointer(pref);
1561  um->SetLastTreatment( strigling );
1562  um->ReduceWeedBiomass( 0.05 );
1563  um->InsectMortality( 0.7 );
1564  um->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
1565  um->SetHerbicideDelay( EL_STRIGLING_DELAYTIME );
1566  return true;
1567  }
1568  }
1569  if ( (0 >= a_days) ||
1570  ((g_weather->GetRainPeriod(g_date->Date(),3)<0.1) && DoIt(DO_IT_PROB))
1571  ) {
1572  a_field->Trace( strigling );
1573  a_field->SetLastTreatment( strigling );
1574  a_field->ReduceWeedBiomass( 0.05 );
1575  a_field->InsectMortality( 0.7 );
1576  a_field->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
1577  a_field->SetHerbicideDelay( EL_STRIGLING_DELAYTIME );
1578  int pref=a_field->GetUnsprayedMarginPolyRef();
1579  if (pref!=-1){
1580  // Must have an unsprayed margin so need to pass the information on to it
1581  LE* um=g_landscape_p->SupplyLEPointer(pref);
1582  um->SetLastTreatment( strigling );
1583  um->ReduceWeedBiomass( 0.05 );
1584  um->InsectMortality( 0.7 );
1585  um->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
1586  um->SetHerbicideDelay( EL_STRIGLING_DELAYTIME );
1587  }
1588  return true;
1589  }
1590  return false;
1591 }

References DO_IT_PROB, g_landscape_p, strigling, and Landscape::SupplyLEPointer().

Referenced by WinterRapeStrigling::Do(), BroadBeans::Do(), OFieldPeas::Do(), OFieldPeasSilage::Do(), OWinterBarleyExt::Do(), OWinterBarley::Do(), OWinterRye::Do(), OOats::Do(), OSpringBarleyPigs::Do(), OTriticale::Do(), OSpringBarleyExt::Do(), OSpringBarley::Do(), OPotatoes::Do(), SpringBarleyCloverGrassStrigling::Do(), FieldPeasStrigling::Do(), OWinterWheat::Do(), OWinterWheatUndersown::Do(), OWinterWheatUndersownExt::Do(), Triticale::Do(), PotatoesIndustry::Do(), Potatoes::Do(), NorwegianPotatoes::Do(), SpringBarleySilage::Do(), WinterRyeStrigling::Do(), SpringBarleyStriglingSingle::Do(), SpringBarleyStrigling::Do(), SpringBarleyStriglingCulm::Do(), WinterRye::Do(), WWheatPControl::Do(), WinterWheatStrigling::Do(), WinterWheatStriglingCulm::Do(), WWheatPToxicControl::Do(), WinterWheatStriglingSingle::Do(), WWheatPTreatment::Do(), WinterBarleyStrigling::Do(), AgroChemIndustryCereal::Do(), and WinterWheat::Do().

◆ StriglingHill()

bool Farm::StriglingHill ( LE *  a_field,
double  a_user,
int  a_days 
)
virtual

Carry out a mechanical weeding on a_field followed by hilling up (probably on potatoes)

1636 {
1637 
1638  if ((0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
1639  a_field->Trace(strigling_hill);
1640  a_field->SetLastTreatment(strigling_hill);
1641  a_field->InsectMortality(0.75);
1642  a_field->ReduceWeedBiomass(0.25);
1643  a_field->SetTramlinesDecay(EL_TRAMLINE_DECAYTIME);
1644  int pref = a_field->GetUnsprayedMarginPolyRef();
1645  if (pref != -1) {
1646  // Must have an unsprayed margin so need to pass the information on to it
1647  LE* um = g_landscape_p->SupplyLEPointer(pref);
1648  um->SetLastTreatment(strigling_hill);
1649  um->ReduceWeedBiomass(0.25);
1650  um->InsectMortality(0.75);
1651  um->SetTramlinesDecay(EL_TRAMLINE_DECAYTIME);
1652  }
1653  return true;
1654  }
1655  return false;
1656 }

References DO_IT_PROB, g_landscape_p, strigling_hill, and Landscape::SupplyLEPointer().

◆ StriglingSow()

bool Farm::StriglingSow ( LE *  a_field,
double  a_user,
int  a_days 
)
virtual

Carry out a mechanical weeding followed by sowing on a_field.

1598 {
1599 
1600  //2 days good weather afterwards
1601  if ( (0 >= a_days) && (g_weather->GetRainPeriod(g_date->Date(),3)<0.1) )
1602  {
1603  return true;
1604  }
1605 
1606  if ( (0 >= a_days) ||
1607  ((g_weather->GetRainPeriod(g_date->Date(),3)<0.1) && DoIt(DO_IT_PROB))
1608  ) {
1609  a_field->Trace( strigling_sow );
1610  a_field->SetLastTreatment( strigling_sow );
1611  a_field->ReduceWeedBiomass( 0.05 );
1612  a_field->InsectMortality( 0.7 );
1613  a_field->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
1614  a_field->SetHerbicideDelay( EL_STRIGLING_DELAYTIME );
1615  int pref=a_field->GetUnsprayedMarginPolyRef();
1616  if (pref!=-1){
1617  // Must have an unsprayed margin so need to pass the information on to it
1618  LE* um=g_landscape_p->SupplyLEPointer(pref);
1619  um->SetLastTreatment( strigling_sow );
1620  um->ReduceWeedBiomass( 0.05 );
1621  um->InsectMortality( 0.7 );
1622  um->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
1623  um->SetHerbicideDelay( EL_STRIGLING_DELAYTIME );
1624  }
1625  return true;
1626  }
1627  return false;
1628 }

References DO_IT_PROB, g_landscape_p, strigling_sow, and Landscape::SupplyLEPointer().

Referenced by OSpringBarleyPigs::Do(), SpringBarleyCloverGrassStrigling::Do(), OWinterWheat::Do(), OWinterWheatUndersownExt::Do(), OWinterWheatUndersown::Do(), and SpringBarleyPeaCloverGrassStrigling::Do().

◆ StubbleCultivatorHeavy()

bool Farm::StubbleCultivatorHeavy ( LE *  a_field,
double  a_user,
int  a_days 
)
virtual

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)

194 {
195  if ((0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
196  a_field->Trace(stubble_cultivator_heavy);
197  a_field->SetLastTreatment(stubble_cultivator_heavy);
198  a_field->InsectMortality(0.1); // The same global mortality as for normal plough
199  a_field->ZeroVeg(); // Zero veg as with stubble harrowing
200  int pref = a_field->GetUnsprayedMarginPolyRef();
201  if (pref != -1) {
202  // Must have an unsprayed margin so need to pass the information on to it
203  LE* um = g_landscape_p->SupplyLEPointer(pref);
204  um->SetLastTreatment(stubble_cultivator_heavy);
205  um->InsectMortality(0.1);
206  um->ZeroVeg();
207  }
208  return true; // completed
209  }
210  return false; // not completed
211 }

References DO_IT_PROB, g_landscape_p, stubble_cultivator_heavy, and Landscape::SupplyLEPointer().

◆ StubbleHarrowing()

bool Farm::StubbleHarrowing ( LE *  a_field,
double  a_user,
int  a_days 
)
virtual

Carry out stubble harrowing on a_field.

2210 {
2211 
2212  if ( (0 >= a_days) ||
2213  ((g_weather->GetRainPeriod(g_date->Date(),3)<0.1) && DoIt(DO_IT_PROB))
2214  ) {
2215  a_field->Trace( stubble_harrowing );
2216  a_field->SetLastTreatment( stubble_harrowing );
2217  a_field->InsectMortality( 0.25 );
2218  a_field->ZeroVeg();
2219  int pref=a_field->GetUnsprayedMarginPolyRef();
2220  if (pref!=-1){
2221  // Must have an unsprayed margin so need to pass the information on to it
2222  LE* um=g_landscape_p->SupplyLEPointer(pref);
2223  um->SetLastTreatment( stubble_harrowing );
2224  um->ZeroVeg();
2225  um->InsectMortality( 0.25 );
2226  }
2227  return true;
2228  }
2229  return false;
2230 }

References DO_IT_PROB, g_landscape_p, stubble_harrowing, and Landscape::SupplyLEPointer().

Referenced by WinterRapeStrigling::Do(), OSeedGrass2::Do(), OMaizeSilage::Do(), NLCatchPeaCrop::Do(), OWinterBarleyExt::Do(), SeedGrass2::Do(), OWinterBarley::Do(), MaizeStrigling::Do(), Maize::Do(), MaizeSilage::Do(), OTriticale::Do(), OWinterWheat::Do(), OWinterWheatUndersown::Do(), OWinterWheatUndersownExt::Do(), OWinterRape::Do(), Triticale::Do(), NLMaize::Do(), NLBeet::Do(), SpringBarleySKManagement::Do(), WinterRyeStrigling::Do(), SpringBarleySpr::Do(), SpringBarleyStrigling::Do(), SpringBarleyStriglingCulm::Do(), NLWinterWheat::Do(), SpringBarleyPTreatment::Do(), SpringBarleyStriglingSingle::Do(), WinterRye::Do(), NLSpringBarley::Do(), SpringBarley::Do(), SpringRape::Do(), WWheatPControl::Do(), WWheatPTreatment::Do(), WinterWheatStrigling::Do(), WinterWheatStriglingSingle::Do(), WinterWheatStriglingCulm::Do(), WWheatPToxicControl::Do(), WinterBarleyStrigling::Do(), WinterRape::Do(), AgroChemIndustryCereal::Do(), WinterBarley::Do(), NLPotatoes::Do(), and WinterWheat::Do().

◆ StubblePlough()

bool Farm::StubblePlough ( LE *  a_field,
double  a_user,
int  a_days 
)
virtual

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)

170 {
171  if ((0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
172  a_field->Trace(stubble_plough);
173  a_field->SetLastTreatment(stubble_plough);
174  a_field->InsectMortality(0.1); // The same global mortality as for normal plough
175  a_field->ZeroVeg();
176  int pref = a_field->GetUnsprayedMarginPolyRef();
177  if (pref != -1) {
178  // Must have an unsprayed margin so need to pass the information on to it
179  LE* um = g_landscape_p->SupplyLEPointer(pref);
180  um->SetLastTreatment(stubble_plough);
181  um->InsectMortality(0.1);
182  um->ZeroVeg();
183  }
184  return true; // completed
185  }
186  return false; // not completed
187 }

References DO_IT_PROB, g_landscape_p, stubble_plough, and Landscape::SupplyLEPointer().

Referenced by PLCarrots::Do().

◆ Swathing()

bool Farm::Swathing ( LE *  a_field,
double  a_user,
int  a_days 
)
virtual

Cut the crop on a_field and leave it lying (probably rape)

1745 {
1746 
1747  if ( (0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
1748  a_field->Trace( swathing );
1749  a_field->SetLastTreatment( swathing );
1750  a_field->InsectMortality( 0.5 );
1751  a_field->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
1752  int pref=a_field->GetUnsprayedMarginPolyRef();
1753  if (pref!=-1){
1754  // Must have an unsprayed margin so need to pass the information on to it
1755  LE* um=g_landscape_p->SupplyLEPointer(pref);
1756  um->SetLastTreatment( swathing );
1757  um->InsectMortality( 0.5 );
1758  um->SetTramlinesDecay( EL_TRAMLINE_DECAYTIME );
1759  }
1760  return true;
1761  }
1762  return false;
1763 }

References DO_IT_PROB, g_landscape_p, Landscape::SupplyLEPointer(), and swathing.

Referenced by OSeedGrass1::Do(), WinterRapeStrigling::Do(), OSeedGrass2::Do(), SeedGrass1::Do(), SeedGrass2::Do(), OPotatoes::Do(), OWinterRape::Do(), SpringRape::Do(), and WinterRape::Do().

◆ Water()

bool Farm::Water ( LE *  a_field,
double  a_user,
int  a_days 
)
virtual

Carry out a watering on a_field.

1718 {
1719 
1720 
1721  /* Turn on this code to avoid watering on heavy soils
1722  int soiltype = a_field->GetSoilType();
1723  if ( soiltype < 1 || soiltype > 4 )
1724  return true;
1725 */
1726  if ( (0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
1727  a_field->Trace( water );
1728  a_field->SetLastTreatment( water );
1729  int pref=a_field->GetUnsprayedMarginPolyRef();
1730  if (pref!=-1){
1731  // Must have an unsprayed margin so need to pass the information on to it
1732  LE* um=g_landscape_p->SupplyLEPointer(pref);
1733  um->SetLastTreatment( water );
1734  }
1735  return true;
1736  }
1737  return false;
1738 }

References DO_IT_PROB, g_landscape_p, Landscape::SupplyLEPointer(), and water.

Referenced by OSeedGrass1::Do(), BroadBeans::Do(), OSeedGrass2::Do(), OSBarleySilage::Do(), OFieldPeas::Do(), OFieldPeasSilage::Do(), SeedGrass1::Do(), OCarrots::Do(), OMaizeSilage::Do(), OBarleyPeaCloverGrass::Do(), SeedGrass2::Do(), MaizeSilage::Do(), Maize::Do(), MaizeStrigling::Do(), OTriticale::Do(), SpringBarleySeed::Do(), OPotatoes::Do(), FieldPeas::Do(), FieldPeasSilage::Do(), FieldPeasStrigling::Do(), SpringBarleyCloverGrassStrigling::Do(), OFodderbeet::Do(), SpringBarleyCloverGrass::Do(), Triticale::Do(), Carrots::Do(), SpringBarleyPeaCloverGrassStrigling::Do(), Sugarbeet::Do(), PotatoesIndustry::Do(), NorwegianPotatoes::Do(), Potatoes::Do(), Fodderbeet::Do(), SpringBarleySKManagement::Do(), SpringBarleySilage::Do(), SpringBarleySpr::Do(), WinterRyeStrigling::Do(), SpringBarleyStriglingSingle::Do(), SpringBarleyStriglingCulm::Do(), SpringBarleyStrigling::Do(), WinterRye::Do(), SpringBarleyPTreatment::Do(), SpringBarley::Do(), WWheatPControl::Do(), WinterWheatStrigling::Do(), WWheatPToxicControl::Do(), WinterWheatStriglingSingle::Do(), WinterWheatStriglingCulm::Do(), WWheatPTreatment::Do(), WinterBarleyStrigling::Do(), AgroChemIndustryCereal::Do(), WinterBarley::Do(), and WinterWheat::Do().

◆ WinterPlough()

bool Farm::WinterPlough ( LE *  a_field,
double  a_user,
int  a_days 
)
virtual

Carry out a ploughing event in the winter on a_field.

393 {
394 
395  if ( (0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
396  a_field->Trace( winter_plough );
397  a_field->SetLastTreatment( winter_plough );
398  a_field->InsectMortality( 0.1 );
399  a_field->ZeroVeg();
400  int pref=a_field->GetUnsprayedMarginPolyRef();
401  if (pref!=-1){
402  // Must have an unsprayed margin so need to pass the information on to it
403  LE* um=g_landscape_p->SupplyLEPointer(pref);
404  um->SetLastTreatment( winter_plough );
405  um->InsectMortality( 0.1 );
406  um->ZeroVeg();
407  }
408  return true;
409  }
410  return false;
411 }

References DO_IT_PROB, g_landscape_p, Landscape::SupplyLEPointer(), and winter_plough.

Referenced by NLMaize::Do(), NLCabbage::Do(), and NLGrassGrazed1::Do().

Member Data Documentation

◆ m_agrochemindustrycereal

AgroChemIndustryCereal* Farm::m_agrochemindustrycereal
protected

◆ m_broadbeans

BroadBeans* Farm::m_broadbeans
protected

◆ m_carrots

Carrots* Farm::m_carrots
protected

◆ m_CGG1

CloverGrassGrazed1* Farm::m_CGG1
protected

◆ m_CGG2

CloverGrassGrazed2* Farm::m_CGG2
protected

◆ m_dummycroppesttesting

DummyCropPestTesting* Farm::m_dummycroppesttesting
protected

◆ m_farm_centroidx

int Farm::m_farm_centroidx
protected

Farm's centroid, value x. Equal to the average of the x centroid values of all farm's fields.

Referenced by Centroids(), GetCentroids(), and OptimisingFarm::GetFarmCentroidX().

◆ m_farm_centroidy

int Farm::m_farm_centroidy
protected

Farm's centroid, value y. Equal to the average of the y centroid values of all farm's fields.

Referenced by Centroids(), GetCentroids(), and OptimisingFarm::GetFarmCentroidY().

◆ m_farm_num

int Farm::m_farm_num
protected

Referenced by GetFarmNumber(), and SetFarmNumber().

◆ m_farmtype

TTypesOfFarm Farm::m_farmtype
protected

Referenced by AgroChemIndustryCerealFarm1::AgroChemIndustryCerealFarm1(), AgroChemIndustryCerealFarm2::AgroChemIndustryCerealFarm2(), AgroChemIndustryCerealFarm3::AgroChemIndustryCerealFarm3(), ConventionalCattle::ConventionalCattle(), ConventionalPig::ConventionalPig(), ConventionalPlant::ConventionalPlant(), ConvMarginalJord::ConvMarginalJord(), GetType(), NoPesticideBaseFarm::NoPesticideBaseFarm(), NoPesticideNoPFarm::NoPesticideNoPFarm(), OptimisingFarm::OptimisingFarm(), OrganicCattle::OrganicCattle(), OrganicPig::OrganicPig(), OrganicPlant::OrganicPlant(), PesticideTrialControl::PesticideTrialControl(), PesticideTrialToxicControl::PesticideTrialToxicControl(), PesticideTrialTreatment::PesticideTrialTreatment(), UserDefinedFarm1::UserDefinedFarm1(), UserDefinedFarm10::UserDefinedFarm10(), UserDefinedFarm11::UserDefinedFarm11(), UserDefinedFarm12::UserDefinedFarm12(), UserDefinedFarm13::UserDefinedFarm13(), UserDefinedFarm14::UserDefinedFarm14(), UserDefinedFarm15::UserDefinedFarm15(), UserDefinedFarm16::UserDefinedFarm16(), UserDefinedFarm17::UserDefinedFarm17(), UserDefinedFarm18::UserDefinedFarm18(), UserDefinedFarm19::UserDefinedFarm19(), UserDefinedFarm2::UserDefinedFarm2(), UserDefinedFarm20::UserDefinedFarm20(), UserDefinedFarm21::UserDefinedFarm21(), UserDefinedFarm22::UserDefinedFarm22(), UserDefinedFarm23::UserDefinedFarm23(), UserDefinedFarm24::UserDefinedFarm24(), UserDefinedFarm25::UserDefinedFarm25(), UserDefinedFarm26::UserDefinedFarm26(), UserDefinedFarm27::UserDefinedFarm27(), UserDefinedFarm28::UserDefinedFarm28(), UserDefinedFarm29::UserDefinedFarm29(), UserDefinedFarm3::UserDefinedFarm3(), UserDefinedFarm30::UserDefinedFarm30(), UserDefinedFarm31::UserDefinedFarm31(), UserDefinedFarm32::UserDefinedFarm32(), UserDefinedFarm33::UserDefinedFarm33(), UserDefinedFarm34::UserDefinedFarm34(), UserDefinedFarm35::UserDefinedFarm35(), UserDefinedFarm4::UserDefinedFarm4(), UserDefinedFarm5::UserDefinedFarm5(), UserDefinedFarm6::UserDefinedFarm6(), UserDefinedFarm7::UserDefinedFarm7(), UserDefinedFarm8::UserDefinedFarm8(), and UserDefinedFarm9::UserDefinedFarm9().

◆ m_fieldpeas

FieldPeas* Farm::m_fieldpeas
protected

◆ m_fieldpeassilage

FieldPeasSilage* Farm::m_fieldpeassilage
protected

◆ m_fieldpeasstrigling

FieldPeasStrigling* Farm::m_fieldpeasstrigling
protected

◆ m_fields

◆ m_fodderbeet

Fodderbeet* Farm::m_fodderbeet
protected

◆ m_foddergrass

FodderGrass* Farm::m_foddergrass
protected

◆ m_HuntersList

HunterList Farm::m_HuntersList
protected

A list of hunters allocated to this farm.

Referenced by AddHunter(), and RemoveHunter().

◆ m_intensity

int Farm::m_intensity
protected

Referenced by GetIntensity().

◆ m_maize

Maize* Farm::m_maize
protected

◆ m_maizesilage

MaizeSilage* Farm::m_maizesilage
protected

◆ m_maizestrigling

MaizeStrigling* Farm::m_maizestrigling
protected

◆ m_nlbeet

NLBeet* Farm::m_nlbeet
protected

◆ m_nlbeetspring

NLBeetSpring* Farm::m_nlbeetspring
protected

◆ m_nlcabbage

NLCabbage* Farm::m_nlcabbage
protected

◆ m_nlcabbagespring

NLCabbageSpring* Farm::m_nlcabbagespring
protected

◆ m_nlcarrots

NLCarrots* Farm::m_nlcarrots
protected

◆ m_nlcarrotsspring

NLCarrotsSpring* Farm::m_nlcarrotsspring
protected

◆ m_nlcatchpeacrop

NLCatchPeaCrop* Farm::m_nlcatchpeacrop
protected

◆ m_nlgrassgrazed1

NLGrassGrazed1* Farm::m_nlgrassgrazed1
protected

◆ m_nlgrassgrazed1spring

NLGrassGrazed1Spring* Farm::m_nlgrassgrazed1spring
protected

◆ m_nlgrassgrazed2

NLGrassGrazed2* Farm::m_nlgrassgrazed2
protected

◆ m_nlgrassgrazedlast

NLGrassGrazedLast* Farm::m_nlgrassgrazedlast
protected

◆ m_nlmaize

NLMaize* Farm::m_nlmaize
protected

◆ m_nlmaizespring

NLMaizeSpring* Farm::m_nlmaizespring
protected

◆ m_nlpermanentgrassgrazed

NLPermanentGrassGrazed* Farm::m_nlpermanentgrassgrazed
protected

◆ m_nlpotatoes

NLPotatoes* Farm::m_nlpotatoes
protected

◆ m_nlpotatoesspring

NLPotatoesSpring* Farm::m_nlpotatoesspring
protected

◆ m_nlspringbarley

NLSpringBarley* Farm::m_nlspringbarley
protected

◆ m_nlspringbarleyspring

NLSpringBarleySpring* Farm::m_nlspringbarleyspring
protected

◆ m_nltulips

NLTulips* Farm::m_nltulips
protected

◆ m_nlwinterwheat

NLWinterWheat* Farm::m_nlwinterwheat
protected

◆ m_norwegianoats

NorwegianOats* Farm::m_norwegianoats
protected

◆ m_norwegianpotatoes

NorwegianPotatoes* Farm::m_norwegianpotatoes
protected

◆ m_norwegianspringbarley

NorwegianSpringBarley* Farm::m_norwegianspringbarley
protected

◆ m_oats

Oats* Farm::m_oats
protected

◆ m_OBarleyPCG

OBarleyPeaCloverGrass* Farm::m_OBarleyPCG
protected

◆ m_ocarrots

OCarrots* Farm::m_ocarrots
protected

◆ m_OCGG1

OCloverGrassGrazed1* Farm::m_OCGG1
protected

◆ m_OCGG2

OCloverGrassGrazed2* Farm::m_OCGG2
protected

◆ m_OCGS1

OCloverGrassSilage1* Farm::m_OCGS1
protected

◆ m_ofieldpeas

OFieldPeas* Farm::m_ofieldpeas
protected

◆ m_ofieldpeassilage

OFieldPeasSilage* Farm::m_ofieldpeassilage
protected

◆ m_ofirstyeardanger

OFirstYearDanger* Farm::m_ofirstyeardanger
protected

◆ m_ofodderbeet

OFodderbeet* Farm::m_ofodderbeet
protected

◆ m_ograzingpigs

OGrazingPigs* Farm::m_ograzingpigs
protected

◆ m_omaizesilage

OMaizeSilage* Farm::m_omaizesilage
protected

◆ m_ooats

OOats* Farm::m_ooats
protected

◆ m_opermgrassgrazed

OPermanentGrassGrazed* Farm::m_opermgrassgrazed
protected

◆ m_opotatoes

OPotatoes* Farm::m_opotatoes
protected

◆ m_orchardcrop

OrchardCrop* Farm::m_orchardcrop
protected

◆ m_osbarleysilage

OSBarleySilage* Farm::m_osbarleysilage
protected

◆ m_oseedgrass1

OSeedGrass1* Farm::m_oseedgrass1
protected

◆ m_oseedgrass2

OSeedGrass2* Farm::m_oseedgrass2
protected

◆ m_ospringbarley

OSpringBarley* Farm::m_ospringbarley
protected

◆ m_ospringbarleyext

OSpringBarleyExt* Farm::m_ospringbarleyext
protected

◆ m_ospringbarleypigs

OSpringBarleyPigs* Farm::m_ospringbarleypigs
protected

◆ m_otriticale

OTriticale* Farm::m_otriticale
protected

◆ m_OurManager

◆ m_owinterbarley

OWinterBarley* Farm::m_owinterbarley
protected

◆ m_owinterbarleyext

OWinterBarleyExt* Farm::m_owinterbarleyext
protected

◆ m_owinterrape

OWinterRape* Farm::m_owinterrape
protected

◆ m_owinterrye

OWinterRye* Farm::m_owinterrye
protected

◆ m_owinterwheat

OWinterWheat* Farm::m_owinterwheat
protected

◆ m_owinterwheatundersown

OWinterWheatUndersown* Farm::m_owinterwheatundersown
protected

◆ m_owinterwheatundersownext

OWinterWheatUndersownExt* Farm::m_owinterwheatundersownext
protected

◆ m_permanentsetaside

PermanentSetAside* Farm::m_permanentsetaside
protected

◆ m_PermCrops

◆ m_permgrassgrazed

PermanentGrassGrazed* Farm::m_permgrassgrazed
protected

◆ m_permgrasslowyield

PermanentGrassLowYield* Farm::m_permgrasslowyield
protected

◆ m_permgrasstussocky

PermanentGrassTussocky* Farm::m_permgrasstussocky
protected

◆ m_plbeans

PLBeans* Farm::m_plbeans
protected

◆ m_plbeet

PLBeet* Farm::m_plbeet
protected

◆ m_plbeetspr

PLBeetSpr* Farm::m_plbeetspr
protected

◆ m_plcarrots

PLCarrots* Farm::m_plcarrots
protected

◆ m_plfodderlucerne1

PLFodderLucerne1* Farm::m_plfodderlucerne1
protected

◆ m_plfodderlucerne2

PLFodderLucerne2* Farm::m_plfodderlucerne2
protected

◆ m_plmaize

PLMaize* Farm::m_plmaize
protected

◆ m_plmaizesilage

PLMaizeSilage* Farm::m_plmaizesilage
protected

◆ m_plpotatoes

PLPotatoes* Farm::m_plpotatoes
protected

◆ m_plspringbarley

PLSpringBarley* Farm::m_plspringbarley
protected

◆ m_plspringbarleyspr

PLSpringBarleySpr* Farm::m_plspringbarleyspr
protected

◆ m_plspringwheat

PLSpringWheat* Farm::m_plspringwheat
protected

◆ m_plwinterbarley

PLWinterBarley* Farm::m_plwinterbarley
protected

◆ m_plwinterrape

PLWinterRape* Farm::m_plwinterrape
protected

◆ m_plwinterrye

PLWinterRye* Farm::m_plwinterrye
protected

◆ m_plwintertriticale

PLWinterTriticale* Farm::m_plwintertriticale
protected

◆ m_plwinterwheat

PLWinterWheat* Farm::m_plwinterwheat
protected

◆ m_plwinterwheatlate

PLWinterWheatLate* Farm::m_plwinterwheatlate
protected

◆ m_potatoes

Potatoes* Farm::m_potatoes
protected

◆ m_potatoesindustry

PotatoesIndustry* Farm::m_potatoesindustry
protected

◆ m_queue

LowPriority< FarmEvent* > Farm::m_queue
protected

◆ m_rotation

◆ m_rotation_sync_index

int Farm::m_rotation_sync_index
protected

◆ m_sbarleyclovergrass

SpringBarleyCloverGrass* Farm::m_sbarleyclovergrass
protected

◆ m_seedgrass1

SeedGrass1* Farm::m_seedgrass1
protected

◆ m_seedgrass2

SeedGrass2* Farm::m_seedgrass2
protected

◆ m_setaside

SetAside* Farm::m_setaside
protected

◆ m_springbarley

SpringBarley* Farm::m_springbarley
protected

◆ m_springbarleyclovergrassstrigling

SpringBarleyCloverGrassStrigling* Farm::m_springbarleyclovergrassstrigling
protected

◆ m_springbarleypeaclovergrassstrigling

SpringBarleyPeaCloverGrassStrigling* Farm::m_springbarleypeaclovergrassstrigling
protected

◆ m_springbarleyptreatment

SpringBarleyPTreatment* Farm::m_springbarleyptreatment
protected

◆ m_springbarleyseed

SpringBarleySeed* Farm::m_springbarleyseed
protected

◆ m_springbarleysilage

SpringBarleySilage* Farm::m_springbarleysilage
protected

◆ m_springbarleyskmanagement

SpringBarleySKManagement* Farm::m_springbarleyskmanagement
protected

◆ m_springbarleyspr

SpringBarleySpr* Farm::m_springbarleyspr
protected

◆ m_springbarleystrigling

SpringBarleyStrigling* Farm::m_springbarleystrigling
protected

◆ m_springbarleystriglingculm

SpringBarleyStriglingCulm* Farm::m_springbarleystriglingculm
protected

◆ m_springbarleystriglingsingle

SpringBarleyStriglingSingle* Farm::m_springbarleystriglingsingle
protected

◆ m_springrape

SpringRape* Farm::m_springrape
protected

◆ m_stockfarmer

bool Farm::m_stockfarmer
protected

Referenced by AgroChemIndustryCerealFarm1::AgroChemIndustryCerealFarm1(), AgroChemIndustryCerealFarm2::AgroChemIndustryCerealFarm2(), AgroChemIndustryCerealFarm3::AgroChemIndustryCerealFarm3(), ConventionalCattle::ConventionalCattle(), ConventionalPig::ConventionalPig(), ConventionalPlant::ConventionalPlant(), ConvMarginalJord::ConvMarginalJord(), IsStockFarmer(), OptimisingFarm::Make_rotations(), MakeStockFarmer(), ConventionalPlant::MakeStockFarmer(), OrganicPlant::MakeStockFarmer(), PesticideTrialControl::MakeStockFarmer(), PesticideTrialToxicControl::MakeStockFarmer(), PesticideTrialTreatment::MakeStockFarmer(), NoPesticideBaseFarm::NoPesticideBaseFarm(), NoPesticideNoPFarm::NoPesticideNoPFarm(), OrganicCattle::OrganicCattle(), OrganicPig::OrganicPig(), OrganicPlant::OrganicPlant(), PesticideTrialControl::PesticideTrialControl(), PesticideTrialToxicControl::PesticideTrialToxicControl(), PesticideTrialTreatment::PesticideTrialTreatment(), UserDefinedFarm::UserDefinedFarm(), UserDefinedFarm1::UserDefinedFarm1(), UserDefinedFarm10::UserDefinedFarm10(), UserDefinedFarm11::UserDefinedFarm11(), UserDefinedFarm12::UserDefinedFarm12(), UserDefinedFarm13::UserDefinedFarm13(), UserDefinedFarm14::UserDefinedFarm14(), UserDefinedFarm15::UserDefinedFarm15(), UserDefinedFarm16::UserDefinedFarm16(), UserDefinedFarm17::UserDefinedFarm17(), UserDefinedFarm2::UserDefinedFarm2(), UserDefinedFarm3::UserDefinedFarm3(), UserDefinedFarm4::UserDefinedFarm4(), UserDefinedFarm5::UserDefinedFarm5(), UserDefinedFarm6::UserDefinedFarm6(), UserDefinedFarm7::UserDefinedFarm7(), UserDefinedFarm8::UserDefinedFarm8(), and UserDefinedFarm9::UserDefinedFarm9().

◆ m_sugarbeet

Sugarbeet* Farm::m_sugarbeet
protected

◆ m_triticale

Triticale* Farm::m_triticale
protected

◆ m_winterbarley

WinterBarley* Farm::m_winterbarley
protected

◆ m_winterbarleystrigling

WinterBarleyStrigling* Farm::m_winterbarleystrigling
protected

◆ m_winterrape

WinterRape* Farm::m_winterrape
protected

◆ m_winterrapestrigling

WinterRapeStrigling* Farm::m_winterrapestrigling
protected

◆ m_winterrye

WinterRye* Farm::m_winterrye
protected

◆ m_winterryestrigling

WinterRyeStrigling* Farm::m_winterryestrigling
protected

◆ m_winterwheat

WinterWheat* Farm::m_winterwheat
protected

◆ m_winterwheatstrigling

WinterWheatStrigling* Farm::m_winterwheatstrigling
protected

◆ m_winterwheatstriglingculm

WinterWheatStriglingCulm* Farm::m_winterwheatstriglingculm
protected

◆ m_winterwheatstriglingsingle

WinterWheatStriglingSingle* Farm::m_winterwheatstriglingsingle
protected

◆ m_wwheatpcontrol

WWheatPControl* Farm::m_wwheatpcontrol
protected

◆ m_wwheatptoxiccontrol

WWheatPToxicControl* Farm::m_wwheatptoxiccontrol
protected

◆ m_wwheatptreatment

WWheatPTreatment* Farm::m_wwheatptreatment
protected

◆ m_youngforest

YoungForestCrop* Farm::m_youngforest
protected

The documentation for this class was generated from the following files:
SpringBarleyStrigling::Do
bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: SpringBarleyStrigling.cpp:40
WinterWheatStrigling
Definition: WinterWheatStrigling.h:84
insecticide_treat
Definition: treatment.h:74
Farm::m_springbarley
SpringBarley * m_springbarley
Definition: farm.h:1016
tov_AgroChemIndustryCereal
Definition: tov_declaration.h:55
Farm::m_plwintertriticale
PLWinterTriticale * m_plwintertriticale
Definition: farm.h:1054
PLMaize::Do
virtual bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
The one and only method for a crop management plan. All farm actions go through here.
Definition: PLMaize.cpp:64
tov_SpringBarleyStrigling
Definition: tov_declaration.h:58
tov_PLWinterWheatLate
Definition: tov_declaration.h:85
tov_PLSpringWheat
Definition: tov_declaration.h:75
tov_NLSpringBarley
Definition: tov_declaration.h:93
Farm::m_fieldpeasstrigling
FieldPeasStrigling * m_fieldpeasstrigling
Definition: farm.h:1044
WWheatPToxicControl::Do
virtual bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: WWheatPToxicControl.cpp:39
Farm::m_plfodderlucerne2
PLFodderLucerne2 * m_plfodderlucerne2
Definition: farm.h:1063
Landscape::SupplyLEPointer
LE * SupplyLEPointer(int a_polyref)
Definition: Landscape.h:1099
Farm::m_agrochemindustrycereal
AgroChemIndustryCereal * m_agrochemindustrycereal
Definition: farm.h:1032
tov_NLMaizeSpring
Definition: tov_declaration.h:102
tov_Oats
Definition: tov_declaration.h:40
OrchardCrop
Definition: OrchardCrop.h:47
Fodderbeet
Definition: Fodderbeet.h:72
YoungForestCrop::Do
bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: YoungForest.cpp:32
tov_OWinterBarley
Definition: tov_declaration.h:47
PLFodderLucerne2
PLFodderLucerne2 class .
Definition: PLFodderLucerne2.h:65
strigling
Definition: treatment.h:77
FodderGrass
Definition: FodderGrass.h:54
SpringBarleySeed::Do
bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: SpringBarleySeed.cpp:37
tov_NLPotatoes
Definition: tov_declaration.h:92
OSpringBarleyExt
Definition: OSpringBarleyExt.h:59
OFieldPeas
Definition: OFieldPeas.h:51
hay_bailing
Definition: treatment.h:89
Farm::m_springbarleystrigling
SpringBarleyStrigling * m_springbarleystrigling
Definition: farm.h:1037
flower_cutting
Definition: treatment.h:109
AgroChemIndustryCereal::Do
virtual bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: AgroChemIndustryCereal.cpp:56
Farm::m_carrots
Carrots * m_carrots
Definition: farm.h:966
Farm::m_HuntersList
HunterList m_HuntersList
A list of hunters allocated to this farm.
Definition: farm.h:942
autumn_roll
Definition: treatment.h:38
WinterRapeStrigling::Do
bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: WinterRapeStrigling.cpp:35
spring_sow_with_ferti
Definition: treatment.h:103
WinterBarley::Do
bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: WinterBarley.cpp:37
Farm::m_fieldpeas
FieldPeas * m_fieldpeas
Definition: farm.h:971
OFieldPeasSilage::Do
bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: OFieldPeasSilage.cpp:33
NLPotatoes::Do
virtual bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
The one and only method for a crop management plan. All farm actions go through here.
Definition: NLPotatoes.cpp:64
Farm::m_winterwheat
WinterWheat * m_winterwheat
Definition: farm.h:1028
WinterBarley
Definition: WinterBarley.h:90
Fodderbeet::Do
bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: Fodderbeet.cpp:37
PLWinterWheat::Do
virtual bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
The one and only method for a crop management plan. All farm actions go through here.
Definition: PLWinterWheat.cpp:71
Carrots::Do
bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: Carrots.cpp:36
Farm::m_ooats
OOats * m_ooats
Definition: farm.h:990
tov_OPermanentGrassGrazed
Definition: tov_declaration.h:44
OSpringBarleyPigs
Definition: OSpringBarleyPigs.h:54
NLGrassGrazed1Spring
NLGrassGrazed1Spring class .
Definition: NLGrassGrazed1Spring.h:84
NLGrassGrazed1::Do
virtual bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
The one and only method for a crop management plan. All farm actions go through here.
Definition: NLGrassGrazed1.cpp:54
Farm::LeSwitch
bool LeSwitch(FarmEvent *ev)
Call do function for any crop with an outstanding event. Signal if the crop has terminated.
Definition: farm.cpp:386
Farm::GetFirstCropIndex
virtual int GetFirstCropIndex(TTypesOfLandscapeElement a_type)
Gets the first crop for the farm.
Definition: farm.cpp:1385
Farm::m_springrape
SpringRape * m_springrape
Definition: farm.h:1023
Farm::m_otriticale
OTriticale * m_otriticale
Definition: farm.h:999
Farm::m_plwinterrape
PLWinterRape * m_plwinterrape
Definition: farm.h:1052
SpringBarleySilage
Definition: SpringBarleySilage.h:75
PLPotatoes::Do
virtual bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
The one and only method for a crop management plan. All farm actions go through here.
Definition: PLPotatoes.cpp:64
tov_PLSpringBarleySpr
Definition: tov_declaration.h:84
Farm::m_springbarleyseed
SpringBarleySeed * m_springbarleyseed
Definition: farm.h:1021
FarmEvent
A struct to hold the information required to trigger a farm event.
Definition: farm.h:463
PLFodderLucerne2::Do
virtual bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
The one and only method for a crop management plan. All farm actions go through here.
Definition: PLFodderLucerne2.cpp:56
SetAside
Rotational set-aside management class .
Definition: setaside.h:69
PermanentGrassLowYield::Do
bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: PermanentGrassLowYield.cpp:37
tov_OOats
Definition: tov_declaration.h:44
Farm::m_omaizesilage
OMaizeSilage * m_omaizesilage
Definition: farm.h:978
Farm::m_CGG2
CloverGrassGrazed2 * m_CGG2
Definition: farm.h:970
Maize::Do
bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: Maize.cpp:36
Sugarbeet::Do
bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: Sugarbeet.cpp:37
Farm::m_springbarleyspr
SpringBarleySpr * m_springbarleyspr
Definition: farm.h:1017
Farm::DoIt
bool DoIt(double a_probability)
Return chance out of 0 to 100.
Definition: farm.cpp:800
fa_ammoniumsulphate
Definition: treatment.h:65
autumn_harrow
Definition: treatment.h:37
OWinterRape::Do
bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: OWinterRape.cpp:32
polylist
vector< unsigned > polylist
Definition: farm.h:207
OSeedGrass1
Definition: OSeedGrass1.h:47
preseeding_cultivator
Definition: treatment.h:39
YoungForestCrop
Definition: YoungForest.h:50
Farm::GetFirstDate
int GetFirstDate(TTypesOfVegetation a_tov)
Gets the start date for a crop type.
Definition: farm.cpp:1582
OCarrots
Definition: OCarrots.h:52
CompPcts
bool CompPcts(tpct i, tpct j)
Used for sorting a farmers field size vector.
Definition: farm.cpp:294
OPotatoes::Do
bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: OPotatoes.cpp:33
tov_PLMaizeSilage
Definition: tov_declaration.h:78
Farm::m_fields
vector< LE * > m_fields
Definition: farm.h:937
NLGrassGrazed1
NLGrassGrazed1 class .
Definition: NLGrassGrazed1.h:88
tov_OTriticale
Definition: tov_declaration.h:47
SpringBarleyStriglingSingle
Definition: SpringBarleyStriglingSingle.h:76
tov_MaizeStrigling
Definition: tov_declaration.h:58
Farm::GetNextCropIndex
virtual int GetNextCropIndex(int a_rot_index)
Returns the next crop in the rotation.
Definition: farm.cpp:1427
NLMaizeSpring
NLMaizeSpring class .
Definition: NLMaizeSpring.h:59
PLSpringBarleySpr
PLSpringBarleySpr class .
Definition: PLSpringBarleySpr.h:77
autumn_sow
Definition: treatment.h:41
OBarleyPeaCloverGrass
Definition: OBarleyPeaCloverGrass.h:53
OOats
Definition: OOats.h:57
tov_OWinterWheatUndersown
Definition: tov_declaration.h:49
Sugarbeet
Definition: Sugarbeet.h:71
WinterWheat
WinterWheat class .
Definition: WinterWheat.h:116
PLWinterBarley::Do
virtual bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
The one and only method for a crop management plan. All farm actions go through here.
Definition: PLWinterBarley.cpp:64
NLTulips
NLTulips class .
Definition: NLTulips.h:95
tov_Undefined
Definition: tov_declaration.h:114
Farm::m_ograzingpigs
OGrazingPigs * m_ograzingpigs
Definition: farm.h:987
PLSpringBarley::Do
virtual bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
The one and only method for a crop management plan. All farm actions go through here.
Definition: PLSpringBarley.cpp:64
tpct
Used for storing farmers field size vectors.
Definition: farm.h:454
Farm::m_nlpotatoesspring
NLPotatoesSpring * m_nlpotatoesspring
Definition: farm.h:1086
Farm::m_norwegianpotatoes
NorwegianPotatoes * m_norwegianpotatoes
Definition: farm.h:1047
PLPotatoes
PLPotatoes class .
Definition: PLPotatoes.h:99
FarmManager::GetSpilledMaize
double GetSpilledMaize()
Returns the average amount of spilled maize in KJ/m2 this year.
Definition: farm.cpp:3064
harvest
Definition: treatment.h:82
PLWinterRape
PLWinterRape class .
Definition: PLWinterRape.h:100
tov_FieldPeasStrigling
Definition: tov_declaration.h:56
WWheatPTreatment::Do
virtual bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: WWheatPTreatment.cpp:44
l_farm_insecticide_kills
static CfgBool l_farm_insecticide_kills("FARM_INSECTICIDE_KILLS", CFG_CUSTOM, true)
tov_WinterBarleyStrigling
Definition: tov_declaration.h:59
NLGrassGrazed1Spring::Do
virtual bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
The one and only method for a crop management plan. All farm actions go through here.
Definition: NLGrassGrazed1Spring.cpp:54
tov_NLBeetSpring
Definition: tov_declaration.h:100
Farm::m_plwinterbarley
PLWinterBarley * m_plwinterbarley
Definition: farm.h:1053
OTriticale
Definition: OTriticale.h:58
Farm::m_nlspringbarley
NLSpringBarley * m_nlspringbarley
Definition: farm.h:1074
Farm::m_seedgrass2
SeedGrass2 * m_seedgrass2
Definition: farm.h:1014
PermanentGrassLowYield
Definition: PermanentGrassLowYield.h:50
Farm::m_ofodderbeet
OFodderbeet * m_ofodderbeet
Definition: farm.h:975
Farm::m_owinterwheat
OWinterWheat * m_owinterwheat
Definition: farm.h:1005
tov_PLFodderLucerne1
Definition: tov_declaration.h:81
NLSpringBarley
NLSpringBarley class .
Definition: NLSpringBarley.h:76
tov_WinterWheat
Definition: tov_declaration.h:55
fp_slurry
Definition: treatment.h:52
Farm::m_nlgrassgrazedlast
NLGrassGrazedLast * m_nlgrassgrazedlast
Definition: farm.h:1081
Farm::m_nlmaize
NLMaize * m_nlmaize
Definition: farm.h:1072
PLBeetSpr
PLBeetSpr class .
Definition: PLBeetSpr.h:83
WinterRapeStrigling
Definition: winterrapestrigling.h:47
tov_OCloverGrassSilage1
Definition: tov_declaration.h:43
WinterWheatStrigling::Do
virtual bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: WinterWheatStrigling.cpp:38
tov_PermanentGrassTussocky
Definition: tov_declaration.h:49
Farm::GetNextCropStartDate
int GetNextCropStartDate(LE *a_field, TTypesOfVegetation &a_curr_veg)
Returns the start date of the next crop in the rotation.
Definition: farm.cpp:864
Farm::m_nlgrassgrazed1
NLGrassGrazed1 * m_nlgrassgrazed1
Definition: farm.h:1078
Farm::m_plmaize
PLMaize * m_plmaize
Definition: farm.h:1058
OWinterBarleyExt::Do
bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: OWinterBarleyExt.cpp:33
OFodderbeet
Definition: OFodderbeet.h:64
Farm::m_opotatoes
OPotatoes * m_opotatoes
Definition: farm.h:992
tov_PLWinterTriticale
Definition: tov_declaration.h:73
PermanentGrassTussocky::Do
bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: PermanentGrassTussocky.cpp:37
OWinterWheatUndersown::Do
virtual bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: OWinterWheatUndersown.cpp:33
fp_rsm
Definition: treatment.h:58
fa_sludge
Definition: treatment.h:68
tov_OCloverGrassGrazed2
Definition: tov_declaration.h:43
Farm::m_nlspringbarleyspring
NLSpringBarleySpring * m_nlspringbarleyspring
Definition: farm.h:1087
tov_PLPotatoes
Definition: tov_declaration.h:79
fa_rsm
Definition: treatment.h:69
tov_NLCabbage
Definition: tov_declaration.h:95
FieldPeas
Definition: FieldPeas.h:61
Potatoes
Definition: Potatoes.h:72
NLPotatoesSpring::Do
virtual bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
The one and only method for a crop management plan. All farm actions go through here.
Definition: NLPotatoesSpring.cpp:64
Triticale
Definition: Triticale.h:65
tov_PLBeet
Definition: tov_declaration.h:80
Farm::m_owinterrape
OWinterRape * m_owinterrape
Definition: farm.h:1002
PLMaize
PLMaize class .
Definition: PLMaize.h:94
fp_greenmanure
Definition: treatment.h:56
Farm::m_owinterbarley
OWinterBarley * m_owinterbarley
Definition: farm.h:1000
PLWinterRape::Do
virtual bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
The one and only method for a crop management plan. All farm actions go through here.
Definition: PLWinterRape.cpp:64
OTriticale::Do
bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: OTriticale.cpp:38
OCloverGrassGrazed1::Do
bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: OCloverGrassGrazed1.cpp:37
PLBeans::Do
virtual bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
The one and only method for a crop management plan. All farm actions go through here.
Definition: PLBeans.cpp:64
tov_PermanentSetaside
Definition: tov_declaration.h:49
SpringBarleySpr
Definition: SpringBarleySpr.h:75
straw_removal
Definition: treatment.h:112
WinterWheatStriglingSingle::Do
virtual bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: WinterWheatStriglingSingle.cpp:39
NLCarrotsSpring
NLCarrotsSpring class .
Definition: NLCarrotsSpring.h:68
Farm::m_CGG1
CloverGrassGrazed1 * m_CGG1
Definition: farm.h:969
Farm::m_nlcabbagespring
NLCabbageSpring * m_nlcabbagespring
Definition: farm.h:1088
PermanentGrassTussocky
Definition: PermanentGrassTussocky.h:45
Farm::m_farmtype
TTypesOfFarm m_farmtype
Definition: farm.h:940
hay_turning
Definition: treatment.h:88
tov_Lawn
Definition: tov_declaration.h:63
Maize
Definition: Maize.h:58
Farm::m_springbarleyclovergrassstrigling
SpringBarleyCloverGrassStrigling * m_springbarleyclovergrassstrigling
Definition: farm.h:1036
WinterWheatStriglingSingle
Definition: WinterWheatStriglingSingle.h:84
tov_NLSpringBarleySpring
Definition: tov_declaration.h:104
bulb_harvest
Definition: treatment.h:110
Farm::m_nltulips
NLTulips * m_nltulips
Definition: farm.h:1077
tov_PLWinterRye
Definition: tov_declaration.h:74
SpringBarley::Do
bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: SpringBarley.cpp:48
tov_OSpringBarley
Definition: tov_declaration.h:46
straw_covering
Definition: treatment.h:111
shallow_harrow
Definition: treatment.h:107
Farm::m_nlwinterwheat
NLWinterWheat * m_nlwinterwheat
Definition: farm.h:1075
Farm::m_foddergrass
FodderGrass * m_foddergrass
Definition: farm.h:968
tov_Setaside
Definition: tov_declaration.h:50
WinterRape
Definition: winterrape.h:82
WinterRyeStrigling::Do
bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: WinterRyeStrigling.cpp:38
Farm::m_winterrape
WinterRape * m_winterrape
Definition: farm.h:1026
heavy_cultivator_aggregate
Definition: treatment.h:108
tov_OrchardCrop
Definition: tov_declaration.h:65
AgroChemIndustryCereal
Definition: AgroChemIndustryCereal.h:89
PLMaizeSilage::Do
virtual bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
The one and only method for a crop management plan. All farm actions go through here.
Definition: PLMaizeSilage.cpp:64
water
Definition: treatment.h:80
tov_SpringBarleySeed
Definition: tov_declaration.h:52
tov_SpringBarleySKManagement
Definition: tov_declaration.h:65
NLBeetSpring::Do
virtual bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
The one and only method for a crop management plan. All farm actions go through here.
Definition: NLBeetSpring.cpp:64
fp_liquidNH3
Definition: treatment.h:51
OWinterWheat
Definition: OWinterWheat.h:63
cfg_productapplicendyear
CfgInt cfg_productapplicendyear
tov_WWheatPToxicControl
Definition: tov_declaration.h:55
tov_NLMaize
Definition: tov_declaration.h:91
NLSpringBarleySpring
NLSpringBarleySpring class .
Definition: NLSpringBarleySpring.h:71
molluscicide
Definition: treatment.h:75
tov_OWinterWheat
Definition: tov_declaration.h:66
Farm::m_winterrapestrigling
WinterRapeStrigling * m_winterrapestrigling
Definition: farm.h:1041
Farm::m_maizestrigling
MaizeStrigling * m_maizestrigling
Definition: farm.h:1040
tov_SpringBarleyStriglingCulm
Definition: tov_declaration.h:62
tov_FieldPeasSilage
Definition: tov_declaration.h:65
Farm::m_plcarrots
PLCarrots * m_plcarrots
Definition: farm.h:1064
burn_straw_stubble
Definition: treatment.h:92
Farm::m_owinterwheatundersownext
OWinterWheatUndersownExt * m_owinterwheatundersownext
Definition: farm.h:1006
tov_OCarrots
Definition: tov_declaration.h:43
tole_YoungForest
Definition: tole_declaration.h:55
tov_OWinterWheatUndersownExt
Definition: tov_declaration.h:63
Farm::m_norwegianspringbarley
NorwegianSpringBarley * m_norwegianspringbarley
Definition: farm.h:1049
CloverGrassGrazed1
Definition: CloverGrassGrazed1.h:55
tov_NLGrassGrazedLast
Definition: tov_declaration.h:108
NLPotatoesSpring
NLPotatoesSpring class .
Definition: NLPotatoesSpring.h:89
NLMaize
NLMaize class .
Definition: NLMaize.h:66
Farm::m_oseedgrass2
OSeedGrass2 * m_oseedgrass2
Definition: farm.h:994
DO_IT_PROB
#define DO_IT_PROB
Definition: farmfuncs.cpp:56
Farm::InvIntPartition
int InvIntPartition(vector< tpct > *items, int target)
Finds all possible sums of the integers in the items array.
Definition: farm.cpp:2493
Farm::m_ocarrots
OCarrots * m_ocarrots
Definition: farm.h:980
tov_OBarleyPeaCloverGrass
Definition: tov_declaration.h:41
FarmManager::GetSpilledGrain
double GetSpilledGrain()
Returns the average amount of spilled grain in KJ/m2 this year.
Definition: farm.cpp:3033
Farm::m_winterbarleystrigling
WinterBarleyStrigling * m_winterbarleystrigling
Definition: farm.h:1043
PLBeans
PLBeans class .
Definition: PLBeans.h:84
NLGrassGrazed2
NLGrassGrazed2 class .
Definition: NLGrassGrazed2.h:84
OWinterWheatUndersownExt
Definition: OWinterWheatUndersownExt.h:63
PLWinterBarley
PLWinterBarley class .
Definition: PLWinterBarley.h:98
BroadBeans::Do
bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: BroadBeans.cpp:34
Farm::m_sugarbeet
Sugarbeet * m_sugarbeet
Definition: farm.h:974
Farm::m_winterrye
WinterRye * m_winterrye
Definition: farm.h:1027
OSeedGrass1::Do
bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: OSeedGrass1.cpp:36
Farm::m_permanentsetaside
PermanentSetAside * m_permanentsetaside
Definition: farm.h:1010
cattle_out_low
Definition: treatment.h:100
tov_NorwegianOats
Definition: tov_declaration.h:68
Farm::m_stockfarmer
bool m_stockfarmer
Definition: farm.h:943
NLWinterWheat
NLWinterWheat class .
Definition: NLWinterWheat.h:76
OWinterBarleyExt
Definition: OWinterBarleyExt.h:54
fp_pk
Definition: treatment.h:50
fa_npk
Definition: treatment.h:61
Triticale::Do
bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: Triticale.cpp:37
cattle_out
Definition: treatment.h:83
l_el_o_cut_height
CfgFloat l_el_o_cut_height
Farm::m_oats
Oats * m_oats
Definition: farm.h:989
SpringBarleySeed
Definition: SpringBarleySeed.h:60
tov_YoungForest
Definition: tov_declaration.h:60
OWinterWheat::Do
virtual bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: OWinterWheat.cpp:33
Farm::m_winterwheatstriglingculm
WinterWheatStriglingCulm * m_winterwheatstriglingculm
Definition: farm.h:1034
SpringBarleyPTreatment
Definition: SpringBarleyPTreatment.h:76
tov_OWinterBarleyExt
Definition: tov_declaration.h:65
Farm::m_nlmaizespring
NLMaizeSpring * m_nlmaizespring
Definition: farm.h:1085
tov_NorwegianSpringBarley
Definition: tov_declaration.h:68
tov_SpringBarleySilage
Definition: tov_declaration.h:52
tov_NLGrassGrazed1Spring
Definition: tov_declaration.h:107
WinterBarleyStrigling::Do
bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: WinterBarleyStrigling.cpp:38
fp_npk
Definition: treatment.h:49
PotatoesIndustry::Do
bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: PotatoesIndustry.cpp:37
fa_npks
Definition: treatment.h:60
Farm::m_plbeetspr
PLBeetSpr * m_plbeetspr
Definition: farm.h:1067
Farm::GetFarmNumber
int GetFarmNumber(void)
Definition: farm.h:782
stubble_harrowing
Definition: treatment.h:90
OSpringBarleyPigs::Do
bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: OSpringBarleyPigs.cpp:33
WinterWheatStriglingCulm
Definition: WinterWheatStriglingCulm.h:84
SeedGrass1::Do
bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: seedgrass1.cpp:36
tov_DummyCropPestTesting
Definition: tov_declaration.h:112
TTypesOfVegetation
TTypesOfVegetation
Definition: tov_declaration.h:30
MaizeSilage
Definition: MaizeSilage.h:58
OPermanentGrassGrazed::Do
bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: OPermanentGrassGrazed.cpp:33
Oats::Do
bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: Oats.cpp:35
stubble_plough
Definition: treatment.h:35
tov_SpringRape
Definition: tov_declaration.h:53
autumn_plough
Definition: treatment.h:34
NLGrassGrazedLast
NLGrassGrazedLast class .
Definition: NLGrassGrazedLast.h:85
NLTulips::Do
virtual bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
The one and only method for a crop management plan. All farm actions go through here.
Definition: NLTulips.cpp:64
WinterWheat::Do
virtual bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
The one and only method for a crop management plan. All farm actions go through here.
Definition: WinterWheat.cpp:101
CloverGrassGrazed1::Do
bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: CloverGrassGrazed1.cpp:42
tov_PotatoesIndustry
Definition: tov_declaration.h:50
fp_manure
Definition: treatment.h:55
tov_SpringBarleyPTreatment
Definition: tov_declaration.h:63
SpringBarleyStriglingCulm
Definition: SpringBarleyStriglingCulm.h:76
strigling_sow
Definition: treatment.h:95
tov_FodderGrass
Definition: tov_declaration.h:62
PLWinterWheatLate::Do
virtual bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
The one and only method for a crop management plan. All farm actions go through here.
Definition: PLWinterWheatLate.cpp:64
WinterWheatStriglingCulm::Do
virtual bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: WinterWheatStriglingCulm.cpp:39
Farm::m_springbarleystriglingculm
SpringBarleyStriglingCulm * m_springbarleystriglingculm
Definition: farm.h:1038
Crop::GetFirstDate
int GetFirstDate(void)
Definition: farm.h:562
NLCabbage
NLCabbage class .
Definition: NLCabbage.h:74
NLBeet
NLBeet class .
Definition: NLBeet.h:69
tov_PLBeetSpr
Definition: tov_declaration.h:86
Farm::m_nlcarrots
NLCarrots * m_nlcarrots
Definition: farm.h:1071
tov_PlantNursery
Definition: tov_declaration.h:66
tov_NLCatchPeaCrop
Definition: tov_declaration.h:106
tov_Carrots
Definition: tov_declaration.h:31
NLPotatoes
NLPotatoes class .
Definition: NLPotatoes.h:93
SpringBarleySilage::Do
bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: SpringBarleySilage.cpp:47
tov_NLCarrotsSpring
Definition: tov_declaration.h:101
tole_PermPasture
Definition: tole_declaration.h:47
Farm::AddNewEvent
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.
Definition: farm.cpp:789
vector
WinterRape::Do
bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: winterrape.cpp:49
fungicide
Definition: Landscape.h:63
NLCarrotsSpring::Do
virtual bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
The one and only method for a crop management plan. All farm actions go through here.
Definition: NLCarrotsSpring.cpp:64
OFodderbeet::Do
bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: OFodderbeet.cpp:31
tov_NLPotatoesSpring
Definition: tov_declaration.h:103
SpringBarleySKManagement
Definition: SpringBarleySKManagement.h:74
Farm::m_rotation
vector< TTypesOfVegetation > m_rotation
Definition: farm.h:938
Farm::m_nlpermanentgrassgrazed
NLPermanentGrassGrazed * m_nlpermanentgrassgrazed
Definition: farm.h:1082
Farm::m_farm_centroidx
int m_farm_centroidx
Farm's centroid, value x. Equal to the average of the x centroid values of all farm's fields.
Definition: farm.h:959
PermanentGrassGrazed
Definition: PermanentGrassGrazed.h:53
tov_SpringBarleyCloverGrass
Definition: tov_declaration.h:52
NorwegianPotatoes
Definition: NorwegianPotatoes.h:72
Farm::m_oseedgrass1
OSeedGrass1 * m_oseedgrass1
Definition: farm.h:993
WinterBarleyStrigling
Definition: WinterBarleyStrigling.h:87
winter_plough
Definition: treatment.h:42
NLBeetSpring
NLBeetSpring class .
Definition: NLBeetSpring.h:66
SpringBarleySKManagement::Do
bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: SpringBarleySKManagement.cpp:37
Farm::m_nlgrassgrazed1spring
NLGrassGrazed1Spring * m_nlgrassgrazed1spring
Definition: farm.h:1079
tov_WinterRape
Definition: tov_declaration.h:53
NLPermanentGrassGrazed::Do
virtual bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
The one and only method for a crop management plan. All farm actions go through here.
Definition: NLPermanentGrassGrazed.cpp:54
tov_OGrazingPigs
Definition: tov_declaration.h:44
tov_SugarBeet
Definition: tov_declaration.h:66
SpringRape
Definition: SpringRape.h:77
DummyCropPestTesting
Definition: DummyCropPestTesting.h:61
tov_NLBeet
Definition: tov_declaration.h:89
NLCabbage::Do
virtual bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
The one and only method for a crop management plan. All farm actions go through here.
Definition: NLCabbage.cpp:64
MaizeStrigling
Definition: MaizeStrigling.h:58
tov_NorwegianPotatoes
Definition: tov_declaration.h:68
Farm::m_nlcarrotsspring
NLCarrotsSpring * m_nlcarrotsspring
Definition: farm.h:1084
OGrazingPigs::Do
bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: OGrazingPigs.cpp:31
tole_PermanentSetaside
Definition: tole_declaration.h:46
tov_OSBarleySilage
Definition: tov_declaration.h:56
WinterRye::Do
bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: WinterRye.cpp:37
SeedGrass2
Definition: seedgrass2.h:55
tov_SpringBarleyPeaCloverGrassStrigling
Definition: tov_declaration.h:60
tov_PermanentGrassGrazed
Definition: tov_declaration.h:49
l_el_o_cut_green
CfgFloat l_el_o_cut_green
NLCabbageSpring
NLCabbageSpring class .
Definition: NLCabbageSpring.h:71
OPotatoes
Definition: OPotatoes.h:61
tov_CloverGrassGrazed2
Definition: tov_declaration.h:33
Farm::m_plwinterwheat
PLWinterWheat * m_plwinterwheat
Definition: farm.h:1051
testpesticide
Definition: Landscape.h:63
tov_WWheatPControl
Definition: tov_declaration.h:55
tov_PLWinterRape
Definition: tov_declaration.h:71
SeedGrass2::Do
bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: seedgrass2.cpp:37
OSpringBarley::Do
bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: OSpringBarley.cpp:33
l_el_o_cut_total
CfgFloat l_el_o_cut_total
tov_PLBeans
Definition: tov_declaration.h:87
NorwegianSpringBarley
Definition: NorwegianSpringBarley.h:47
tov_SpringBarleyCloverGrassStrigling
Definition: tov_declaration.h:58
Farm::m_plspringbarley
PLSpringBarley * m_plspringbarley
Definition: farm.h:1057
Farm::m_springbarleyskmanagement
SpringBarleySKManagement * m_springbarleyskmanagement
Definition: farm.h:1018
fp_sludge
Definition: treatment.h:57
SpringBarleyStriglingCulm::Do
bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: SpringBarleyStriglingCulm.cpp:40
CloverGrassGrazed2
Definition: CloverGrassGrazed2.h:53
straw_chopping
Definition: treatment.h:87
FieldPeasSilage
Definition: FieldPeasSilage.h:61
tov_Potatoes
Definition: tov_declaration.h:50
Farm::m_winterwheatstriglingsingle
WinterWheatStriglingSingle * m_winterwheatstriglingsingle
Definition: farm.h:1035
fungicide_treat
Definition: treatment.h:73
deep_ploughing
Definition: treatment.h:43
tov_WinterRyeStrigling
Definition: tov_declaration.h:59
Oats
Definition: Oats.h:59
preseeding_cultivator_sow
Definition: treatment.h:40
tov_PLWinterBarley
Definition: tov_declaration.h:72
PLWinterRye::Do
virtual bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
The one and only method for a crop management plan. All farm actions go through here.
Definition: PLWinterRye.cpp:64
herbicide
Definition: Landscape.h:63
cfg_CustomInsecticideKillProp
static CfgFloat cfg_CustomInsecticideKillProp("CUSTOMINSECTIVIDEKILLPROP", CFG_CUSTOM, 0.5, 0, 1.0)
Farm::m_owinterrye
OWinterRye * m_owinterrye
Definition: farm.h:1003
Farm::m_fodderbeet
Fodderbeet * m_fodderbeet
Definition: farm.h:973
OSpringBarleyExt::Do
bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: OSpringBarleyExt.cpp:33
FarmEvent::m_event
TTypesOfVegetation m_event
Definition: farm.h:470
tov_WinterWheatStriglingCulm
Definition: tov_declaration.h:62
mow
Definition: treatment.h:93
fa_pk
Definition: treatment.h:62
cfg_productapplicstartyear
CfgInt cfg_productapplicstartyear
Carrots
Definition: Carrots.h:66
NorwegianSpringBarley::Do
bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: NorwegianSpringBarley.cpp:33
OCarrots::Do
bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: OCarrots.cpp:32
Farm::m_farm_centroidy
int m_farm_centroidy
Farm's centroid, value y. Equal to the average of the y centroid values of all farm's fields.
Definition: farm.h:961
Farm::m_fieldpeassilage
FieldPeasSilage * m_fieldpeassilage
Definition: farm.h:972
Farm::GetArea
int GetArea(void)
Returns the area of arable fields owned by that farm.
Definition: farm.cpp:1331
tov_NLTulips
Definition: tov_declaration.h:96
Farm::m_nlgrassgrazed2
NLGrassGrazed2 * m_nlgrassgrazed2
Definition: farm.h:1080
Farm::m_ofieldpeas
OFieldPeas * m_ofieldpeas
Definition: farm.h:984
tov_WinterRapeStrigling
Definition: tov_declaration.h:59
spring_harrow
Definition: treatment.h:45
tpct::pct
int pct
Definition: farm.h:456
OBarleyPeaCloverGrass::Do
bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: OBarleyPeaCloverGrass.cpp:33
WinterRye
Definition: WinterRye.h:76
Landscape::CheckForPesticideRecord
void CheckForPesticideRecord(LE *a_field, TTypesOfPesticideCategory a_pcide)
Check if needed and record pesticide application.
Definition: Landscape.cpp:669
PLSpringWheat::Do
virtual bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
The one and only method for a crop management plan. All farm actions go through here.
Definition: PLSpringWheat.cpp:64
Landscape::SupplyYearNumber
int SupplyYearNumber(void)
Definition: Landscape.h:1616
FarmEvent::m_field
LE * m_field
Definition: farm.h:472
Farm::m_maize
Maize * m_maize
Definition: farm.h:976
PLFodderLucerne1::Do
virtual bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
The one and only method for a crop management plan. All farm actions go through here.
Definition: PLFodderLucerne1.cpp:56
Farm::m_OBarleyPCG
OBarleyPeaCloverGrass * m_OBarleyPCG
Definition: farm.h:979
NLMaizeSpring::Do
virtual bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
The one and only method for a crop management plan. All farm actions go through here.
Definition: NLMaizeSpring.cpp:64
tov_OMaizeSilage
Definition: tov_declaration.h:65
tole_Orchard
Definition: tole_declaration.h:71
Farm::m_plspringbarleyspr
PLSpringBarleySpr * m_plspringbarleyspr
Definition: farm.h:1065
Farm::m_ospringbarley
OSpringBarley * m_ospringbarley
Definition: farm.h:995
tov_Maize
Definition: tov_declaration.h:36
Farm::m_permgrasstussocky
PermanentGrassTussocky * m_permgrasstussocky
Definition: farm.h:1009
FieldPeasStrigling::Do
bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: FieldPeasStrigling.cpp:38
tov_OWinterRape
Definition: tov_declaration.h:47
tov_WWheatPTreatment
Definition: tov_declaration.h:55
Farm::m_nlbeetspring
NLBeetSpring * m_nlbeetspring
Definition: farm.h:1083
SpringBarleyCloverGrassStrigling
Definition: SpringBarleyCloverGrassStrigling.h:61
WWheatPControl::Do
virtual bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: WWheatPControl.cpp:37
SpringBarleyPTreatment::Do
bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: SpringBarleyPTreatment.cpp:41
Farm::m_springbarleystriglingsingle
SpringBarleyStriglingSingle * m_springbarleystriglingsingle
Definition: farm.h:1039
SetAside::Do
bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
The one and only method for a crop management plan. All farm actions go through here.
Definition: setaside.cpp:86
PLSpringBarleySpr::Do
virtual bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
The one and only method for a crop management plan. All farm actions go through here.
Definition: PLSpringBarleySpr.cpp:64
FarmEvent::m_todo
int m_todo
Definition: farm.h:469
OWinterRape
Definition: OWinterRape.h:62
tov_FieldPeas
Definition: tov_declaration.h:34
WWheatPToxicControl
Definition: WWheatPToxicControl.h:84
OMaizeSilage::Do
bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: OMaizeSilage.cpp:32
tov_SpringBarleyStriglingSingle
Definition: tov_declaration.h:60
tov_BroadBeans
Definition: tov_declaration.h:66
FarmManager::TranslateCropCodes
TTypesOfVegetation TranslateCropCodes(std::string &str)
Definition: farm.cpp:1818
Farm::m_seedgrass1
SeedGrass1 * m_seedgrass1
Definition: farm.h:1013
Farm::m_springbarleypeaclovergrassstrigling
SpringBarleyPeaCloverGrassStrigling * m_springbarleypeaclovergrassstrigling
Definition: farm.h:1045
hilling_up
Definition: treatment.h:79
OWinterWheatUndersown
Definition: OWinterWheatUndersown.h:63
tov_NLGrassGrazed1
Definition: tov_declaration.h:97
tov_OSeedGrass1
Definition: tov_declaration.h:46
Farm::m_springbarleysilage
SpringBarleySilage * m_springbarleysilage
Definition: farm.h:1022
Farm::m_ofirstyeardanger
OFirstYearDanger * m_ofirstyeardanger
Definition: farm.h:986
NorwegianPotatoes::Do
bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: NorwegianPotatoes.cpp:38
biocide
Definition: treatment.h:104
Farm::m_winterryestrigling
WinterRyeStrigling * m_winterryestrigling
Definition: farm.h:1042
Farm::m_broadbeans
BroadBeans * m_broadbeans
Definition: farm.h:967
tov_OFodderBeet
Definition: tov_declaration.h:65
SpringRape::Do
bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: SpringRape.cpp:45
tov_NLWinterWheat
Definition: tov_declaration.h:94
fa_calcium
Definition: treatment.h:70
tov_PLMaize
Definition: tov_declaration.h:77
tov_OCloverGrassGrazed1
Definition: tov_declaration.h:43
fa_manure
Definition: treatment.h:66
Farm::m_sbarleyclovergrass
SpringBarleyCloverGrass * m_sbarleyclovergrass
Definition: farm.h:1020
NLWinterWheat::Do
virtual bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
The one and only method for a crop management plan. All farm actions go through here.
Definition: NLWinterWheat.cpp:64
tole_PermPastureTussocky
Definition: tole_declaration.h:45
SpringBarleyCloverGrass
Definition: SpringBarleyCloverGrass.h:64
tov_OSpringBarleyPigs
Definition: tov_declaration.h:47
Farm::m_intensity
int m_intensity
Definition: farm.h:946
fp_npks
Definition: treatment.h:48
PLWinterTriticale
PLWinterTriticale class .
Definition: PLWinterTriticale.h:96
row_cultivation
Definition: treatment.h:76
DummyCropPestTesting::Do
bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: DummyCropPestTesting.cpp:38
tov_SpringBarleySpr
Definition: tov_declaration.h:66
trial_insecticidetreat
Definition: treatment.h:96
tov_PLSpringBarley
Definition: tov_declaration.h:76
MaizeStrigling::Do
bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: MaizeStrigling.cpp:37
OCloverGrassSilage1
Definition: OCloverGrassSilage1.h:51
NLMaize::Do
virtual bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
The one and only method for a crop management plan. All farm actions go through here.
Definition: NLMaize.cpp:64
tov_PermanentGrassLowYield
Definition: tov_declaration.h:63
PLCarrots::Do
virtual bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
The one and only method for a crop management plan. All farm actions go through here.
Definition: PLCarrots.cpp:64
tov_WinterWheatStrigling
Definition: tov_declaration.h:59
tole_Field
Definition: tole_declaration.h:43
PotatoesIndustry
Definition: PotatoesIndustry.h:71
Farm::m_youngforest
YoungForestCrop * m_youngforest
Definition: farm.h:1046
tov_WinterWheatStriglingSingle
Definition: tov_declaration.h:62
Farm::m_queue
LowPriority< FarmEvent * > m_queue
Definition: farm.h:936
tole_PermPastureLowYield
Definition: tole_declaration.h:44
PLMaizeSilage
PLMaizeSilage class .
Definition: PLMaizeSilage.h:94
OSBarleySilage
Definition: OSBarleySilage.h:50
SpringBarleyPeaCloverGrassStrigling
Definition: BarleyPeaCloverGrassStrigling.h:69
OWinterBarley
Definition: OWinterBarley.h:55
SeedGrass1
Definition: seedgrass1.h:52
NorwegianOats
Definition: NorwegianOats.h:47
Farm::m_winterbarley
WinterBarley * m_winterbarley
Definition: farm.h:1025
Farm::m_wwheatpcontrol
WWheatPControl * m_wwheatpcontrol
Definition: farm.h:1029
insecticide
Definition: Landscape.h:63
PROG_START
#define PROG_START
Definition: farm.h:76
fp_ammoniumsulphate
Definition: treatment.h:54
PLSpringBarley
PLSpringBarley class .
Definition: PLSpringBarley.h:94
stubble_cultivator_heavy
Definition: treatment.h:36
Farm::m_nlpotatoes
NLPotatoes * m_nlpotatoes
Definition: farm.h:1073
PLBeet
PLBeet class .
Definition: PLBeet.h:98
OCloverGrassSilage1::Do
bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: OCloverGrassSilage1.cpp:39
DO_IT_PROB_LONG
#define DO_IT_PROB_LONG
Definition: farmfuncs.cpp:57
tov_PLCarrots
Definition: tov_declaration.h:83
Farm::m_OurManager
FarmManager * m_OurManager
Pointer to the FarmManager.
Definition: farm.h:935
tov_WinterBarley
Definition: tov_declaration.h:53
spring_plough
Definition: treatment.h:44
NLGrassGrazedLast::Do
virtual bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
The one and only method for a crop management plan. All farm actions go through here.
Definition: NLGrassGrazedLast.cpp:54
OMaizeSilage
Definition: OMaizeSilage.h:53
fa_greenmanure
Definition: treatment.h:67
Farm::m_farm_num
int m_farm_num
Definition: farm.h:944
Farm::HandleEvents
virtual void HandleEvents(void)
If there are events to carry out do this, and perhaps start a new crop.
Definition: farm.cpp:882
OCloverGrassGrazed1
Definition: OCloverGrassGrazed1.h:51
FieldPeasSilage::Do
bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: FieldPeasSilage.cpp:37
Farm::m_wwheatptreatment
WWheatPTreatment * m_wwheatptreatment
Definition: farm.h:1031
OrchardCrop::Do
bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: OrchardCrop.cpp:43
g_landscape_p
Landscape * g_landscape_p
Definition: Landscape.cpp:258
TTypesOfLandscapeElement
TTypesOfLandscapeElement
Definition: tole_declaration.h:36
Farm::m_wwheatptoxiccontrol
WWheatPToxicControl * m_wwheatptoxiccontrol
Definition: farm.h:1030
Farm::m_OCGG2
OCloverGrassGrazed2 * m_OCGG2
Definition: farm.h:982
tov_SeedGrass2
Definition: tov_declaration.h:50
Farm::m_orchardcrop
OrchardCrop * m_orchardcrop
Definition: farm.h:988
Farm::m_ospringbarleypigs
OSpringBarleyPigs * m_ospringbarleypigs
Definition: farm.h:997
l_farm_cattle_veg_reduce2
static CfgFloat l_farm_cattle_veg_reduce2("FARM_CATTLE_VEG_REDUCE_LOW", CFG_CUSTOM, 1.00)
PermanentGrassGrazed::Do
bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: PermanentGrassGrazed.cpp:37
Farm::m_nlcatchpeacrop
NLCatchPeaCrop * m_nlcatchpeacrop
Definition: farm.h:1089
fp_calcium
Definition: treatment.h:59
tov_MaizeSilage
Definition: tov_declaration.h:62
Farm::m_plspringwheat
PLSpringWheat * m_plspringwheat
Definition: farm.h:1056
spring_roll
Definition: treatment.h:46
Farm::m_nlcabbage
NLCabbage * m_nlcabbage
Definition: farm.h:1076
fa_manganesesulphate
Definition: treatment.h:64
PLWinterRye
PLWinterRye class .
Definition: PLWinterRye.h:91
tov_OPotatoes
Definition: tov_declaration.h:44
bed_forming
Definition: treatment.h:106
Farm::m_plmaizesilage
PLMaizeSilage * m_plmaizesilage
Definition: farm.h:1059
cut_weeds
Definition: treatment.h:94
tole_PlantNursery
Definition: tole_declaration.h:95
SpringBarleyStrigling
Definition: SpringBarleyStrigling.h:76
Farm::m_osbarleysilage
OSBarleySilage * m_osbarleysilage
Definition: farm.h:998
OSBarleySilage::Do
bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: OSBarleySilage.cpp:31
NLGrassGrazed2::Do
virtual bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
The one and only method for a crop management plan. All farm actions go through here.
Definition: NLGrassGrazed2.cpp:54
PLFodderLucerne1
PLFodderLucerne1 class .
Definition: PLFodderLucerne1.h:79
fp_manganesesulphate
Definition: treatment.h:53
PermanentSetAside
Definition: PermanentSetAside.h:42
NLCatchPeaCrop
NLCatchPeaCrop class .
Definition: NLCatchPeaCrop.h:54
Farm::m_opermgrassgrazed
OPermanentGrassGrazed * m_opermgrassgrazed
Definition: farm.h:991
tov_OSeedGrass2
Definition: tov_declaration.h:46
NLSpringBarley::Do
virtual bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
The one and only method for a crop management plan. All farm actions go through here.
Definition: NLSpringBarley.cpp:64
Farm::m_ofieldpeassilage
OFieldPeasSilage * m_ofieldpeassilage
Definition: farm.h:985
Farm::m_springbarleyptreatment
SpringBarleyPTreatment * m_springbarleyptreatment
Definition: farm.h:1019
herbicide_treat
Definition: treatment.h:71
OCloverGrassGrazed2::Do
bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: OCloverGrassGrazed2.cpp:38
g_farmmanager
FarmManager * g_farmmanager
Definition: farm.cpp:284
WinterRyeStrigling
Definition: WinterRyeStrigling.h:75
PLSpringWheat
PLSpringWheat class .
Definition: PLSpringWheat.h:98
FarmEvent::m_run
long m_run
Definition: farm.h:468
PLWinterWheatLate
PLWinterWheatLate class .
Definition: PLWinterWheatLate.h:98
Farm::m_plwinterwheatlate
PLWinterWheatLate * m_plwinterwheatlate
Definition: farm.h:1066
tov_NLGrassGrazed2
Definition: tov_declaration.h:98
OWinterBarley::Do
bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: OWinterBarley.cpp:33
WWheatPControl
Definition: WWheatPControl.h:83
tov_OFieldPeasSilage
Definition: tov_declaration.h:56
growth_regulator
Definition: treatment.h:72
Farm::m_permgrassgrazed
PermanentGrassGrazed * m_permgrassgrazed
Definition: farm.h:1007
cut_to_silage
Definition: treatment.h:86
Farm::m_plfodderlucerne1
PLFodderLucerne1 * m_plfodderlucerne1
Definition: farm.h:1062
product_treat
Definition: treatment.h:101
OFirstYearDanger
Definition: OFirstYearDanger.h:38
tov_SpringBarley
Definition: tov_declaration.h:52
tov_OWinterRye
Definition: tov_declaration.h:49
tov_NLCarrots
Definition: tov_declaration.h:90
FieldPeas::Do
bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: FieldPeas.cpp:37
Farm::m_dummycroppesttesting
DummyCropPestTesting * m_dummycroppesttesting
Definition: farm.h:1091
NLPermanentGrassGrazed
NLPermanentGrassGrazed class .
Definition: NLPermanentGrassGrazed.h:83
tov_OFirstYearDanger
Definition: tov_declaration.h:44
Farm::m_norwegianoats
NorwegianOats * m_norwegianoats
Definition: farm.h:1048
tov_CloverGrassGrazed1
Definition: tov_declaration.h:32
Farm::m_winterwheatstrigling
WinterWheatStrigling * m_winterwheatstrigling
Definition: farm.h:1033
SpringBarleySpr::Do
bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: SpringBarleySpr.cpp:42
pigs_out
Definition: treatment.h:84
tov_OFieldPeas
Definition: tov_declaration.h:43
tov_FodderBeet
Definition: tov_declaration.h:35
Farm::m_maizesilage
MaizeSilage * m_maizesilage
Definition: farm.h:977
NLSpringBarleySpring::Do
virtual bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
The one and only method for a crop management plan. All farm actions go through here.
Definition: NLSpringBarleySpring.cpp:64
Farm::m_ospringbarleyext
OSpringBarleyExt * m_ospringbarleyext
Definition: farm.h:996
NLCarrots
NLCarrots class .
Definition: NLCarrots.h:70
NorwegianOats::Do
bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: NorwegianOats.cpp:33
tov_WinterRye
Definition: tov_declaration.h:55
tov_PLFodderLucerne2
Definition: tov_declaration.h:82
tov_Triticale
Definition: tov_declaration.h:53
Farm::m_nlbeet
NLBeet * m_nlbeet
Definition: farm.h:1070
l_farm_pig_veg_reduce
static CfgFloat l_farm_pig_veg_reduce("FARM_PIG_VEG_REDUCE", CFG_CUSTOM, 0.98)
NLCatchPeaCrop::Do
virtual bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
The one and only method for a crop management plan. All farm actions go through here.
Definition: NLCatchPeaCrop.cpp:56
tov_PLWinterWheat
Definition: tov_declaration.h:70
PLBeetSpr::Do
virtual bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
The one and only method for a crop management plan. All farm actions go through here.
Definition: PLBeetSpr.cpp:64
Farm::m_owinterbarleyext
OWinterBarleyExt * m_owinterbarleyext
Definition: farm.h:1001
cut_to_hay
Definition: treatment.h:85
PLWinterWheat
PLWinterWheat class .
Definition: PLWinterWheat.h:98
Farm::m_plbeet
PLBeet * m_plbeet
Definition: farm.h:1061
spring_sow
Definition: treatment.h:47
tpct::index
int index
Definition: farm.h:455
g_rand_uni
boost::variate_generator< base_generator_type &, boost::uniform_real<> > g_rand_uni
OSeedGrass2
Definition: OSeedGrass2.h:49
sleep_all_day
Definition: treatment.h:33
NLCabbageSpring::Do
virtual bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
The one and only method for a crop management plan. All farm actions go through here.
Definition: NLCabbageSpring.cpp:64
OOats::Do
bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: OOats.cpp:33
tov_NLPermanentGrassGrazed
Definition: tov_declaration.h:99
Farm::m_plpotatoes
PLPotatoes * m_plpotatoes
Definition: farm.h:1060
Farm::m_OCGG1
OCloverGrassGrazed1 * m_OCGG1
Definition: farm.h:981
OSpringBarley
Definition: OSpringBarley.h:60
Farm::CheckRotationManagementLoop
void CheckRotationManagementLoop(FarmEvent *ev)
Definition: farm.cpp:839
FodderGrass::Do
bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: FodderGrass.cpp:45
SpringBarleyStriglingSingle::Do
bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: SpringBarleyStriglingSingle.cpp:43
SpringBarley
Definition: SpringBarley.h:78
Farm::m_setaside
SetAside * m_setaside
Definition: farm.h:1015
OWinterRye::Do
bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: OWinterRye.cpp:33
OFieldPeas::Do
bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: OFieldPeas.cpp:33
MaizeSilage::Do
bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: MaizeSilage.cpp:36
FieldPeasStrigling
Definition: FieldPeasStrigling.h:61
OPermanentGrassGrazed
Definition: OPermanentGrassGrazed.h:51
tov_SeedGrass1
Definition: tov_declaration.h:50
Farm::m_triticale
Triticale * m_triticale
Definition: farm.h:1024
Farm::m_owinterwheatundersown
OWinterWheatUndersown * m_owinterwheatundersown
Definition: farm.h:1004
Farm::m_potatoes
Potatoes * m_potatoes
Definition: farm.h:1011
OWinterRye
Definition: OWinterRye.h:56
strigling_hill
Definition: treatment.h:105
WWheatPTreatment
Definition: WWheatPTreatment.h:84
PermanentSetAside::Do
bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: PermanentSetAside.cpp:32
PLBeet::Do
virtual bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
The one and only method for a crop management plan. All farm actions go through here.
Definition: PLBeet.cpp:64
g_farm_fixed_crop_enable
CfgBool g_farm_fixed_crop_enable
Farm::m_potatoesindustry
PotatoesIndustry * m_potatoesindustry
Definition: farm.h:1012
Farm::m_plwinterrye
PLWinterRye * m_plwinterrye
Definition: farm.h:1055
OWinterWheatUndersownExt::Do
virtual bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: OWinterWheatUndersownExt.cpp:33
BroadBeans
Definition: BroadBeans.h:50
PLWinterTriticale::Do
virtual bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
The one and only method for a crop management plan. All farm actions go through here.
Definition: PLWinterTriticale.cpp:64
Farm::m_permgrasslowyield
PermanentGrassLowYield * m_permgrasslowyield
Definition: farm.h:1008
fa_slurry
Definition: treatment.h:63
swathing
Definition: treatment.h:81
g_pest
class Pesticide * g_pest
OGrazingPigs
Definition: OGrazingPigs.h:44
Farm::m_rotation_sync_index
int m_rotation_sync_index
Definition: farm.h:945
CloverGrassGrazed2::Do
bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: CloverGrassGrazed2.cpp:40
NLCarrots::Do
virtual bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
The one and only method for a crop management plan. All farm actions go through here.
Definition: NLCarrots.cpp:64
Farm::m_OCGS1
OCloverGrassSilage1 * m_OCGS1
Definition: farm.h:983
PLCarrots
PLCarrots class .
Definition: PLCarrots.h:75
NLBeet::Do
virtual bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
The one and only method for a crop management plan. All farm actions go through here.
Definition: NLBeet.cpp:64
Farm::m_plbeans
PLBeans * m_plbeans
Definition: farm.h:1068
OCloverGrassGrazed2
Definition: OCloverGrassGrazed2.h:48
tov_OSpringBarleyExt
Definition: tov_declaration.h:63
OFieldPeasSilage
Definition: OFieldPeasSilage.h:51
SpringBarleyCloverGrassStrigling::Do
bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: SpringBarleyCloverGrassStrigling.cpp:38
SpringBarleyPeaCloverGrassStrigling::Do
bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: SpringBarleyPeaCloverGrassStrigling.cpp:38
SpringBarleyCloverGrass::Do
bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: SpringBarleyCloverGrass.cpp:45
Potatoes::Do
bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: Potatoes.cpp:38
l_farm_cattle_veg_reduce
static CfgFloat l_farm_cattle_veg_reduce("FARM_CATTLE_VEG_REDUCE", CFG_CUSTOM, 1.5)
l_farm_herbicide_kills
static CfgBool l_farm_herbicide_kills("FARM_PESTICIDE_KILLS", CFG_CUSTOM, true)
tov_NLCabbageSpring
Definition: tov_declaration.h:105
OSeedGrass2::Do
bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: OSeedGrass2.cpp:32