File failed to load: https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/extensions/ams.js
ALMaSS  1.2 (after EcoStack, March 2024)
The Animal, Landscape and Man Simulation System
All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Farm Class Reference

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

#include <Farm.h>

Inheritance diagram for Farm:
AgroChemIndustryCerealFarm1 AgroChemIndustryCerealFarm2 AgroChemIndustryCerealFarm3 ConventionalCattle ConventionalPig ConventionalPlant ConvMarginalJord NoPesticideBaseFarm NoPesticideNoPFarm OrganicCattle OrganicPig OrganicPlant PesticideTrialControl PesticideTrialToxicControl PesticideTrialTreatment UserDefinedFarm UserDefinedFarm1 UserDefinedFarm10 UserDefinedFarm11 UserDefinedFarm12 UserDefinedFarm13 UserDefinedFarm14 UserDefinedFarm15 UserDefinedFarm16 UserDefinedFarm17 UserDefinedFarm2 UserDefinedFarm3 UserDefinedFarm4 UserDefinedFarm5 UserDefinedFarm6 UserDefinedFarm7 UserDefinedFarm8 UserDefinedFarm9

Public Member Functions

virtual void FarmActions (void)
 FarmActions() will use the global date to manage all queued field events. More...
 
bool FarmerActions (void)
 The starting point for farmer behaviour not part of crop management e.g. decision making. 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)
 
FarmManagerGetFarmManager ()
 
virtual void Harvested (TTypesOfCrops a_toc, double a_yield)
 Records harvest results. More...
 
virtual void Insecticide (int a_area)
 Records the costs of insecticide treatment, and associated score changes. More...
 
virtual void Herbicide (int a_area)
 Records the costs of herbicide treatment, and associated score change. More...
 
TTypesOfFarm GetFarmType ()
 Returns the farm type. More...
 
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...
 
Farmer * GetFarmer ()
 Returns the pointer to this farm's farmer. More...
 
LESetFunctionData (LE *, double, double, int, FarmToDo)
 carries out standard setting of data and deals with possible unsprayed margins, returns a pointer to UM or nullptr More...
 
void SetFunctionDataNoUM (LE *, double, double, int, FarmToDo)
 carries out standard setting of data when UMs should be ignored
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...
 
void CalculateTreatmentCosts (FarmToDo a_treatment, LE *a_field)
 
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, double a_seed_coating_amount=-1, PlantProtectionProducts a_ppp=ppp_foobar)
 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, double a_seed_coating_amount=-1, PlantProtectionProducts a_ppp=ppp_foobar)
 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 WinterHarrow (LE *a_field, double a_user, int a_days)
 Carry out a harrow 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, double a_seed_coating_amount=-1, PlantProtectionProducts a_ppp=ppp_foobar)
 Carry out a sowing event in the spring on a_field. More...
 
virtual bool SpringSowWithFerti (LE *a_field, double a_user, int a_days, double a_seed_coating_amount=-1, PlantProtectionProducts a_ppp=ppp_foobar)
 Carry out a sowing event with start fertilizer in the spring on a_field. More...
 
virtual bool AutumnSowWithFerti (LE *a_field, double a_user, int a_days, double a_seed_coating_amount=-1, PlantProtectionProducts a_ppp=ppp_foobar)
 Carry out a sowing event with start fertilizer in the autumn 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 BiocideTreat (LE *a_field, double a_user, int a_days)
 Apply Biocide to a_field. More...
 
virtual bool OrganicInsecticide (LE *a_field, double a_user, int a_days)
 Biocide applied on a_field. More...
 
virtual bool OrganicHerbicide (LE *a_field, double a_user, int a_days)
 Biocide applied on a_field. More...
 
virtual bool OrganicFungicide (LE *a_field, double a_user, int a_days)
 Biocide applied on a_field. More...
 
virtual bool Pheromone (LE *a_field, double a_user, int a_days)
 Pheromone applied on a_field - same as with org. pesticides for now. More...
 
virtual bool ProductApplication (LE *a_field, double a_user, int a_days, double a_applicationrate, PlantProtectionProducts a_ppp, bool a_isgranularpesticide=false, int a_orcharddrifttype=0)
 Apply test pesticide to a_field. More...
 
virtual bool ProductApplication_DateLimited (LE *a_field, double, int, double a_applicationrate, PlantProtectionProducts a_ppp, bool a_isgranularpesticide=false)
 Special pesticide trial functionality. More...
 
virtual bool Molluscicide (LE *a_field, double a_user, int a_days)
 Apply molluscicide 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, double a_seed_coating_amount=-1, PlantProtectionProducts a_ppp=ppp_foobar)
 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 (only differs in the DoIt chance cf harvest) More...
 
virtual bool HarvestBushFruit (LE *a_field, double a_user, int a_days)
 Harvest bush fruit on a_field - no tramlines since fruits are picked by hand, the bush stays on field with same vegetation height, thus suspects same % insects. More...
 
virtual bool HarvestBF_Machine (LE *a_field, double a_user, int a_days)
 Harvest bush fruit on a_field - tramlines since fruits are picked by machine, the bush stays on field with same vegetation height, thus suspects same % insects. More...
 
virtual bool CattleOut (LE *a_field, double a_user, int a_days)
 Start a grazing event on a_field today. More...
 
virtual bool CattleOut (LE *a_field, double a_user, int a_days, bool a_should_eat)
 Start an intensive 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 CattleIsOut (LE *a_field, double a_user, int a_days, int a_max, bool a_should_eat)
 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 CattleIsOutLow2 (LE *a_field, double a_user, int a_days, int a_max, int a_max_days)
 Generate a 'cattle_out_low2' event for every day the cattle are on a_field, cattle is low grazing and can stay on the field till a_max date but no more days than defined by a_max_days a_days defines the number of days from the day the cattle is put on the field (set by a flag in the management plan) 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 BurnTop (LE *a_field, double a_user, int a_days)
 Burn tops of e.g. potatoes 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_NC (LE *a_field, double a_user, int a_days)
 Apply NC fertilizer, on a_field owned by an arable farmer. More...
 
virtual bool FP_NK (LE *a_field, double a_user, int a_days)
 Apply NK fertilizer, on a_field owned by an arable farmer. More...
 
virtual bool FP_NS (LE *a_field, double a_user, int a_days)
 Apply NS fertilizer, on a_field owned by an arable farmer. More...
 
virtual bool FP_N (LE *a_field, double a_user, int a_days)
 Apply N 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_P (LE *a_field, double a_user, int a_days)
 Apply P fertilizer, on a_field owned by an arable farmer. More...
 
virtual bool FP_K (LE *a_field, double a_user, int a_days)
 Apply K fertilizer, on a_field owned by an arable farmer. More...
 
virtual bool FP_SK (LE *a_field, double a_user, int a_days)
 Apply SK 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_Boron (LE *a_field, double a_user, int a_days)
 Apply soluble Boron 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_NK (LE *a_field, double a_user, int a_days)
 Apply NK fertilizer, on a_field owned by an stock farmer. More...
 
virtual bool FA_NPKS (LE *a_field, double a_user, int a_days)
 Apply NPKS fertilizer, on a_field owned by a stock farmer. More...
 
virtual bool FA_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_P (LE *a_field, double a_user, int a_days)
 Apply P fertilizer, on a_field owned by stock farmer. More...
 
virtual bool FA_K (LE *a_field, double a_user, int a_days)
 Apply K fertilizer, on a_field owned by stock farmer. More...
 
virtual bool FA_SK (LE *a_field, double a_user, int a_days)
 Apply SK fertilizer, on a_field owned by an stock farmer. More...
 
virtual bool FA_Slurry (LE *a_field, double a_user, int a_days)
 Spready slurry on a_field owned by an stock farmer. More...
 
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 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...
 
virtual bool IrrigationStart (LE *a_field, double a_user, int a_days)
 Start a irrigation event on a_field today. More...
 
virtual bool Irrigation (LE *a_field, double a_user, int a_days, int a_max)
 Generate an 'irrigation' event with a frequency defined by a_freq in the irrigation period on a_field. More...
 
virtual bool Pruning (LE *a_field, double a_user, int a_days)
 Pruning applied on a_field - details needs to be added (e.g., impact on biomass, influence/impacts in species code)! More...
 
virtual bool Shredding (LE *a_field, double a_user, int a_days)
 Shredding (destruction of the pruning residues with a shredders using hammer mower) applied on a_field. More...
 
virtual bool LeafThinning (LE *a_field, double a_user, int a_days)
 LeafThinning (leaf removal to increase areation and sun exposure of fruits, e.g., grapes) applied on a_field. More...
 
virtual bool GreenHarvest (LE *a_field, double a_user, int a_days)
 GreenHarvest (remove of excess production that may affect the desired quality of the fruits, e.g., grapes) applied on a_field. More...
 
virtual bool FruitHarvest (LE *a_field, double a_user, int a_days)
 FruitHarvest (harvest of the mature fruits, e.g., grapes) applied on a_field. More...
 
virtual bool Suckering (LE *a_field, double a_user, int a_days)
 
virtual bool Mowing (LE *a_field, double a_user, int a_days)
 Physical/mechanical weed control in the between-row area using a rotary mower cutter. More...
 
virtual bool FiberCovering (LE *a_field, double a_user, int a_days)
 Fiber covering applied on a_field. More...
 
virtual bool FiberRemoval (LE *a_field, double a_user, int a_days)
 Fiber covering removed from a_field. More...
 
virtual bool FP_Cu (LE *a_field, double a_user, int a_days)
 Apply Cu fertilizer, on a_field owned by plant farmer (orchard) More...
 
virtual bool FA_N (LE *a_field, double a_user, int a_days)
 Apply N fertilizer, on a_field owned by a stock farmer. More...
 
virtual bool FA_Cu (LE *a_field, double a_user, int a_days)
 Apply Cu fertilizer, on a_field owned by stock farmer (orchard) More...
 
virtual bool FA_Boron (LE *a_field, double a_user, int a_days)
 Apply soluble Boron to a_field owned by a stock farmer. More...
 
virtual bool FA_PKS (LE *a_field, double a_user, int a_days)
 Apply PKS fertilizer to a_field owned by an stock farmer. More...
 
virtual bool FP_PKS (LE *a_field, double a_user, int a_days)
 Apply PKS fertilizer to a_field owned by an arable farmer. More...
 
virtual bool HarvestShoots (LE *a_field, double a_user, int a_days)
 HarvestShoots applied on a_field (e.g. asparagus) - details needs to be added (e.g., impact on biomass, influence/impacts in species code)! More...
 
virtual bool ManualWeeding (LE *a_field, double a_user, int a_days)
 Manual weeding on a_field - no tramlines since weeding by hand, the bush stays on field with same vegetation height, thus suspects same % insects. 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, FarmManagementCategory a_fmc, bool a_forcespring, bool a_forcespringOK)
 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)
 
string GetRotFilename (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)
 
double GetIntensity (void)
 
void SetIntensity (double a_intensity)
 
APoint GetCentroids ()
 
TTypesOfVegetation GetPreviousTov (int a_index)
 
TTypesOfVegetation GetCrop (int a_index)
 
TTypesOfVegetation GetNextCrop (int a_index)
 
int GetNoCrops ()
 
void AddHunter (Hunter *a_hunter)
 
void RemoveHunter (Hunter *a_hunter)
 
int GetNextCropStartDate (LE *a_field, TTypesOfVegetation &a_curr_veg)
 Returns the start date of the next crop in the rotation. More...
 

Public Attributes

string m_rotfilename
 

Protected Member Functions

int GetFirstDate (TTypesOfVegetation a_tov)
 Gets the start date for a crop type. More...
 
int GetForceSpringOK (TTypesOfVegetation a_tov)
 Gets the start date for a crop type. 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...
 
Farmer * m_OurFarmer
 
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
 
double m_intensity
 indicates the farm intensity - 1 = normal, otherwise linear scale More...
 
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...
 
TTypesOfFarm m_FarmType
 The farms farm type - see TTypesOfFarm enum for types - note the use of UserDefined farms. More...
 

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.

1052 {
1053  m_OurManager = a_manager;
1054  m_rotation_sync_index = -1;
1055  // Defaults that need to be overridden when necessary
1057  m_stockfarmer = false;
1058  m_intensity = 0.0; // Unless changed
1059  m_HuntersList.resize(0); // Set the number of hunters to zero at the start.
1060  m_OurFarmer = new Farmer(0,0,a_manager->GetLandscape(), a_manager->GetFarmerList(), this);
1061 }

References FarmManager::GetFarmerList(), FarmManager::GetLandscape(), and tof_Foobar.

◆ ~Farm()

Farm::~Farm ( void  )
virtual

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

1068  {
1069 
1070  delete m_OurFarmer;
1071 
1073 
1074  while (!m_queue.Empty()) {
1075  pair = m_queue.Bottom();
1076  m_queue.Pop();
1077  delete pair.m_element;
1078  }
1079 }

References LowPriPair< ELEMTYPE >::m_element.

Member Function Documentation

◆ AddField()

void Farm::AddField ( LE a_newfield)

Adds a field to a farm.

1198  {
1199  int i = (int) m_fields.size();
1200 
1201  m_fields.resize( i + 1 );
1202  m_fields[ i ] = a_newfield;
1203  // Must set the rot index to something other than -1, but identify it as not usefully set as yet.
1204  TTypesOfLandscapeElement ele = a_newfield->GetElementType();
1205  switch (ele) {
1207  case tole_YoungForest:
1208  case tole_PermPasture:
1211  case tole_Orchard:
1212  case tole_BushFruit:
1213  case tole_OBushFruit:
1214  case tole_OOrchard:
1215  case tole_PlantNursery:
1216  case tole_OliveGrove:
1217  case tole_WoodyEnergyCrop:
1218  case tole_PermPasturePigs:
1219  case tole_OPermPasturePigs:
1220  case tole_OPermPasture:
1222  case tole_ChristmasTrees:
1223  case tole_OChristmasTrees:
1224  case tole_SolarPanel:
1225  case tole_EnergyCrop:
1226  case tole_OEnergyCrop:
1227  case tole_FarmForest:
1228  case tole_OFarmForest:
1229  case tole_FarmYoungForest:
1230  case tole_OFarmYoungForest:
1231  case tole_AlmondPlantation:
1232  case tole_WalnutPlantation:
1233  case tole_FarmBufferZone:
1234  case tole_NaturalFarmGrass:
1235  case tole_GreenFallow:
1237  case tole_FlowersPerm:
1239  case tole_AsparagusPerm:
1240  case tole_MushroomPerm:
1241  case tole_OtherPermCrop:
1242  case tole_OAsparagusPerm:
1243  m_fields[i]->SetRotIndex(-2);
1244  break;
1245  default:
1246  m_fields[ i ]->SetRotIndex(-1);
1247  }
1248 }

References tole_AlmondPlantation, tole_AsparagusPerm, tole_BushFruit, tole_ChristmasTrees, tole_EnergyCrop, tole_FarmBufferZone, tole_FarmFeedingGround, tole_FarmForest, tole_FarmYoungForest, tole_FlowersPerm, tole_GreenFallow, tole_MushroomPerm, tole_NaturalFarmGrass, tole_OAsparagusPerm, tole_OBushFruit, tole_OChristmasTrees, tole_OEnergyCrop, tole_OFarmForest, tole_OFarmYoungForest, tole_OliveGrove, tole_OOrchard, tole_OPermPasture, tole_OPermPastureLowYield, tole_OPermPasturePigs, tole_Orchard, tole_OtherPermCrop, tole_PermanentSetaside, tole_PermPasture, tole_PermPastureLowYield, tole_PermPasturePigs, tole_PermPastureTussocky, tole_PermPastureTussockyWet, tole_PlantNursery, tole_SolarPanel, tole_WalnutPlantation, tole_WoodyEnergyCrop, and tole_YoungForest.

◆ AddHunter()

void Farm::AddHunter ( Hunter *  a_hunter)
inline
982  {
983  m_HuntersList.push_back(a_hunter);
984  }

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,
FarmManagementCategory  a_fmc,
bool  a_forcespring,
bool  a_forcespringOK 
)

◆ Assign_rotation()

void Farm::Assign_rotation ( vector< TTypesOfVegetation a_new_rotation)
1269  {
1270 
1271  m_rotation.clear();
1272  m_rotation = a_new_rotation;
1273 
1274 }

◆ AssignPermanentCrop()

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

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

3734  {
3735  // Assumes that m_fields has all the fields already in it, and those that are occupied by permanent tole types
3736  // are denoted by -2 or -4 in rotindex, -1 is unassigned - can't use enum because positive values have other meanings
3737 
3738  // Here we can save some time if we have to allocate all the fields to one permanent crop
3739  if (a_pct == 100)
3740  {
3741  for (auto cfi = m_fields.begin(); cfi != m_fields.end(); ++cfi)
3742  {
3743  // Set the field as non-rotating
3744  (*cfi)->SetRotIndex(-4);
3745  // Assign the crop, and weeds are assumed to be undefined
3746  (*cfi)->SetVegType(a_tov, tov_Undefined);
3747  }
3748  return;
3749  }
3750 
3751  tpct a_tpct;
3752  // create a copy of the field vector and call it fields_cpy
3753  vector<LE*> fields_cpy;
3754  fields_cpy.resize(m_fields.size());
3755  copy(m_fields.begin(), m_fields.end(), fields_cpy.begin());
3756  vector<tpct> pcts;
3757  double area = 0.0;
3758 
3759 
3760  // First get the areas of all fields and then convert these to percentages
3761  int sz = (int) fields_cpy.size();
3762  // loop through the fields vector and remove any fields already assigned to permanent crops
3763  for (int i = sz - 1; i >= 0; i--) {
3764  if (fields_cpy[i]->GetRotIndex() < -1) {
3765  fields_cpy.erase(fields_cpy.begin() + i);
3766  }
3767  }
3768  // sum up the area
3769  for (auto cfi = fields_cpy.begin(); cfi != fields_cpy.end(); ++cfi) area += (*cfi)->GetArea();
3770 
3771  // Here we can take action if we only have a single field
3772  int fnos = (int) fields_cpy.size();
3773  if (fnos<1) return; // No fields to allocate, jump out
3774  else if (fnos==1) {
3775  // Use the pct as the chance that our single field is assigned
3776  if (g_random_fnc(100)>=a_pct) return;
3777  else {
3778  // Add field by default
3779  fields_cpy[0]->SetRotIndex(-4);
3780  // Assign the crop
3781  fields_cpy[0]->SetVegType(a_tov, tov_Undefined);
3782  return;
3783  }
3784  }
3785  // By here we have more than one field to potentially allocate to
3786  for (int i=0; i<fnos; i++) {
3787  a_tpct.pct = (int) floor(0.5+((fields_cpy[i]->GetArea()/area)*100));
3788  a_tpct.index = i;
3789  pcts.push_back(a_tpct);
3790  }
3791  // We need to look for combinations of fields that are close to our target.
3792  // First we can sort the array and ignore any that are greater than pct
3793  sort (pcts.begin(), pcts.end(), CompPcts); // results in ordering on increasing pct
3794  // now remove all those with pct>target+10% to save loads of time in the inverse integer partition
3795  int index=-1;
3796  int ind=0;
3797  int apct=a_pct+10; // Lets assume we have a tolerance of 10%
3798  while ((index==-1) && (ind< (int)pcts.size())) {
3799  if (pcts[ind++].pct>apct) index=ind;
3800  }
3801  if (index!=-1) pcts.erase(pcts.begin()+index,pcts.end());
3802  // Now find the best combination of fields to get close to our target & set them
3803  int bits = InvIntPartition(&pcts,a_pct);
3804  int mask=1;
3805  ind = 0;
3806  int used=0;
3807  //double pctused = 0.0;
3808  double check = 0.0;
3809  for (int h=0; h< (int)pcts.size(); h++) check+=fields_cpy[pcts[h].index]->GetArea();
3810  while (bits>0) {
3811  if ((bits & mask) > 0) {
3812  // Set the field as non-rotating
3813  fields_cpy[pcts[ind].index]->SetRotIndex(-4);
3814  // Assign the crop
3815  fields_cpy[pcts[ind].index]->SetVegType(a_tov, tov_Undefined);
3816  used += (int) fields_cpy[pcts[ind].index]->GetArea();
3817  //pctused = used/area;
3818  bits -= mask;
3819  }
3820  mask = mask << 1;
3821  ind++;
3822  }
3823 }

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

◆ 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.

carries out standard setting of data and deals with possible unsprayed margins, returns a pointer to UM or nullptr

286 {
287  if ( (0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
289  SetFunctionData(a_field, 0.1, 0.0, 0,autumn_harrow);
290  return true;
291  }
292  return false;
293 }

References autumn_harrow, DO_IT_PROB, g_weather, and Weather::Raining().

Referenced by WinterRapeStrigling::Do(), DK_OLegume::Do(), OWinterBarleyExt::Do(), OWinterBarley::Do(), OWinterRye::Do(), DE_OWinterWheat::Do(), OTriticale::Do(), DK_OWinterBarley::Do(), UKBeans::Do(), DK_OSugarBeet::Do(), DK_OFodderBeet::Do(), DE_OWinterRape::Do(), OWinterWheat::Do(), OWinterWheatUndersown::Do(), OWinterWheatUndersownExt::Do(), Triticale::Do(), UKBeet::Do(), OWinterRape::Do(), UKSpringBarley::Do(), UKWinterBarley::Do(), DK_OWinterRape::Do(), DE_OCarrots::Do(), DK_WinterBarley::Do(), DKOBroadBeans_test::Do(), UKWinterWheat::Do(), WinterRyeStrigling::Do(), PLCarrots::Do(), UKWinterRape::Do(), WinterRye::Do(), DK_Cabbages::Do(), PTBeans::Do(), PTTurnipGrazed::Do(), DK_WinterWheat::Do(), DK_WinterWheat_CC::Do(), PTOtherDryBeans::Do(), PTHorticulture::Do(), PLFodderLucerne1::Do(), DK_Potato::Do(), DK_OBushFruit_Perm2::Do(), PTOats::Do(), DE_HerbsPerennial_1year::Do(), DE_OHerbsPerennial_1year::Do(), WinterWheatStrigling::Do(), WinterWheatStriglingSingle::Do(), WinterWheatStriglingCulm::Do(), PLBeans::Do(), PTWinterBarley::Do(), PTWinterRye::Do(), PTWinterWheat::Do(), DK_WinterRape::Do(), PTTriticale::Do(), PTGrassGrazed::Do(), PTYellowLupin::Do(), WinterRape::Do(), WinterBarleyStrigling::Do(), DK_PotatoSeed::Do(), DK_PotatoIndustry::Do(), PTRyegrass::Do(), WinterBarley::Do(), PLWinterRye::Do(), DK_OBushFruit_Perm1::Do(), FR_Sorghum::Do(), FR_Maize::Do(), DK_OWinterWheat_CC::Do(), FR_Maize_Silage::Do(), PLMaizeSilage::Do(), PLSpringBarley::Do(), DK_OWinterWheat::Do(), PLMaize::Do(), FR_WinterTriticale::Do(), FI_OWinterRye::Do(), PLWinterTriticale::Do(), FR_Sunflower::Do(), DK_OWinterFodderGrass::Do(), DE_OTriticale::Do(), DE_OWinterRye::Do(), FI_OWinterWheat::Do(), PLWinterBarley::Do(), PLWinterWheat::Do(), PLBeet::Do(), DK_OWinterCloverGrassGrazedSown::Do(), PLWinterWheatLate::Do(), PLSpringWheat::Do(), PLPotatoes::Do(), PLWinterRape::Do(), DE_GrasslandSilageAnnual::Do(), FR_WinterBarley::Do(), FI_WinterWheat::Do(), DK_BushFruit_Perm2::Do(), IRWinterBarley::Do(), IRWinterOats::Do(), FI_WinterRye::Do(), DE_Triticale::Do(), FR_WinterWheat::Do(), IRWinterWheat::Do(), FR_WinterRape::Do(), DE_WinterRape::Do(), WinterWheat::Do(), DE_Potatoes::Do(), DE_PotatoesIndustry::Do(), DK_OChristmasTrees_Perm::Do(), and DK_ChristmasTrees_Perm::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.

213 {
214  // LE is a pointer to the field element
215  // a_user is a pointer to the farm
216  // a_days is the end of the operation time - today
217  // if a_days <0 then the time to do it is passed
218  // the line below reads 'plough if last day possible OR if not raining and pass a probability test
219  if ( (0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
220  // Set the data for this, in this case 90% insect mortality and remove all veg, not tramline open time, the treatment is autumn plough
221  SetFunctionData(a_field, 0.1, 0.0, 0, autumn_plough);
222  return true; // completed
223  }
224  return false; // not completed
225 }

References autumn_plough, DO_IT_PROB, g_weather, and Weather::Raining().

Referenced by NorwegianOats::Do(), WinterRapeStrigling::Do(), NorwegianSpringBarley::Do(), DK_OLegume::Do(), DK_CerealLegume_Whole::Do(), DK_CerealLegume::Do(), FI_OPotato_North::Do(), FI_OPotato_South::Do(), FI_OPotatoIndustry_North::Do(), FI_OPotatoIndustry_South::Do(), DK_Legume_Peas::Do(), FI_OStarchPotato_South::Do(), FI_OStarchPotato_North::Do(), DK_SpringBarley_Green::Do(), OWinterBarleyExt::Do(), DK_SpringBarleySilage::Do(), OWinterBarley::Do(), DK_FodderBeet::Do(), DK_MaizeSilage::Do(), OWinterRye::Do(), DK_Legume_Beans::Do(), DK_OWinterRye::Do(), FI_SugarBeet::Do(), DK_SpringOats::Do(), DK_SugarBeet::Do(), DK_SpringOats_CC::Do(), DK_OWinterRye_CC::Do(), DK_OCerealLegume_Whole::Do(), Maize::Do(), DE_OWinterWheat::Do(), MaizeSilage::Do(), MaizeStrigling::Do(), OTriticale::Do(), DK_OWinterBarley::Do(), DK_Maize::Do(), DK_SpringWheat::Do(), Oats::Do(), OSpringBarleyExt::Do(), DK_OSugarBeet::Do(), SpringBarleySeed::Do(), DK_Legume_Whole::Do(), DK_OCerealLegume::Do(), OSpringBarley::Do(), SpringBarleyCloverGrassStrigling::Do(), FI_Potato_North::Do(), FieldPeas::Do(), FieldPeasSilage::Do(), FieldPeasStrigling::Do(), DK_OFodderBeet::Do(), DE_OWinterRape::Do(), OWinterWheat::Do(), OWinterWheatUndersown::Do(), OWinterWheatUndersownExt::Do(), FI_StarchPotato_North::Do(), SpringBarleyCloverGrass::Do(), FI_PotatoIndustry_North::Do(), OFodderBeet::Do(), Triticale::Do(), FI_Potato_South::Do(), FI_PotatoIndustry_South::Do(), FI_StarchPotato_South::Do(), OWinterRape::Do(), DE_OCabbages::Do(), DK_OVegSeeds::Do(), DE_OSugarBeet::Do(), DK_SpringBarleyCloverGrass::Do(), UKSpringBarley::Do(), UKWinterBarley::Do(), DK_WinterFodderGrass::Do(), DK_OMaizeSilage::Do(), SpringBarleyPeaCloverGrassStrigling::Do(), DK_OWinterRape::Do(), DK_SpringBarley::Do(), DK_SpringBarley_CC::Do(), DK_OMaize::Do(), DK_WinterCloverGrassGrazedSown::Do(), DK_OSpringBarleySilage::Do(), DK_OCabbages::Do(), PotatoesIndustry::Do(), DK_WinterBarley::Do(), DKOBroadBeans_test::Do(), Potatoes::Do(), FodderBeet::Do(), NorwegianPotatoes::Do(), DK_VegSeeds::Do(), DK_WinterRye::Do(), DK_WinterRye_CC::Do(), SpringBarleySKManagement::Do(), UKWinterWheat::Do(), WinterRyeStrigling::Do(), SpringBarleySilage::Do(), UKWinterRape::Do(), SpringBarleyStrigling::Do(), SpringBarleyStriglingSingle::Do(), SpringBarleyPTreatment::Do(), SpringBarleyStriglingCulm::Do(), WinterRye::Do(), PTTurnipGrazed::Do(), PTBeans::Do(), NLWinterWheat::Do(), DK_OPotato::Do(), DK_WinterWheat::Do(), DK_OPotatoIndustry::Do(), DK_OPotatoSeed::Do(), DK_WinterWheat_CC::Do(), PTOtherDryBeans::Do(), SpringBarley::Do(), PTHorticulture::Do(), DK_OSeedGrassRye_Spring::Do(), DK_OBushFruit_Perm2::Do(), WinterWheatStrigling::Do(), WinterWheatStriglingSingle::Do(), WinterWheatStriglingCulm::Do(), DK_WinterRape::Do(), PTFodderMix::Do(), FI_OSpringBarley_Malt::Do(), WinterBarleyStrigling::Do(), WinterRape::Do(), PTGrassGrazed::Do(), FI_OFabaBean::Do(), FI_OTurnipRape::Do(), FI_OSpringOats::Do(), FI_OSpringRape::Do(), FI_OSpringWheat::Do(), WinterBarley::Do(), FI_OSpringBarley_Fodder::Do(), PLWinterRye::Do(), FI_TurnipRape::Do(), DK_OWinterWheat_CC::Do(), DK_OWinterWheat::Do(), FI_FabaBean::Do(), FI_SpringRape::Do(), NLTulips::Do(), FI_OWinterRye::Do(), FI_SpringBarley_Malt::Do(), PLWinterTriticale::Do(), SE_SpringBarley::Do(), PTCloverGrassGrazed1::Do(), FI_OWinterWheat::Do(), DE_WinterRye::Do(), DK_OWinterFodderGrass::Do(), DE_OTriticale::Do(), DE_OWinterRye::Do(), DK_OWinterCloverGrassGrazedSown::Do(), DE_OWinterBarley::Do(), PLWinterBarley::Do(), PLWinterWheat::Do(), FI_SpringWheat::Do(), FI_SpringOats::Do(), PLWinterWheatLate::Do(), PTPermanentGrassGrazed::Do(), SE_WinterRape_Seed::Do(), FI_SpringBarley_Fodder::Do(), DE_WinterBarley::Do(), SE_WinterWheat::Do(), DK_SeedGrassRye_Spring::Do(), PLWinterRape::Do(), FI_WinterWheat::Do(), DK_BushFruit_Perm2::Do(), FR_WinterBarley::Do(), IRWinterBarley::Do(), IRWinterOats::Do(), FR_WinterWheat::Do(), DE_WinterWheat::Do(), FI_WinterRye::Do(), DE_WinterWheatLate::Do(), DE_Triticale::Do(), FR_WinterRape::Do(), IRWinterWheat::Do(), DE_WinterRape::Do(), DK_SeedGrassFescue_Spring::Do(), WinterWheat::Do(), DK_OrchCherry::Do(), DK_OChristmasTrees_Perm::Do(), and DK_ChristmasTrees_Perm::Do().

◆ AutumnRoll()

◆ AutumnSow()

bool Farm::AutumnSow ( LE a_field,
double  a_user,
int  a_days,
double  a_seed_coating_amount = -1,
PlantProtectionProducts  a_ppp = ppp_foobar 
)
virtual

Carry out a sowing event in the autumn on a_field.

361 {
362  if ((0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
363  LE* um = SetFunctionData(a_field, 1.0, 0.0, 0, autumn_sow);
364  a_field->SetGrowthPhase(sow); // as with AutumnSow treatment
365  a_field->SetLastSownVeg(a_field->GetVegType()); // as with AutumnSow treatment
366  //start the flowering period.
367  if(a_field->GetPollenNectarCurveRef()<0){
368  a_field->CalculateFlowerResourceForCropSow(a_field->GetVegType());
369  }
370  // Apply seed coating if turned on
371  if (a_seed_coating_amount > 0) {
372  g_pest->DailyQueueAddSeedCoating(a_field, a_seed_coating_amount/10000, a_ppp); // Application rate is changed from g/ha to g/m2
373  }
374  if (um != nullptr) {
375  um->SetGrowthPhase(sow);
376  um->SetLastSownVeg(a_field->GetVegType());
377  //start the flowering period.
378  if(um->GetPollenNectarCurveRef()<0){
379  um->CalculateFlowerResourceForCropSow(um->GetVegType());
380  }
381  // Apply seed coating if turned on
382  if (a_seed_coating_amount > 0) {
383  g_pest->DailyQueueAddSeedCoating(um, a_seed_coating_amount/10000, a_ppp); // Application rate is changed from g/ha to g/m2
384  }
385  }
386  return true;
387  }
388  return false;
389 }

References autumn_sow, LE::CalculateFlowerResourceForCropSow(), Pesticide::DailyQueueAddSeedCoating(), DO_IT_PROB, g_pest, g_weather, LE::GetPollenNectarCurveRef(), Weather::Raining(), LE::SetGrowthPhase(), LE::SetLastSownVeg(), and sow.

Referenced by GenericCatchCrop::Do(), WinterRapeStrigling::Do(), DK_OCatchCrop::Do(), OWinterBarleyExt::Do(), DK_CatchCrop::Do(), OWinterBarley::Do(), OWinterRye::Do(), DK_OWinterRye::Do(), OTriticale::Do(), DE_OWinterWheat::Do(), DK_OWinterRye_CC::Do(), DK_OWinterBarley::Do(), UKBeans::Do(), DE_OWinterRape::Do(), OWinterWheat::Do(), OWinterWheatUndersown::Do(), OWinterWheatUndersownExt::Do(), Triticale::Do(), OWinterRape::Do(), DK_WinterFodderGrass::Do(), DK_OWinterRape::Do(), DK_WinterCloverGrassGrazedSown::Do(), UKWinterWheat::Do(), WinterRyeStrigling::Do(), UKWinterRape::Do(), WinterRye::Do(), PTTurnipGrazed::Do(), PTBeans::Do(), PTOtherDryBeans::Do(), DK_WinterWheat_CC::Do(), PTHorticulture::Do(), PTOats::Do(), DK_OBushFruit_Perm2::Do(), WinterWheatStrigling::Do(), WinterWheatStriglingCulm::Do(), WinterWheatStriglingSingle::Do(), PTWinterBarley::Do(), PTWinterRye::Do(), PTWinterWheat::Do(), PTTriticale::Do(), DK_WinterRape::Do(), PTFodderMix::Do(), PTYellowLupin::Do(), WinterBarleyStrigling::Do(), WinterRape::Do(), PTGrassGrazed::Do(), PTRyegrass::Do(), WinterBarley::Do(), PLWinterRye::Do(), DK_OBushFruit_Perm1::Do(), DK_OWinterWheat_CC::Do(), DK_OWinterWheat::Do(), FI_OWinterRye::Do(), NLTulips::Do(), PLWinterTriticale::Do(), PTCloverGrassGrazed1::Do(), FI_OWinterWheat::Do(), DK_OWinterFodderGrass::Do(), DE_WinterRye::Do(), DE_OWinterRye::Do(), DE_OTriticale::Do(), DK_OWinterCloverGrassGrazedSown::Do(), DE_OWinterBarley::Do(), PLWinterWheat::Do(), PLWinterBarley::Do(), PLWinterWheatLate::Do(), PTPermanentGrassGrazed::Do(), DE_WinterBarley::Do(), SE_WinterWheat::Do(), PLWinterRape::Do(), FR_WinterBarley::Do(), FI_WinterWheat::Do(), DK_BushFruit_Perm2::Do(), IRWinterOats::Do(), IRSpringBarley::Do(), IRSpringOats::Do(), IRWinterBarley::Do(), DE_Triticale::Do(), FR_WinterWheat::Do(), FI_WinterRye::Do(), IRSpringWheat::Do(), DE_WinterWheat::Do(), DE_WinterWheatLate::Do(), IRWinterWheat::Do(), FR_WinterRape::Do(), DE_WinterRape::Do(), WinterWheat::Do(), DK_OChristmasTrees_Perm::Do(), and DK_ChristmasTrees_Perm::Do().

◆ AutumnSowWithFerti()

bool Farm::AutumnSowWithFerti ( LE a_field,
double  a_user,
int  a_days,
double  a_seed_coating_amount = -1,
PlantProtectionProducts  a_ppp = ppp_foobar 
)
virtual

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

593 {
594  FarmToDo treatment = autumn_sow_with_ferti;
595  if ((0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
596  LE* um = SetFunctionData(a_field, 1.0, 1.0, 0, treatment);
597  a_field->SetGrowthPhase(sow);
598  a_field->SetLastSownVeg(a_field->GetVegType());
599  //start the flowering period.
600  if(a_field->GetPollenNectarCurveRef()<0){
601  a_field->CalculateFlowerResourceForCropSow(a_field->GetVegType());
602  }
603  // Apply seed coating if turned on
604  if (a_seed_coating_amount > 0) {
605  g_pest->DailyQueueAddSeedCoating(a_field, a_seed_coating_amount/10000, a_ppp); // Application rate is changed from g/ha to g/m2
606  }
607  if (um != nullptr)
608  {
609  um->SetGrowthPhase(sow);
610  um->SetLastSownVeg(um->GetVegType());
611  //start the flowering period.
612  if(um->GetPollenNectarCurveRef()<0){
613  um->CalculateFlowerResourceForCropSow(um->GetVegType());
614  }
615  // Apply seed coating if turned on
616  if (a_seed_coating_amount > 0) {
617  g_pest->DailyQueueAddSeedCoating(um, a_seed_coating_amount/10000, a_ppp); // Application rate is changed from g/ha to g/m2
618  }
619  }
620  return true;
621  }
622  return false;
623 }

References autumn_sow_with_ferti, LE::CalculateFlowerResourceForCropSow(), Pesticide::DailyQueueAddSeedCoating(), DO_IT_PROB, g_pest, g_weather, LE::GetPollenNectarCurveRef(), Weather::Raining(), LE::SetGrowthPhase(), LE::SetLastSownVeg(), and sow.

Referenced by SE_WinterRape_Seed::Do(), and SE_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.

1317 {
1318  FarmToDo treatment = bed_forming;
1319  if ((0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
1320  SetFunctionData(a_field, 0.9, 0.0, EL_TRAMLINE_DECAYTIME, treatment);
1321  return true;
1322  }
1323  return false;
1324 }

References bed_forming, DO_IT_PROB, EL_TRAMLINE_DECAYTIME, g_weather, and Weather::Raining().

Referenced by NLCarrotsSpring::Do(), DE_OCarrots::Do(), DK_OCarrots::Do(), NLCarrots::Do(), DK_Carrots_Spring::Do(), PLCarrots::Do(), DK_Carrots::Do(), UKPotatoes::Do(), PTPotatoes::Do(), NLPotatoesSpring::Do(), NLPotatoes::Do(), NLTulips::Do(), and DE_Carrots::Do().

◆ BiocideTreat()

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

Apply Biocide to a_field.

2176 {
2177  constexpr FarmToDo treatment = biocide;
2178  if ((0 >= a_days) || ((g_weather->GetWind() < cfg_pest_max_wind.value()) && (!g_weather->Raining()) && DoIt(DO_IT_PROB))) {
2179  a_field->Trace(treatment);
2180  a_field->SetLastTreatment(treatment);
2182  a_field->Insecticide(1-(0.64*(1-cfg_biocide_reduction_val.value())));
2183  }
2185  CalculateTreatmentCosts(treatment, a_field);
2186  return true;
2187  }
2188  return false;
2189 }

References biocide, cfg_biocide_reduction_val, cfg_pest_max_wind, DO_IT_PROB, EL_TRAMLINE_DECAYTIME, g_weather, Weather::GetWind(), LE::Insecticide(), l_farm_insecticide_kills, Weather::Raining(), LE::SetLastTreatment(), LE::SetTramlinesDecay(), CfgFloat::value(), and CfgBool::value().

Referenced by FI_SugarBeet::Do(), FI_Potato_North::Do(), FI_StarchPotato_North::Do(), FI_PotatoIndustry_North::Do(), FI_Potato_South::Do(), FI_PotatoIndustry_South::Do(), FI_StarchPotato_South::Do(), BEWinterWheatCC::Do(), BEWinterWheat::Do(), NLWinterWheat::Do(), DK_WinterWheat::Do(), DK_WinterWheat_CC::Do(), DK_Potato::Do(), DK_WinterRape::Do(), BEPotatoesSpring::Do(), DK_PotatoSeed::Do(), DK_PotatoIndustry::Do(), NLPotatoesSpring::Do(), BEPotatoes::Do(), FR_Maize::Do(), FR_Maize_Silage::Do(), PLMaizeSilage::Do(), NLPotatoes::Do(), PLMaize::Do(), FI_SpringRape::Do(), PLWinterWheat::Do(), FI_SpringWheat::Do(), PLWinterWheatLate::Do(), PLPotatoes::Do(), PLWinterRape::Do(), FI_WinterWheat::Do(), DE_WinterWheatLate::Do(), DE_WinterWheat::Do(), FR_WinterWheat::Do(), FR_WinterRape::Do(), FR_Potatoes::Do(), DE_WinterRape::Do(), DE_Potatoes::Do(), and DE_PotatoesIndustry::Do().

◆ BulbHarvest()

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

Carry out a bulb harvest on a_field.

1707 {
1708  FarmToDo treatment = bulb_harvest;
1709  //5 days good weather before
1710  if ((0 >= a_days) || ((g_weather->GetRainPeriod(g_date->Date(), 5) < 0.1) && DoIt(DO_IT_PROB))) {
1711  LE* um = SetFunctionData(a_field, 0.3, 0.0, EL_TRAMLINE_DECAYTIME, treatment);
1712  double insects = a_field->GetInsectPop();
1713  a_field->SetGrowthPhase(harvest1);
1714  double biomassBefore = a_field->GetVegBiomass();
1715  a_field->RecalculateBugsNStuff();
1716  double reduc = a_field->GetVegBiomass() / biomassBefore;
1717  if (reduc > 0 && reduc < 1) g_pest->ReducePlantPesticide(a_field->GetMinX(), a_field->GetMaxX(), a_field->GetMinY(), a_field->GetMaxY(), a_field->GetMapIndex(), reduc, true);
1718  a_field->ResetDigestibility();
1719  a_field->PollenNectarReset();
1720  if (um != nullptr) {
1721  um->SetGrowthPhase(harvest1);
1722  double biomassBefore = um->GetVegBiomass();
1723  um->RecalculateBugsNStuff();
1724  double reduc = um->GetVegBiomass() / biomassBefore;
1725  if (reduc > 0 && reduc < 1) g_pest->ReducePlantPesticide(um->GetMinX(), um->GetMaxX(), um->GetMinY(), um->GetMapIndex(), reduc, true);
1726  um->ResetDigestibility();
1727  um->PollenNectarReset();
1728  }
1729  return true;
1730  }
1731  return false;
1732 }

References bulb_harvest, Calendar::Date(), DO_IT_PROB, EL_TRAMLINE_DECAYTIME, g_date, g_pest, g_weather, LE::GetInsectPop(), LE::GetMapIndex(), LE::GetMaxX(), LE::GetMaxY(), LE::GetMinX(), LE::GetMinY(), Weather::GetRainPeriod(), LE::GetVegBiomass(), harvest1, LE::PollenNectarReset(), LE::RecalculateBugsNStuff(), Pesticide::ReducePlantPesticide(), LE::ResetDigestibility(), and LE::SetGrowthPhase().

Referenced by NLTulips::Do().

◆ BurnStrawStubble()

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

Burn stubble on a_field.

1568 {
1569  FarmToDo treatment = burn_straw_stubble;
1570  if ((0 >= a_days) && (g_weather->GetRainPeriod(g_date->Date(), 3) > 0.1))
1571  {
1572  return true;
1573  }
1574  if ((0 >= a_days) || ((g_weather->GetRainPeriod(g_date->Date(), 3) < 0.1)
1575  && DoIt(DO_IT_PROB)))
1576  {
1577  SetFunctionData(a_field, 0.4, 0.2, 0, treatment);
1578  return true;
1579  }
1580  return false;
1581 }

References burn_straw_stubble, Calendar::Date(), DO_IT_PROB, g_date, g_weather, and Weather::GetRainPeriod().

Referenced by OSeedGrass1::Do(), OSeedGrass2::Do(), SeedGrass1::Do(), SeedGrass2::Do(), SpringBarleySeed::Do(), DE_OCarrots::Do(), DK_OCarrots::Do(), DK_SeedGrassRye_Spring::Do(), and DK_SeedGrassFescue_Spring::Do().

◆ BurnTop()

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

Burn tops of e.g. potatoes on a_field.

1588 {
1589  FarmToDo treatment = burn_top;
1590  if ((0 >= a_days) && (g_weather->GetRainPeriod(g_date->Date(), 3) > 0.1))
1591  {
1592  return true;
1593  }
1594  if ((0 >= a_days) || ((g_weather->GetRainPeriod(g_date->Date(), 3) < 0.1)
1595  && DoIt(DO_IT_PROB)))
1596  {
1597  SetFunctionData(a_field, 0.4, 0.2, 0, treatment);
1598  return true;
1599  }
1600  return false;
1601 }

References burn_top, Calendar::Date(), DO_IT_PROB, g_date, g_weather, and Weather::GetRainPeriod().

Referenced by DK_OPotato::Do(), DK_OPotatoSeed::Do(), and DK_OPotatoIndustry::Do().

◆ CalculateTreatmentCosts()

void Farm::CalculateTreatmentCosts ( FarmToDo  a_treatment,
LE a_field 
)
6354 {
6355 
6357  FarmFuncsCostBenefits FFCB = m_OurManager->Get_FarmFuncsCB(a_treatment);
6358  double area = a_field->GetArea();
6359  double total_economic_cost_of_the_treatment = FFCB.EconomicCost * area;
6360  double total_labour_cost_of_the_treatment = FFCB.LabourCost * area;
6361  m_OurFarmer->AddCost(total_economic_cost_of_the_treatment);
6362  m_OurFarmer->AddLabourCost(total_labour_cost_of_the_treatment);
6363  m_OurFarmer->ChangeRiskScore(FFCB.RiskAvoidance);
6364  m_OurFarmer->ChangeEnvironmentScore(FFCB.EnvImpact * area);
6366  }

References LE::AddManagementActionDone(), cfg_UseSocioEconomicFarm, FarmFuncsCostBenefits::EconomicCost, FarmFuncsCostBenefits::EnvImpact, FarmManager::Get_FarmFuncsCB(), LE::GetArea(), FarmFuncsCostBenefits::LabourCost, m_OurFarmer, m_OurManager, FarmFuncsCostBenefits::ManagementCategory, FarmFuncsCostBenefits::RiskAvoidance, and CfgBool::value().

◆ CattleIsOut() [1/2]

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.

2471 {
2475  FarmToDo treatment = cattle_out;
2476  double biomass = a_field->GetVegBiomass();
2477  if (biomass > 100.0)
2478  {
2479  a_field->SetLastTreatment(treatment);
2480  a_field->Trace(treatment);
2481  // Reduce the vegetation because of grazing
2482  //double h=a_field->GetVegHeight();
2483  //double reduc = 1-(l_farm_cattle_veg_reduce.value()*((h-15)/15));
2484  //a_field->ReduceVeg_Extended( reduc );
2485  a_field->GrazeVegetation(l_farm_cattle_veg_reduce.value(), false);
2486  int pref = a_field->GetUnsprayedMarginPolyRef();
2487  if (pref != -1)
2488  {
2489  // Must have an unsprayed margin so need to pass the information on to it
2490  LE* um = g_landscape_ptr->SupplyLEPointer(pref);
2491  um->SetLastTreatment(treatment);
2493  }
2494  }
2495  int d1 = g_date->DayInYear(10, 9);
2496  if (d1 > a_max) d1 = a_max;
2497  if ((((g_date->DayInYear() > d1) && (10 >= a_days)) && DoIt(10)) || (0 >= a_days))
2498  {
2499  a_field->ToggleCattleGrazing();
2500  int pref = a_field->GetUnsprayedMarginPolyRef();
2501  if (pref != -1) {
2502  // Must have an unsprayed margin so need to pass the information on to it
2503  LE* um = g_landscape_ptr->SupplyLEPointer(pref);
2504  um->ToggleCattleGrazing();
2505  }
2506  CalculateTreatmentCosts(treatment, a_field);
2507  return true;
2508  }
2509  return false;
2510 }

References cattle_out, Calendar::DayInYear(), g_date, g_landscape_ptr, LE::GetUnsprayedMarginPolyRef(), LE::GetVegBiomass(), LE::GrazeVegetation(), l_farm_cattle_veg_reduce, LE::SetLastTreatment(), Landscape::SupplyLEPointer(), LE::ToggleCattleGrazing(), and CfgFloat::value().

Referenced by DK_GrassTussocky_Perm::Do(), PermanentGrassLowYield::Do(), DK_OGrassLowYield_Perm::Do(), OPermanentGrassGrazed::Do(), DK_GrassLowYield_Perm::Do(), PermanentGrassGrazed::Do(), OBarleyPeaCloverGrass::Do(), SpringBarleyCloverGrassStrigling::Do(), SpringBarleyCloverGrass::Do(), DK_WinterFodderGrass::Do(), SpringBarleyPeaCloverGrassStrigling::Do(), DK_WinterCloverGrassGrazedSown::Do(), DK_SpringFodderGrass::Do(), NLGrassGrazedExtensive2::Do(), NLPermanentGrassGrazedExtensive::Do(), SetAside::Do(), NLGrassGrazedExtensive1Spring::Do(), NLGrassGrazedExtensiveLast::Do(), NLGrassGrazedExtensive1::Do(), DK_OGrassGrazed_Perm::Do(), DK_GrassGrazed_Perm::Do(), DE_OPermanentGrassLowYield::Do(), DE_PermanentGrassLowYield::Do(), DE_PermanentGrassGrazed::Do(), FR_Grassland_Perm::Do(), UKPermanentGrass::Do(), DE_GreenFallow_1year::Do(), UKTempGrass::Do(), FI_GreenFallow_1year::Do(), FI_NaturalGrassland_Perm::Do(), DE_OGreenFallow_1year::Do(), NLGrassGrazed2::Do(), NLPermanentGrassGrazed::Do(), DK_CloverGrassGrazed1::Do(), FI_GreenFallow_Perm::Do(), NLGrassGrazedLast::Do(), NLGrassGrazed1Spring::Do(), FI_BufferZone::Do(), FI_BufferZone_Perm::Do(), FI_NaturalGrassland::Do(), NLGrassGrazed1::Do(), FI_GrasslandPasturePerennial2::Do(), FI_GrasslandSilagePerennial1::Do(), FI_GrasslandPasturePerennial1::Do(), FI_FeedingGround::Do(), FI_GrasslandSilagePerennial2::Do(), DK_OSpringFodderGrass::Do(), FI_GrasslandSilageAnnual::Do(), DK_OCloverGrassGrazed3::Do(), DK_OCloverGrassGrazed1::Do(), DK_OCloverGrassGrazed2::Do(), DK_OWinterFodderGrass::Do(), DK_OWinterCloverGrassGrazedSown::Do(), DK_CloverGrassGrazed3::Do(), DK_CloverGrassGrazed2::Do(), FR_Grassland::Do(), IRGrassland_no_reseed::Do(), and IRGrassland_reseed::Do().

◆ CattleIsOut() [2/2]

bool Farm::CattleIsOut ( LE a_field,
double  a_user,
int  a_days,
int  a_max,
bool  a_should_eat 
)
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.

2517 {
2521 
2522  FarmToDo treatment = cattle_out;
2523  if (a_should_eat) {
2524  a_field->SetLastTreatment(treatment);
2525  a_field->Trace(treatment);
2527  a_field->SetGrowthPhase(harvest2);
2528 
2529  int pref = a_field->GetUnsprayedMarginPolyRef();
2530  if (pref != -1)
2531  {
2532  // Must have an unsprayed margin so need to pass the information on to it
2533  LE* um = g_landscape_ptr->SupplyLEPointer(pref);
2534  um->SetLastTreatment(treatment);
2536  um->SetGrowthPhase(harvest2);
2537  }
2538  }
2539  int d1 = g_date->DayInYear(10, 9);
2540  if (d1 > a_max) d1 = a_max;
2541  if ((((g_date->DayInYear() > d1) && (10 >= a_days)) && DoIt(10)) || (0 >= a_days))
2542  {
2543  a_field->ToggleCattleGrazing();
2544  int pref = a_field->GetUnsprayedMarginPolyRef();
2545  if (pref != -1) {
2546  // Must have an unsprayed margin so need to pass the information on to it
2547  LE* um = g_landscape_ptr->SupplyLEPointer(pref);
2548  um->ToggleCattleGrazing();
2549  }
2550  CalculateTreatmentCosts(treatment, a_field);
2551  return true;
2552  }
2553  return false;
2554 }

References cattle_out, cfg_farm_cattle_reduce_height, Calendar::DayInYear(), g_date, g_landscape_ptr, LE::GetCattleGrazing(), LE::GetUnsprayedMarginPolyRef(), LE::GrazeVegetationHeight(), harvest2, LE::SetGrowthPhase(), LE::SetLastTreatment(), Landscape::SupplyLEPointer(), LE::ToggleCattleGrazing(), and CfgArray_Double::value().

◆ 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.

2562 {
2563  FarmToDo treatment = cattle_out_low;
2564  // Generate a 'cattle_in_out' event for every day the cattle is on the
2565  // field.
2566  double biomass = a_field->GetVegBiomass();
2567  if (biomass > 100.0)
2568  {
2569  a_field->SetLastTreatment(treatment);
2570  a_field->Trace(treatment);
2571  // Reduce the vegetation because of grazing
2572  //double h=a_field->GetVegHeight();
2573  //double reduc = 1-(l_farm_cattle_veg_reduce2.value()*((h-15)/15));
2574  //a_field->ReduceVeg_Extended( reduc );
2575  a_field->GrazeVegetation(l_farm_cattle_veg_reduce2.value(), false);
2576  int pref = a_field->GetUnsprayedMarginPolyRef();
2577  if (pref != -1)
2578  {
2579  // Must have an unsprayed margin so need to pass the information on to it
2580  LE* um = g_landscape_ptr->SupplyLEPointer(pref);
2581  um->SetLastTreatment(treatment);
2583  }
2584  }
2585  int d1 = g_date->DayInYear(10, 9);
2586  if (d1 > a_max) d1 = a_max;
2587  if ((((g_date->DayInYear() > d1) && (10 >= a_days)) && DoIt(10)) || (0 >= a_days))
2588  {
2589  a_field->ToggleCattleGrazing();
2590  int pref = a_field->GetUnsprayedMarginPolyRef();
2591  if (pref != -1) {
2592  // Must have an unsprayed margin so need to pass the information on to it
2593  LE* um = g_landscape_ptr->SupplyLEPointer(pref);
2594  um->ToggleCattleGrazing();
2595  }
2596  CalculateTreatmentCosts(treatment, a_field);
2597  return true;
2598  }
2599  return false;
2600 }

References cattle_out_low, Calendar::DayInYear(), g_date, g_landscape_ptr, LE::GetUnsprayedMarginPolyRef(), LE::GetVegBiomass(), LE::GrazeVegetation(), l_farm_cattle_veg_reduce2, LE::SetLastTreatment(), Landscape::SupplyLEPointer(), LE::ToggleCattleGrazing(), and CfgFloat::value().

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

◆ CattleIsOutLow2()

bool Farm::CattleIsOutLow2 ( LE a_field,
double  a_user,
int  a_days,
int  a_max,
int  a_max_days 
)
virtual

Generate a 'cattle_out_low2' event for every day the cattle are on a_field, cattle is low grazing and can stay on the field till a_max date but no more days than defined by a_max_days a_days defines the number of days from the day the cattle is put on the field (set by a flag in the management plan)

2608 {
2609  FarmToDo treatment = cattle_out_low;
2610  // Generate a 'cattle_in_out' event for every day the cattle is on the
2611  // field.
2612  double biomass = a_field->GetVegBiomass();
2613  if (biomass > 100.0)
2614  {
2615  a_field->SetLastTreatment(treatment);
2616  a_field->Trace(treatment);
2617  // Reduce the vegetation because of grazing
2618  //double h=a_field->GetVegHeight();
2619  //double reduc = 1-(l_farm_cattle_veg_reduce2.value()*((h-15)/15));
2620  //a_field->ReduceVeg_Extended( reduc );
2621  a_field->GrazeVegetation(l_farm_cattle_veg_reduce2.value(), false);
2622  int pref = a_field->GetUnsprayedMarginPolyRef();
2623  if (pref != -1)
2624  {
2625  // Must have an unsprayed margin so need to pass the information on to it
2626  LE* um = g_landscape_ptr->SupplyLEPointer(pref);
2627  um->SetLastTreatment(treatment);
2629  }
2630  }
2631  if ((g_date->DayInYear() > a_max) || (a_max_days < a_days))
2632  {
2633  a_field->ToggleCattleGrazing();
2634  int pref = a_field->GetUnsprayedMarginPolyRef();
2635  if (pref != -1) {
2636  // Must have an unsprayed margin so need to pass the information on to it
2637  LE* um = g_landscape_ptr->SupplyLEPointer(pref);
2638  um->ToggleCattleGrazing();
2639  }
2640  CalculateTreatmentCosts(treatment, a_field);
2641  return true;
2642  }
2643  return false;
2644 }

References cattle_out_low, Calendar::DayInYear(), g_date, g_landscape_ptr, LE::GetUnsprayedMarginPolyRef(), LE::GetVegBiomass(), LE::GrazeVegetation(), l_farm_cattle_veg_reduce2, LE::SetLastTreatment(), Landscape::SupplyLEPointer(), LE::ToggleCattleGrazing(), and CfgFloat::value().

Referenced by PTTurnipGrazed::Do(), PTShrubPastures::Do(), PTCloverGrassGrazed2::Do(), PTFodderMix::Do(), PTGrassGrazed::Do(), PTYellowLupin::Do(), PTCloverGrassGrazed1::Do(), and PTPermanentGrassGrazed::Do().

◆ CattleOut() [1/2]

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.

2369 {
2373  FarmToDo treatment = cattle_out;
2374  if ((0 >= a_days) || DoIt(DO_IT_PROB))
2375  {
2376  a_field->ToggleCattleGrazing();
2377  a_field->Trace(treatment);
2378  a_field->SetLastTreatment(treatment);
2379  // Reduce the vegetation because of grazing
2380  //double h=a_field->GetVegHeight();
2381  //double reduc = 1-(l_farm_cattle_veg_reduce.value()*((h-15)/15));
2382  //a_field->ReduceVeg_Extended( reduc );
2383  a_field->GrazeVegetation(l_farm_cattle_veg_reduce.value(), false);
2384  int pref = a_field->GetUnsprayedMarginPolyRef();
2385  if (pref != -1)
2386  {
2387  // Must have an unsprayed margin so need to pass the information on to it
2388  // This happens if all arable fields are given unsprayed margins - they have no effect on grass unless it is sprayed with pesticides
2389  LE* um = g_landscape_ptr->SupplyLEPointer(pref);
2390  um->ToggleCattleGrazing();
2391  um->SetLastTreatment(treatment);
2393  }
2394  CalculateTreatmentCosts(treatment, a_field);
2395  return true;
2396  }
2397  return false;
2398 }

References cattle_out, DO_IT_PROB, g_landscape_ptr, LE::GetUnsprayedMarginPolyRef(), LE::GrazeVegetation(), l_farm_cattle_veg_reduce, LE::SetLastTreatment(), Landscape::SupplyLEPointer(), LE::ToggleCattleGrazing(), and CfgFloat::value().

Referenced by DK_GrassTussocky_Perm::Do(), PermanentGrassLowYield::Do(), DK_OGrassLowYield_Perm::Do(), OPermanentGrassGrazed::Do(), DK_GrassLowYield_Perm::Do(), PermanentGrassGrazed::Do(), OBarleyPeaCloverGrass::Do(), SpringBarleyCloverGrassStrigling::Do(), SpringBarleyCloverGrass::Do(), DK_WinterFodderGrass::Do(), SpringBarleyPeaCloverGrassStrigling::Do(), DK_WinterCloverGrassGrazedSown::Do(), DK_SpringFodderGrass::Do(), NLGrassGrazedExtensive2::Do(), NLPermanentGrassGrazedExtensive::Do(), SetAside::Do(), NLGrassGrazedExtensive1Spring::Do(), NLGrassGrazedExtensiveLast::Do(), NLGrassGrazedExtensive1::Do(), DK_OGrassGrazed_Perm::Do(), DK_GrassGrazed_Perm::Do(), DE_OPermanentGrassLowYield::Do(), DE_PermanentGrassLowYield::Do(), DE_PermanentGrassGrazed::Do(), FR_Grassland_Perm::Do(), UKPermanentGrass::Do(), DE_GreenFallow_1year::Do(), UKTempGrass::Do(), FI_GreenFallow_1year::Do(), FI_NaturalGrassland_Perm::Do(), DE_OGreenFallow_1year::Do(), NLGrassGrazed2::Do(), NLPermanentGrassGrazed::Do(), DK_CloverGrassGrazed1::Do(), FI_GreenFallow_Perm::Do(), NLGrassGrazedLast::Do(), NLGrassGrazed1Spring::Do(), FI_BufferZone::Do(), FI_BufferZone_Perm::Do(), FI_NaturalGrassland::Do(), NLGrassGrazed1::Do(), FI_GrasslandPasturePerennial2::Do(), FI_GrasslandSilagePerennial1::Do(), FI_GrasslandPasturePerennial1::Do(), FI_FeedingGround::Do(), FI_GrasslandSilagePerennial2::Do(), DK_OSpringFodderGrass::Do(), FI_GrasslandSilageAnnual::Do(), DK_OCloverGrassGrazed3::Do(), DK_OCloverGrassGrazed1::Do(), DK_OCloverGrassGrazed2::Do(), DK_OWinterFodderGrass::Do(), DK_OWinterCloverGrassGrazedSown::Do(), DK_CloverGrassGrazed3::Do(), DK_CloverGrassGrazed2::Do(), FR_Grassland::Do(), IRGrassland_no_reseed::Do(), and IRGrassland_reseed::Do().

◆ CattleOut() [2/2]

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

Start an intensive 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.

2405 {
2409 
2410  FarmToDo treatment = cattle_out;
2411  if ((0 >= a_days) || DoIt(DO_IT_PROB))
2412  {
2413  a_field->ToggleCattleGrazing();
2414  if (a_should_eat){
2415  a_field->Trace(treatment);
2416  a_field->SetLastTreatment(treatment);
2418  int pref = a_field->GetUnsprayedMarginPolyRef();
2419  if (pref != -1)
2420  {
2421  // Must have an unsprayed margin so need to pass the information on to it
2422  //This happens if all arable fields are given unsprayed margins - they have no effect on grass unless it is sprayed with pesticides
2423  LE* um = g_landscape_ptr->SupplyLEPointer(pref);
2424  um->ToggleCattleGrazing();
2425  um->SetLastTreatment(treatment);
2427  }
2428  CalculateTreatmentCosts(treatment, a_field);
2429  }
2430  return true;
2431  }
2432  return false;
2433 }

References cattle_out, cfg_farm_cattle_reduce_height, DO_IT_PROB, g_landscape_ptr, LE::GetCattleGrazing(), LE::GetUnsprayedMarginPolyRef(), LE::GrazeVegetationHeight(), LE::SetLastTreatment(), Landscape::SupplyLEPointer(), LE::ToggleCattleGrazing(), and CfgArray_Double::value().

◆ CattleOutLowGrazing()

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

Start a extensive grazing event on a_field today.

2440 {
2441  FarmToDo treatment = cattle_out_low;
2442  if ((0 >= a_days) || DoIt(DO_IT_PROB)) {
2443  a_field->ToggleCattleGrazing();
2444  a_field->Trace(treatment);
2445  a_field->SetLastTreatment(treatment);
2446  // Reduce the vegetation because of grazing
2447  //double h=a_field->GetVegHeight();
2448  //double reduc = 1-(l_farm_cattle_veg_reduce.value()*((h-15)/15));
2449  //a_field->ReduceVeg_Extended( reduc );
2450  a_field->GrazeVegetation(l_farm_cattle_veg_reduce2.value(), false);
2451  int pref = a_field->GetUnsprayedMarginPolyRef();
2452  if (pref != -1) {
2453  // Must have an unsprayed margin so need to pass the information on to it
2454  // This happens if all arable fields are given unsprayed margins - they have no effect on grass unless it is sprayed with pesticides
2455  LE* um = g_landscape_ptr->SupplyLEPointer(pref);
2456  um->ToggleCattleGrazing();
2457  um->SetLastTreatment(treatment);
2459  }
2460  CalculateTreatmentCosts(treatment, a_field);
2461  return true;
2462  }
2463  return false;
2464 }

References cattle_out_low, DO_IT_PROB, g_landscape_ptr, LE::GetUnsprayedMarginPolyRef(), LE::GrazeVegetation(), l_farm_cattle_veg_reduce2, LE::SetLastTreatment(), Landscape::SupplyLEPointer(), LE::ToggleCattleGrazing(), and CfgFloat::value().

Referenced by PermanentGrassTussocky::Do(), OPermanentGrassGrazed::Do(), OBarleyPeaCloverGrass::Do(), PTTurnipGrazed::Do(), DE_OPermanentGrassGrazed::Do(), PTShrubPastures::Do(), PTFodderMix::Do(), PTCloverGrassGrazed2::Do(), PTGrassGrazed::Do(), PTYellowLupin::Do(), PTCloverGrassGrazed1::Do(), and PTPermanentGrassGrazed::Do().

◆ Centroids()

void Farm::Centroids ( )

Finds farm's centroids - x and y.

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

For now we assume the farmer location is the same as the farm centroid.

6012  {
6014 
6015  int sum_centroidx = 0;
6016  int sum_centroidy = 0;
6017  int no_fields = (int)m_fields.size();
6018  for (int i=0; i<no_fields; i++){
6019  sum_centroidx += m_fields[i]->GetCentroidX();
6020  sum_centroidy += m_fields[i]->GetCentroidY();
6021  }
6022  if (no_fields>0){
6023  m_farm_centroidx = sum_centroidx/no_fields;
6024  m_farm_centroidy = sum_centroidy/no_fields;
6025  }
6026  else{
6027  g_msg->Warn("Farm::Centroids", "Farm with no fields ("+ to_string(GetFarmNumber())+ ") is detected. Proceeding.");
6028  cout<<"Farm::Centroids: Farm with no fields ("<<GetFarmNumber() << ") is detected. Proceeding."<<endl;
6029  m_farm_centroidx = 0;
6030  m_farm_centroidy = 0;
6031  }
6032 
6036 }

References g_msg, GetFarmNumber(), m_farm_centroidx, m_farm_centroidy, m_fields, m_OurFarmer, and MapErrorMsg::Warn().

◆ CheckRotationManagementLoop()

void Farm::CheckRotationManagementLoop ( FarmEvent ev)
protected

Rotation error check function

895  {
896  if ( ev->m_field->GetMgtLoopDetectDate() == g_date->Date() ) {
897  // The last crop managment plan stopped on the same day as
898  // it was started.
899 
900  // Bump loop counter.
901  ev->m_field->SetMgtLoopDetectCount( ev->m_field->GetMgtLoopDetectCount() + 1 );
902 
903  if ( ev->m_field->GetMgtLoopDetectCount() > ( long )( m_rotation.size() + 2 ) ) {
904  // We have a loop.
905  char errornum[ 20 ];
906  sprintf( errornum, "%d", m_farmtype );
907  g_msg->Warn( WARN_BUG, "Rotation management loop detected in farmtype ", errornum );
908  exit( 1 );
909  }
910  } else {
911  ev->m_field->SetMgtLoopDetectCount( 0 );
912  }
913 }

References Calendar::Date(), g_date, g_msg, FarmEvent::m_field, MapErrorMsg::Warn(), and WARN_BUG.

◆ 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.

1667 {
1668  FarmToDo treatment = mow;
1669  if ((0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
1670  LE* um = SetFunctionData(a_field, 0.4, 0.2, 0, treatment);
1671  a_field->SetMownDecay(12); // 12 days of not suitable
1672  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
1673  if (um != nullptr) {
1675  um->SetMownDecay(12); // 12 days of not suitable
1676  }
1677  return true;
1678  }
1679  return false;
1680 }

References DO_IT_PROB, g_weather, l_el_o_cut_green, l_el_o_cut_height, l_el_o_cut_total, mow, Weather::Raining(), LE::SetMownDecay(), LE::SetVegParameters(), and CfgFloat::value().

Referenced by OrchardCrop::Do(), BEOrchardCrop::Do(), NLOrchardCrop::Do(), DK_OBushFruit_Perm2::Do(), DK_OOrchCherry::Do(), DK_OOrchPear::Do(), DK_OOrchApple::Do(), DK_OOrchardCrop_Perm::Do(), PTVineyards::Do(), DK_BushFruit_Perm2::Do(), DK_OrchCherry::Do(), DK_OrchPear::Do(), DK_OrchOther::Do(), DK_OrchardCrop_Perm::Do(), DK_OrchApple::Do(), and ITOOrchard::Do().

◆ CutToHay()

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

◆ CutToSilage()

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

Cut vegetation for silage on a_field.

1645 {
1646  FarmToDo treatment = cut_to_silage;
1647  if ( (0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
1648  LE* um = SetFunctionData(a_field, 0.4, 0.2, 0, treatment);
1649  a_field->SetVegHeight( 10 );
1650  a_field->SetGrowthPhase(harvest1);
1651  a_field->ResetDigestibility();
1652  if (um != nullptr) {
1653  um->SetVegHeight(10);
1654  um->SetGrowthPhase(harvest1);
1655  um->ResetDigestibility();
1656  }
1657  return true;
1658  }
1659  return false;
1660 }

References cut_to_silage, DO_IT_PROB, g_weather, harvest1, Weather::Raining(), LE::ResetDigestibility(), LE::SetGrowthPhase(), and LE::SetVegHeight().

Referenced by OSBarleySilage::Do(), OBarleyPeaCloverGrass::Do(), PLFodderLucerne2::Do(), DK_WinterFodderGrass::Do(), NLGrassGrazedExtensive2::Do(), DK_SpringFodderGrass::Do(), NLPermanentGrassGrazedExtensive::Do(), DK_WinterCloverGrassGrazedSown::Do(), SetAside::Do(), NLGrassGrazedExtensive1Spring::Do(), NLGrassGrazedExtensiveLast::Do(), NLGrassGrazedExtensive1::Do(), DE_OPermanentGrassLowYield::Do(), DE_PermanentGrassLowYield::Do(), DE_PermanentGrassGrazed::Do(), PLFodderLucerne1::Do(), UKPermanentGrass::Do(), FR_Grassland_Perm::Do(), FI_GreenFallow_1year::Do(), UKTempGrass::Do(), DE_GreenFallow_1year::Do(), DE_OGreenFallow_1year::Do(), DE_OPermanentGrassGrazed::Do(), FI_NaturalGrassland_Perm::Do(), DK_CloverGrassGrazed1::Do(), NLGrassGrazed2::Do(), NLPermanentGrassGrazed::Do(), NLGrassGrazed1Spring::Do(), NLGrassGrazedLast::Do(), FI_GreenFallow_Perm::Do(), DE_OGrasslandSilageAnnual::Do(), FI_BufferZone::Do(), FI_BufferZone_Perm::Do(), PTMaize_Hort::Do(), PTMaize::Do(), ITGrassland::Do(), PTFodderMix::Do(), FI_NaturalGrassland::Do(), NLGrassGrazed1::Do(), FI_GrasslandPasturePerennial1::Do(), FI_GrasslandSilagePerennial1::Do(), FI_GrasslandSilagePerennial2::Do(), DK_OSpringFodderGrass::Do(), DK_OCloverGrassGrazed3::Do(), DK_OCloverGrassGrazed1::Do(), DK_OCloverGrassGrazed2::Do(), DK_OWinterFodderGrass::Do(), DK_CloverGrassGrazed3::Do(), DK_OWinterCloverGrassGrazedSown::Do(), DK_CloverGrassGrazed2::Do(), DE_GrasslandSilageAnnual::Do(), FR_Grassland::Do(), IRGrassland_no_reseed::Do(), and IRGrassland_reseed::Do().

◆ CutWeeds()

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

◆ DeepPlough()

◆ DoIt()

bool Farm::DoIt ( double  a_probability)

Return chance out of 0 to 100.

856  {
857  return (g_rand_uni_fnc() < (a_probability/100.0));
858 }

References g_rand_uni_fnc().

Referenced by OrchardCrop::Do(), PermanentGrassTussocky::Do(), WinterRapeStrigling::Do(), DK_GrassTussocky_Perm::Do(), NorwegianSpringBarley::Do(), NorwegianOats::Do(), OSeedGrass1::Do(), BroadBeans::Do(), OSeedGrass2::Do(), PermanentGrassLowYield::Do(), OSBarleySilage::Do(), DK_OGrassLowYield_Perm::Do(), OFieldPeas::Do(), OFieldPeasSilage::Do(), OPermanentGrassGrazed::Do(), SeedGrass1::Do(), OCarrots::Do(), DK_GrassLowYield_Perm::Do(), PermanentGrassGrazed::Do(), OBarleyPeaCloverGrass::Do(), OMaizeSilage::Do(), OWinterBarleyExt::Do(), SeedGrass2::Do(), OWinterBarley::Do(), OWinterRye::Do(), DK_OSpringBarleyCloverGrass::Do(), DE_OMaizeSilage::Do(), DE_OOats::Do(), DK_OptimalFlowerMix3::Do(), OOats::Do(), DE_OSpringRye::Do(), DE_OWinterWheat::Do(), DK_OSpringBarley_CC::Do(), Maize::Do(), MaizeSilage::Do(), MaizeStrigling::Do(), DE_OMaize::Do(), OTriticale::Do(), Oats::Do(), OSpringBarleyExt::Do(), DK_OSpringBarley::Do(), SpringBarleySeed::Do(), OSpringBarley::Do(), SpringBarleyCloverGrassStrigling::Do(), FieldPeas::Do(), FieldPeasSilage::Do(), FieldPeasStrigling::Do(), DummyCropPestTesting::Do(), OPotatoes::Do(), DE_OWinterRape::Do(), OWinterWheat::Do(), OWinterWheatUndersownExt::Do(), OWinterWheatUndersown::Do(), SpringBarleyCloverGrass::Do(), OFodderBeet::Do(), OWinterRape::Do(), PLFodderLucerne2::Do(), Triticale::Do(), Carrots::Do(), DE_OSugarBeet::Do(), SpringBarleyPeaCloverGrassStrigling::Do(), DE_OPotatoes::Do(), SetAside::Do(), PotatoesIndustry::Do(), SugarBeet::Do(), Potatoes::Do(), FodderBeet::Do(), DKOBroadBeans_test::Do(), NorwegianPotatoes::Do(), SpringBarleySKManagement::Do(), PLCarrots::Do(), PTSetAside::Do(), SpringBarleySilage::Do(), WinterRyeStrigling::Do(), SpringBarleySpr::Do(), SpringBarleyStriglingCulm::Do(), DE_PermanentGrassLowYield::Do(), SpringBarleyPTreatment::Do(), DE_OPermanentGrassLowYield::Do(), WinterRye::Do(), SpringBarleyStriglingSingle::Do(), SpringBarleyStrigling::Do(), PLSpringBarleySpr::Do(), FI_OCaraway2::Do(), SpringBarley::Do(), PLFodderLucerne1::Do(), DE_GreenFallow_1year::Do(), FI_GreenFallow_1year::Do(), FI_NaturalGrassland_Perm::Do(), FI_Caraway2::Do(), SpringRape::Do(), DE_OGreenFallow_1year::Do(), PLBeetSpr::Do(), PLBeans::Do(), WinterWheatStrigling::Do(), WinterWheatStriglingCulm::Do(), WinterWheatStriglingSingle::Do(), FI_GreenFallow_Perm::Do(), DE_OGrasslandSilageAnnual::Do(), FI_BufferZone::Do(), FI_BufferZone_Perm::Do(), FI_NaturalGrassland::Do(), FI_OSpringBarley_Malt::Do(), DK_SetAside::Do(), DK_OSetAside_PerennialFlower::Do(), DK_OSetAside_SummerMow::Do(), WinterBarleyStrigling::Do(), WinterRape::Do(), DK_OSetAside::Do(), FI_OCaraway1::Do(), FI_OFabaBean::Do(), FR_SpringBarley::Do(), FI_OSpringRape::Do(), FI_OSpringWheat::Do(), FI_OTurnipRape::Do(), OSpringBarleyPigs::Do(), FI_OSpringOats::Do(), DK_SetAside_SummerMow::Do(), FI_GrasslandPasturePerennial1::Do(), FI_GrasslandPasturePerennial2::Do(), FI_GrasslandSilagePerennial1::Do(), FR_SpringOats::Do(), FI_OSpringBarley_Fodder::Do(), WinterBarley::Do(), PLWinterRye::Do(), FI_FeedingGround::Do(), FI_GrasslandSilagePerennial2::Do(), FI_TurnipRape::Do(), FR_Sorghum::Do(), DK_OSpringFodderGrass::Do(), FI_GrasslandSilageAnnual::Do(), DK_OCloverGrassGrazed3::Do(), FR_Maize_Silage::Do(), FR_Maize::Do(), DK_OCloverGrassGrazed1::Do(), DK_OCloverGrassGrazed2::Do(), PLMaizeSilage::Do(), PLSpringBarley::Do(), PLMaize::Do(), FI_FabaBean::Do(), FI_OWinterRye::Do(), FR_WinterTriticale::Do(), FI_SpringRape::Do(), FI_Caraway1::Do(), PLWinterTriticale::Do(), FR_Sunflower::Do(), FI_SpringBarley_Malt::Do(), SE_SpringBarley::Do(), DE_OWinterRye::Do(), FI_OWinterWheat::Do(), DE_OTriticale::Do(), DE_WinterRye::Do(), DK_OWinterFodderGrass::Do(), PLBeet::Do(), FI_SprSpringBarley_Fodder::Do(), DE_OWinterBarley::Do(), FI_SpringWheat::Do(), DK_OWinterCloverGrassGrazedSown::Do(), PLWinterBarley::Do(), FI_SpringOats::Do(), PLWinterWheatLate::Do(), PLSpringWheat::Do(), SE_WinterRape_Seed::Do(), FI_SpringBarley_Fodder::Do(), PLPotatoes::Do(), SE_WinterWheat::Do(), FR_SpringWheat::Do(), DE_WinterBarley::Do(), PLWinterRape::Do(), DE_GrasslandSilageAnnual::Do(), FI_WinterWheat::Do(), FR_WinterBarley::Do(), FR_Grassland::Do(), DE_Triticale::Do(), DE_WinterWheat::Do(), FI_WinterRye::Do(), DE_WinterWheatLate::Do(), FR_WinterWheat::Do(), FR_Potatoes::Do(), FR_WinterRape::Do(), DE_WinterRape::Do(), WinterWheat::Do(), DE_SugarBeet::Do(), DE_Potatoes::Do(), DE_PotatoesIndustry::Do(), DK_OChristmasTrees_Perm::Do(), DK_ChristmasTrees_Perm::Do(), WinterRape::HerbiZero(), SpringRape::RowcolOne(), and WinterRape::RowcolOne().

◆ DoIt_prob()

bool Farm::DoIt_prob ( double  a_probability)

Return chance out of 0 to 1.

864  {
865  return (g_rand_uni_fnc() < a_probability);
866 }

References g_rand_uni_fnc().

Referenced by UKMaize::Do(), BECatchPeaCrop::Do(), DK_OLegume::Do(), DE_OPeas::Do(), DK_OCatchCrop::Do(), DK_CerealLegume::Do(), DK_CerealLegume_Whole::Do(), DK_Legume_Peas::Do(), DK_SpringBarley_Green::Do(), FI_OPotato_North::Do(), FI_OPotato_South::Do(), FI_OPotatoIndustry_North::Do(), FI_OPotatoIndustry_South::Do(), FI_OStarchPotato_North::Do(), FI_OStarchPotato_South::Do(), DK_OLegume_Peas_CC::Do(), DE_OLegume::Do(), DK_SpringBarleySilage::Do(), DK_OLegume_Beans::Do(), DK_OLegume_Beans_CC::Do(), DK_OLegume_Peas::Do(), DK_OLentils::Do(), BEOrchardCrop::Do(), DK_CatchCrop::Do(), DK_MaizeSilage::Do(), DK_FodderBeet::Do(), DK_OLupines::Do(), NLOrchardCrop::Do(), DK_OSpringBarleyCloverGrass::Do(), DK_OWinterRye::Do(), DK_Legume_Beans::Do(), DK_SpringOats::Do(), DK_SpringOats_CC::Do(), DK_SugarBeet::Do(), FI_SugarBeet::Do(), DE_OMaizeSilage::Do(), DK_OWinterRye_CC::Do(), DE_OWinterWheat::Do(), DK_OCerealLegume_Whole::Do(), DK_OLegume_Whole_CC::Do(), DK_OLegume_Whole::Do(), DK_OLegumeCloverGrass_Whole::Do(), DE_OMaize::Do(), DK_OptimalFlowerMix1::Do(), DK_OSpringBarley_CC::Do(), UKBeans::Do(), DK_Maize::Do(), DK_SpringWheat::Do(), NLMaizeSpring::Do(), DK_OWinterBarley::Do(), DK_Legume_Whole::Do(), DK_OCerealLegume::Do(), DK_OSpringBarley::Do(), DK_OSugarBeet::Do(), DK_OFodderBeet::Do(), FI_Potato_North::Do(), FI_StarchPotato_North::Do(), FI_PotatoIndustry_North::Do(), UKBeet::Do(), BEMaize::Do(), FI_Potato_South::Do(), FI_PotatoIndustry_South::Do(), FI_StarchPotato_South::Do(), DK_OSpringOats::Do(), DK_OSpringWheat::Do(), DK_SpringBarleyCloverGrass::Do(), DE_OSugarBeet::Do(), DE_OCabbages::Do(), NLBeetSpring::Do(), NLMaize::Do(), DK_OVegSeeds::Do(), UKSpringBarley::Do(), UKWinterBarley::Do(), DK_WinterFodderGrass::Do(), DE_OBushFruitPerm::Do(), DK_OSpringOats_CC::Do(), DK_OWinterRape::Do(), DE_OPotatoes::Do(), DK_SpringBarley::Do(), DK_SpringBarley_CC::Do(), DK_OMaize::Do(), DK_OMaizeSilage::Do(), NLCarrotsSpring::Do(), DK_OCabbages::Do(), DK_SpringFodderGrass::Do(), DK_WinterCloverGrassGrazedSown::Do(), DK_OEnergyCrop_Perm::Do(), NLBeet::Do(), NLGrassGrazedExtensive2::Do(), NLPermanentGrassGrazedExtensive::Do(), DK_OSpringBarleySilage::Do(), DK_OCarrots::Do(), NLCarrots::Do(), NLGrassGrazedExtensive1Spring::Do(), NLGrassGrazedExtensiveLast::Do(), DK_WinterBarley::Do(), NLCabbageSpring::Do(), BEWinterBarley::Do(), BEWinterBarleyCC::Do(), NLSpringBarleySpring::Do(), BEWinterWheat::Do(), DK_VegSeeds::Do(), BEWinterWheatCC::Do(), DK_EnergyCrop_Perm::Do(), NLGrassGrazedExtensive1::Do(), DK_WinterRye::Do(), DK_WinterRye_CC::Do(), NLCabbage::Do(), DK_Carrots_Spring::Do(), UKWinterWheat::Do(), DK_OGrassGrazed_Perm::Do(), PTSetAside::Do(), DK_Carrots::Do(), UKWinterRape::Do(), DK_GrassGrazed_Perm::Do(), TestCrop::Do(), NLSpringBarley::Do(), DK_Cabbages::Do(), DK_OMixedVeg::Do(), NLWinterWheat::Do(), DK_WinterWheat::Do(), DK_WinterWheat_CC::Do(), DE_PermanentGrassGrazed::Do(), DK_OPotato::Do(), PTCabbage_Hort::Do(), DK_OPotatoIndustry::Do(), DK_OPotatoSeed::Do(), DK_Potato::Do(), UKPermanentGrass::Do(), FR_Grassland_Perm::Do(), UKPotatoes::Do(), UKTempGrass::Do(), PTOliveGroveTraditional::Do(), DK_OBushFruit_Perm2::Do(), PTOats::Do(), DK_OSeedGrassRye_Spring::Do(), DE_HerbsPerennial_after1year::Do(), DE_OPermanentGrassGrazed::Do(), DE_HerbsPerennial_1year::Do(), DK_MixedVeg::Do(), DE_OHerbsPerennial_after1year::Do(), DK_CloverGrassGrazed1::Do(), NLPermanentGrassGrazed::Do(), NLGrassGrazed2::Do(), NLGrassGrazed1Spring::Do(), DE_OHerbsPerennial_1year::Do(), NLGrassGrazedLast::Do(), PTWinterWheat::Do(), FI_BufferZone::Do(), FI_BufferZone_Perm::Do(), DE_OGrasslandSilageAnnual::Do(), PTWinterRye::Do(), PTMaize_Hort::Do(), PTWinterBarley::Do(), PTFodderMix::Do(), DK_SetAside::Do(), DK_WinterRape::Do(), FI_NaturalGrassland::Do(), PTTriticale::Do(), ITGrassland::Do(), PTCloverGrassGrazed2::Do(), DK_PotatoSeed::Do(), DK_OSetAside_AnnualFlower::Do(), BEPotatoesSpring::Do(), DK_OSetAside_PerennialFlower::Do(), PTGrassGrazed::Do(), PTYellowLupin::Do(), NLGrassGrazed1::Do(), DE_Maize::Do(), DE_BushFruitPerm::Do(), DK_PotatoIndustry::Do(), DK_SetAside_SummerMow::Do(), DE_MaizeSilage::Do(), DE_OAsparagusEstablishedPlantation::Do(), FR_SpringBarley::Do(), NLPotatoesSpring::Do(), FR_SpringOats::Do(), FI_GrasslandSilagePerennial2::Do(), DE_SpringBarley::Do(), DK_OOrchCherry::Do(), DK_OSpringFodderGrass::Do(), DK_OBushFruit_Perm1::Do(), FI_GrasslandSilageAnnual::Do(), FR_Sorghum::Do(), BEPotatoes::Do(), DK_OWinterWheat_CC::Do(), FR_Maize_Silage::Do(), DK_OCloverGrassGrazed3::Do(), DE_AsparagusEstablishedPlantation::Do(), FR_Maize::Do(), DK_OWinterWheat::Do(), DK_OCloverGrassGrazed2::Do(), NLPotatoes::Do(), DK_OCloverGrassGrazed1::Do(), FR_WinterTriticale::Do(), FI_SpringRape::Do(), NLTulips::Do(), DE_Peas::Do(), DE_Legumes::Do(), FR_Sunflower::Do(), PTCloverGrassGrazed1::Do(), FI_Caraway1::Do(), DE_OWinterRye::Do(), DE_OTriticale::Do(), FI_OWinterWheat::Do(), DE_WinterRye::Do(), DK_OOrchPear::Do(), DK_OWinterFodderGrass::Do(), DE_OWinterBarley::Do(), DK_CloverGrassGrazed3::Do(), DK_OOrchOther::Do(), PLWinterWheat::Do(), DK_OOrchApple::Do(), DK_OOrchardCrop_Perm::Do(), DK_OWinterCloverGrassGrazedSown::Do(), DE_Carrots::Do(), DK_CloverGrassGrazed2::Do(), PLWinterWheatLate::Do(), DK_BushFruit_Perm1::Do(), PTPermanentGrassGrazed::Do(), PLPotatoes::Do(), SE_WinterRape_Seed::Do(), FI_SpringBarley_Fodder::Do(), DE_Oats::Do(), SE_WinterWheat::Do(), DE_Cabbage::Do(), FR_SpringWheat::Do(), DE_WinterBarley::Do(), DE_SpringRye::Do(), DK_SeedGrassRye_Spring::Do(), PLWinterRape::Do(), FR_WinterBarley::Do(), FI_WinterWheat::Do(), DK_BushFruit_Perm2::Do(), IRSpringOats::Do(), IRWinterBarley::Do(), FR_Grassland::Do(), IRWinterOats::Do(), IRSpringBarley::Do(), IRSpringWheat::Do(), DE_Triticale::Do(), DE_WinterWheat::Do(), DE_WinterWheatLate::Do(), FR_WinterWheat::Do(), IRWinterWheat::Do(), FR_Potatoes::Do(), FR_WinterRape::Do(), DE_WinterRape::Do(), DE_Orchard::Do(), DK_SeedGrassFescue_Spring::Do(), DE_SugarBeet::Do(), DK_OrchCherry::Do(), IRGrassland_no_reseed::Do(), DE_Potatoes::Do(), DK_OrchPear::Do(), DK_OrchOther::Do(), DK_OrchApple::Do(), DK_OrchardCrop_Perm::Do(), DE_PotatoesIndustry::Do(), DE_OOrchard::Do(), IRGrassland_reseed::Do(), ITOrchard::Do(), DK_OChristmasTrees_Perm::Do(), ITOOrchard::Do(), and DK_ChristmasTrees_Perm::Do().

◆ 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.

1082 {
1083  FarmToDo treatment = fa_ammoniumsulphate;
1084  if ((0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
1085  SetFunctionData(a_field, 1.0, 1.0, EL_TRAMLINE_DECAYTIME, treatment);
1086  return true;
1087  }
1088  return false;
1089 }

References DO_IT_PROB, EL_TRAMLINE_DECAYTIME, fa_ammoniumsulphate, g_weather, and Weather::Raining().

Referenced by UKMaize::Do(), DK_SpringOats::Do(), DK_SpringOats_CC::Do(), DK_SpringWheat::Do(), NLMaizeSpring::Do(), UKBeet::Do(), NLBeetSpring::Do(), NLMaize::Do(), UKSpringBarley::Do(), UKWinterBarley::Do(), NLCarrotsSpring::Do(), DK_OWinterRape::Do(), NLBeet::Do(), NLCarrots::Do(), NLCabbageSpring::Do(), NLSpringBarleySpring::Do(), DK_WinterBarley::Do(), NLCabbage::Do(), UKWinterWheat::Do(), WinterRyeStrigling::Do(), PLCarrots::Do(), UKWinterRape::Do(), WinterRye::Do(), NLSpringBarley::Do(), NLWinterWheat::Do(), PLSpringBarleySpr::Do(), DK_WinterWheat::Do(), DK_WinterWheat_CC::Do(), UKPotatoes::Do(), PLBeetSpr::Do(), PLBeans::Do(), DK_WinterRape::Do(), DE_Maize::Do(), DE_MaizeSilage::Do(), NLPotatoesSpring::Do(), DE_SpringBarley::Do(), PLWinterRye::Do(), PLSpringBarley::Do(), NLPotatoes::Do(), PLMaize::Do(), PLMaizeSilage::Do(), NLTulips::Do(), PLWinterTriticale::Do(), DE_WinterRye::Do(), PLBeet::Do(), PLWinterBarley::Do(), PLWinterWheat::Do(), DE_Carrots::Do(), PLWinterWheatLate::Do(), PLSpringWheat::Do(), PLPotatoes::Do(), DE_Oats::Do(), DE_Cabbage::Do(), DE_WinterBarley::Do(), DK_SeedGrassRye_Spring::Do(), DE_SpringRye::Do(), PLWinterRape::Do(), IRSpringOats::Do(), IRWinterOats::Do(), IRWinterBarley::Do(), IRSpringBarley::Do(), DE_Triticale::Do(), DE_WinterWheat::Do(), DE_WinterWheatLate::Do(), IRSpringWheat::Do(), IRWinterWheat::Do(), DE_WinterRape::Do(), DE_Orchard::Do(), DK_SeedGrassFescue_Spring::Do(), DE_SugarBeet::Do(), DE_Potatoes::Do(), and DE_PotatoesIndustry::Do().

◆ FA_Boron()

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

◆ FA_Calcium()

◆ FA_Cu()

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

Apply Cu fertilizer, on a_field owned by stock farmer (orchard)

1989 {
1990  FarmToDo treatment = fa_cu;
1991  if ((0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
1992  SetFunctionData(a_field, 1.0, 1.0, 0, treatment);
1993  return true;
1994  }
1995  return false;
1996 }

References DO_IT_PROB, fa_cu, g_weather, and Weather::Raining().

Referenced by DK_OOrchApple::Do(), DK_OOrchardCrop_Perm::Do(), DK_OOrchOther::Do(), DK_OrchApple::Do(), DK_OrchardCrop_Perm::Do(), and DK_OrchOther::Do().

◆ 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.

1126 {
1127  FarmToDo treatment = fa_greenmanure;
1128  if ((0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
1129  SetFunctionData(a_field, 1.0, 1.0, EL_TRAMLINE_DECAYTIME, treatment);
1130  return true;
1131  }
1132  return false;
1133 }

References DO_IT_PROB, EL_TRAMLINE_DECAYTIME, fa_greenmanure, g_weather, and Weather::Raining().

◆ FA_K()

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

Apply K fertilizer, on a_field owned by stock farmer.

1039 {
1040  FarmToDo treatment = fa_k;
1041  if ((0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
1042  SetFunctionData(a_field, 1.0, 1.0, EL_TRAMLINE_DECAYTIME, treatment);
1043  return true;
1044  }
1045  return false;
1046 }

References DO_IT_PROB, EL_TRAMLINE_DECAYTIME, fa_k, g_weather, and Weather::Raining().

Referenced by DE_WinterWheatLate::Do(), and DE_WinterRape::Do().

◆ FA_ManganeseSulphate()

◆ 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.

1111 {
1112  FarmToDo treatment = fa_manure;
1113  if ((0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
1114  SetFunctionData(a_field, 1.0, 1.0, EL_TRAMLINE_DECAYTIME, treatment);
1115  return true;
1116  }
1117  return false;
1118 }

References DO_IT_PROB, EL_TRAMLINE_DECAYTIME, fa_manure, g_weather, and Weather::Raining().

Referenced by WinterRapeStrigling::Do(), OSBarleySilage::Do(), NLCatchCropPea::Do(), OBarleyPeaCloverGrass::Do(), OMaizeSilage::Do(), OWinterBarleyExt::Do(), OWinterBarley::Do(), OWinterRye::Do(), DE_OSpringRye::Do(), DE_OOats::Do(), DE_OMaizeSilage::Do(), OOats::Do(), DE_OWinterWheat::Do(), OTriticale::Do(), DE_OMaize::Do(), Maize::Do(), DK_OCerealLegume_Whole::Do(), MaizeStrigling::Do(), MaizeSilage::Do(), OSpringBarleyExt::Do(), Oats::Do(), DK_Legume_Whole::Do(), DK_OSugarBeet::Do(), DK_OCerealLegume::Do(), OSpringBarley::Do(), SpringBarleyCloverGrassStrigling::Do(), FieldPeas::Do(), FieldPeasSilage::Do(), FieldPeasStrigling::Do(), DK_OFodderBeet::Do(), OPotatoes::Do(), DE_OWinterRape::Do(), OWinterWheat::Do(), OWinterWheatUndersown::Do(), OWinterWheatUndersownExt::Do(), SpringBarleyCloverGrass::Do(), OFodderBeet::Do(), OWinterRape::Do(), Triticale::Do(), DE_OSugarBeet::Do(), DE_OPotatoes::Do(), SpringBarleyPeaCloverGrassStrigling::Do(), DE_OCarrots::Do(), DK_OCarrots::Do(), FodderBeet::Do(), SpringBarleySKManagement::Do(), WinterRyeStrigling::Do(), SpringBarleySilage::Do(), DK_OGrassGrazed_Perm::Do(), SpringBarleyStriglingCulm::Do(), DK_GrassGrazed_Perm::Do(), SpringBarleyStrigling::Do(), SpringBarleyStriglingSingle::Do(), WinterRye::Do(), SpringBarleyPTreatment::Do(), DK_OMixedVeg::Do(), DE_PermanentGrassGrazed::Do(), PTCabbage::Do(), PTCabbage_Hort::Do(), SpringBarley::Do(), PTHorticulture::Do(), PTPotatoes::Do(), SpringRape::Do(), DK_OBushFruit_Perm2::Do(), WinterWheatStriglingSingle::Do(), WinterWheatStrigling::Do(), WinterWheatStriglingCulm::Do(), WinterRape::Do(), WinterBarleyStrigling::Do(), DE_OAsparagusEstablishedPlantation::Do(), WinterBarley::Do(), DK_OOrchCherry::Do(), DK_OSpringFodderGrass::Do(), DE_AsparagusEstablishedPlantation::Do(), DK_OCloverGrassGrazed3::Do(), DK_OCloverGrassGrazed1::Do(), DK_OCloverGrassGrazed2::Do(), NLTulips::Do(), DK_OOrchPear::Do(), DK_OWinterFodderGrass::Do(), DE_OTriticale::Do(), DE_OWinterRye::Do(), DK_OOrchApple::Do(), DK_OOrchardCrop_Perm::Do(), DE_OWinterBarley::Do(), DK_OOrchOther::Do(), DK_OWinterCloverGrassGrazedSown::Do(), DE_Triticale::Do(), DE_Orchard::Do(), WinterWheat::Do(), DK_OrchCherry::Do(), DK_OrchPear::Do(), DK_OrchardCrop_Perm::Do(), DK_OrchOther::Do(), DK_OrchApple::Do(), DE_OOrchard::Do(), DK_OChristmasTrees_Perm::Do(), and DK_ChristmasTrees_Perm::Do().

◆ FA_N()

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

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

714 {
715  if ((0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
716  SetFunctionData(a_field, 1.0, 1.0, EL_TRAMLINE_DECAYTIME, fa_n);
717  return true;
718  }
719  return false;
720 }

References DO_IT_PROB, EL_TRAMLINE_DECAYTIME, fa_n, g_weather, and Weather::Raining().

Referenced by DE_HerbsPerennial_after1year::Do(), DE_HerbsPerennial_1year::Do(), DE_OHerbsPerennial_after1year::Do(), DE_OHerbsPerennial_1year::Do(), DE_OAsparagusEstablishedPlantation::Do(), DE_AsparagusEstablishedPlantation::Do(), and DK_BushFruit_Perm1::Do().

◆ FA_NK()

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

Apply NK fertilizer, on a_field owned by an stock farmer.

780 {
781 
782  if ((0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
783  SetFunctionData(a_field, 1.0, 1.0, EL_TRAMLINE_DECAYTIME, fa_nk);
784  return true;
785  }
786  return false;
787 }

References DO_IT_PROB, EL_TRAMLINE_DECAYTIME, fa_nk, g_weather, and Weather::Raining().

Referenced by DK_OBushFruit_Perm1::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.

983 {
984  FarmToDo treatment = fa_npk;
985  if ((0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
986  SetFunctionData(a_field, 1.0, 1.0, EL_TRAMLINE_DECAYTIME, treatment);
987  return true;
988  }
989  return false;
990 }

References DO_IT_PROB, EL_TRAMLINE_DECAYTIME, fa_npk, g_weather, and Weather::Raining().

Referenced by OMaizeSilage::Do(), PermanentGrassGrazed::Do(), Maize::Do(), OTriticale::Do(), MaizeSilage::Do(), MaizeStrigling::Do(), SpringBarleyCloverGrassStrigling::Do(), OFodderBeet::Do(), SpringBarleyCloverGrass::Do(), Triticale::Do(), UKBeet::Do(), Carrots::Do(), NLBeetSpring::Do(), DE_OBushFruitPerm::Do(), DK_WinterFodderGrass::Do(), UKSpringBarley::Do(), SpringBarleyPeaCloverGrassStrigling::Do(), NLCarrotsSpring::Do(), NLPermanentGrassGrazedExtensive::Do(), NLGrassGrazedExtensive2::Do(), DK_SpringFodderGrass::Do(), NLBeet::Do(), DK_WinterCloverGrassGrazedSown::Do(), NLGrassGrazedExtensiveLast::Do(), NLCarrots::Do(), NLGrassGrazedExtensive1Spring::Do(), NLSpringBarleySpring::Do(), PotatoesIndustry::Do(), DK_WinterBarley::Do(), NLCabbageSpring::Do(), SugarBeet::Do(), FodderBeet::Do(), NorwegianPotatoes::Do(), Potatoes::Do(), DK_WinterRye_CC::Do(), NLCabbage::Do(), SpringBarleySKManagement::Do(), DK_Carrots_Spring::Do(), NLGrassGrazedExtensive1::Do(), DK_WinterRye::Do(), PLCarrots::Do(), SpringBarleySilage::Do(), SpringBarleySpr::Do(), DK_Carrots::Do(), NLSpringBarley::Do(), SpringBarleyStriglingSingle::Do(), SpringBarleyPTreatment::Do(), SpringBarleyStrigling::Do(), UKWinterRape::Do(), SpringBarleyStriglingCulm::Do(), PLSpringBarleySpr::Do(), PTBeans::Do(), DK_OPotato::Do(), DK_WinterWheat::Do(), DK_WinterWheat_CC::Do(), DK_OPotatoSeed::Do(), DK_OPotatoIndustry::Do(), PTCabbage::Do(), PTCabbage_Hort::Do(), PTOtherDryBeans::Do(), SpringBarley::Do(), PLFodderLucerne1::Do(), PTHorticulture::Do(), DK_Potato::Do(), UKPermanentGrass::Do(), UKPotatoes::Do(), UKTempGrass::Do(), PTPotatoes::Do(), DK_OSeedGrassRye_Spring::Do(), PTOats::Do(), NLPermanentGrassGrazed::Do(), NLGrassGrazed2::Do(), WinterWheatStriglingCulm::Do(), NLGrassGrazedLast::Do(), FI_GreenFallow_Perm::Do(), NLGrassGrazed1Spring::Do(), WinterWheatStriglingSingle::Do(), WinterWheatStrigling::Do(), PTWinterWheat::Do(), FI_BufferZone::Do(), FI_BufferZone_Perm::Do(), PTMaize::Do(), PTWinterBarley::Do(), PTWinterRye::Do(), PTMaize_Hort::Do(), FI_NaturalGrassland::Do(), PTFodderMix::Do(), PTCloverGrassGrazed2::Do(), PTTriticale::Do(), ITGrassland::Do(), PTGrassGrazed::Do(), PTSorghum::Do(), PTYellowLupin::Do(), WinterBarleyStrigling::Do(), DK_PotatoSeed::Do(), DE_BushFruitPerm::Do(), NLGrassGrazed1::Do(), FI_GrasslandPasturePerennial2::Do(), DK_PotatoIndustry::Do(), WinterBarley::Do(), PTRyegrass::Do(), NLPotatoesSpring::Do(), FI_GrasslandSilagePerennial2::Do(), DK_OBushFruit_Perm1::Do(), NLPotatoes::Do(), PLSpringBarley::Do(), PTCloverGrassGrazed1::Do(), DE_Carrots::Do(), PTPermanentGrassGrazed::Do(), DK_BushFruit_Perm1::Do(), DE_Cabbage::Do(), DE_Oats::Do(), DE_SpringRye::Do(), DE_GrasslandSilageAnnual::Do(), DK_BushFruit_Perm2::Do(), IRSpringOats::Do(), IRSpringBarley::Do(), IRSpringWheat::Do(), DE_WinterRape::Do(), DE_Orchard::Do(), DK_SeedGrassFescue_Spring::Do(), WinterWheat::Do(), IRGrassland_no_reseed::Do(), DE_OOrchard::Do(), IRGrassland_reseed::Do(), ITOrchard::Do(), DK_OChristmasTrees_Perm::Do(), ITOOrchard::Do(), and DK_ChristmasTrees_Perm::Do().

◆ FA_NPKS()

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

◆ FA_P()

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

Apply P fertilizer, on a_field owned by stock farmer.

1025 {
1026  FarmToDo treatment = fa_p;
1027  if ((0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
1028  SetFunctionData(a_field, 1.0, 1.0, EL_TRAMLINE_DECAYTIME, treatment);
1029  return true;
1030  }
1031  return false;
1032 }

References DO_IT_PROB, EL_TRAMLINE_DECAYTIME, fa_p, g_weather, and Weather::Raining().

Referenced by DE_WinterWheatLate::Do().

◆ FA_PK()

◆ FA_PKS()

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

Apply PKS fertilizer to a_field owned by an stock farmer.

997 {
998  FarmToDo treatment = fa_pks;
999  if ((0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
1000  SetFunctionData(a_field, 1.0, 1.0, EL_TRAMLINE_DECAYTIME, treatment);
1001  return true;
1002  }
1003  return false;
1004 }

References DO_IT_PROB, EL_TRAMLINE_DECAYTIME, fa_pks, g_weather, and Weather::Raining().

Referenced by DE_OPeas::Do(), and DE_OLegume::Do().

◆ 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.

1155 {
1156  FarmToDo treatment = fa_rsm;
1157  if ((0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
1158  SetFunctionData(a_field, 1.0, 1.0, EL_TRAMLINE_DECAYTIME, treatment);
1159  return true;
1160  }
1161  return false;
1162 }

References DO_IT_PROB, EL_TRAMLINE_DECAYTIME, fa_rsm, g_weather, and Weather::Raining().

Referenced by PLSpringBarleySpr::Do(), PLWinterRye::Do(), PLMaize::Do(), PLMaizeSilage::Do(), PLSpringBarley::Do(), PLWinterTriticale::Do(), PLWinterWheat::Do(), PLWinterBarley::Do(), PLSpringWheat::Do(), PLWinterWheatLate::Do(), and PLWinterRape::Do().

◆ FA_SK()

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

◆ 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.

1141 {
1142  FarmToDo treatment = fa_sludge;
1143  if ((0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
1144  SetFunctionData(a_field, 1.0, 1.0, EL_TRAMLINE_DECAYTIME, treatment);
1145  return true;
1146  }
1147  return false;
1148 }

References DO_IT_PROB, EL_TRAMLINE_DECAYTIME, fa_sludge, g_weather, and Weather::Raining().

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.

1068 {
1069  FarmToDo treatment = fa_slurry;
1070  if ((0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
1071  SetFunctionData(a_field, 1.0, 1.0, EL_TRAMLINE_DECAYTIME, treatment);
1072  return true;
1073  }
1074  return false;
1075 }

References DO_IT_PROB, EL_TRAMLINE_DECAYTIME, fa_slurry, g_weather, and Weather::Raining().

Referenced by UKMaize::Do(), OSBarleySilage::Do(), NLCatchCropPea::Do(), OPermanentGrassGrazed::Do(), OCarrots::Do(), DK_CerealLegume::Do(), DK_CerealLegume_Whole::Do(), OBarleyPeaCloverGrass::Do(), OMaizeSilage::Do(), DK_SpringBarley_Green::Do(), OWinterBarleyExt::Do(), DK_SpringBarleySilage::Do(), OWinterBarley::Do(), DK_OSpringBarleyCloverGrass::Do(), DK_MaizeSilage::Do(), OWinterRye::Do(), DK_OWinterRye::Do(), DE_OMaizeSilage::Do(), DK_SpringOats::Do(), DK_SpringOats_CC::Do(), OOats::Do(), DK_OSpringBarley_CC::Do(), DK_OWinterRye_CC::Do(), Maize::Do(), MaizeSilage::Do(), DE_OMaize::Do(), MaizeStrigling::Do(), DE_OWinterWheat::Do(), OTriticale::Do(), DK_OWinterBarley::Do(), DK_Maize::Do(), Oats::Do(), DK_SpringWheat::Do(), OSpringBarleyExt::Do(), DK_OSpringBarley::Do(), OSpringBarley::Do(), SpringBarleyCloverGrassStrigling::Do(), OPotatoes::Do(), OWinterWheat::Do(), OWinterWheatUndersown::Do(), OWinterWheatUndersownExt::Do(), SpringBarleyCloverGrass::Do(), OFodderBeet::Do(), DK_OSpringOats::Do(), DK_OSpringWheat::Do(), Triticale::Do(), OWinterRape::Do(), Carrots::Do(), DK_SpringBarleyCloverGrass::Do(), NLMaize::Do(), DE_OCabbages::Do(), DK_OSpringOats_CC::Do(), UKSpringBarley::Do(), UKWinterBarley::Do(), DK_WinterFodderGrass::Do(), SpringBarleyPeaCloverGrassStrigling::Do(), DK_OWinterRape::Do(), DE_OPotatoes::Do(), DK_SpringBarley::Do(), DK_SpringBarley_CC::Do(), DK_OMaize::Do(), DK_OMaizeSilage::Do(), DK_OSpringBarleySilage::Do(), NLGrassGrazedExtensive2::Do(), NLPermanentGrassGrazedExtensive::Do(), DK_SpringFodderGrass::Do(), DK_OEnergyCrop_Perm::Do(), DK_WinterCloverGrassGrazedSown::Do(), NLGrassGrazedExtensive1Spring::Do(), NLGrassGrazedExtensiveLast::Do(), PotatoesIndustry::Do(), SugarBeet::Do(), DK_WinterBarley::Do(), Potatoes::Do(), FodderBeet::Do(), NorwegianPotatoes::Do(), DK_EnergyCrop_Perm::Do(), SpringBarleySKManagement::Do(), NLCabbage::Do(), NLGrassGrazedExtensive1::Do(), DK_WinterRye::Do(), DK_WinterRye_CC::Do(), SpringBarleySilage::Do(), UKWinterWheat::Do(), WinterRyeStrigling::Do(), WinterRye::Do(), SpringBarleyStrigling::Do(), SpringBarleyStriglingSingle::Do(), UKWinterRape::Do(), SpringBarleyPTreatment::Do(), SpringBarleyStriglingCulm::Do(), NLSpringBarley::Do(), NLWinterWheat::Do(), DK_OMixedVeg::Do(), DE_PermanentGrassGrazed::Do(), SpringBarley::Do(), DK_WinterWheat::Do(), DK_WinterWheat_CC::Do(), PLFodderLucerne1::Do(), UKPermanentGrass::Do(), UKPotatoes::Do(), UKTempGrass::Do(), PTOats::Do(), DK_OBushFruit_Perm2::Do(), NLGrassGrazed2::Do(), NLPermanentGrassGrazed::Do(), WinterWheatStriglingSingle::Do(), WinterWheatStrigling::Do(), NLGrassGrazed1Spring::Do(), NLGrassGrazedLast::Do(), WinterWheatStriglingCulm::Do(), FI_GreenFallow_Perm::Do(), PLBeans::Do(), DE_OGrasslandSilageAnnual::Do(), FI_BufferZone_Perm::Do(), PTWinterBarley::Do(), PTWinterRye::Do(), PTWinterWheat::Do(), FI_BufferZone::Do(), FI_NaturalGrassland::Do(), PTTriticale::Do(), DK_WinterRape::Do(), PTYellowLupin::Do(), WinterBarleyStrigling::Do(), FI_OCaraway1::Do(), NLGrassGrazed1::Do(), DE_Maize::Do(), FI_GrasslandPasturePerennial1::Do(), FI_GrasslandSilagePerennial1::Do(), DE_MaizeSilage::Do(), PTRyegrass::Do(), WinterBarley::Do(), FI_OSpringBarley_Fodder::Do(), PLWinterRye::Do(), FI_GrasslandSilagePerennial2::Do(), DK_OOrchCherry::Do(), FI_GrasslandSilageAnnual::Do(), DK_OWinterWheat_CC::Do(), PLMaize::Do(), PLSpringBarley::Do(), NLPotatoes::Do(), PLMaizeSilage::Do(), DK_OWinterWheat::Do(), FI_Caraway1::Do(), FR_Sunflower::Do(), PTCloverGrassGrazed1::Do(), SE_SpringBarley::Do(), PLWinterTriticale::Do(), DE_OTriticale::Do(), DE_OWinterRye::Do(), PLWinterBarley::Do(), FI_SprSpringBarley_Fodder::Do(), PLBeet::Do(), DE_OWinterBarley::Do(), PLWinterWheat::Do(), PLWinterWheatLate::Do(), PLSpringWheat::Do(), PTPermanentGrassGrazed::Do(), FI_SpringBarley_Fodder::Do(), PLPotatoes::Do(), DE_Cabbage::Do(), DE_Oats::Do(), DE_SpringRye::Do(), PLWinterRape::Do(), DE_GrasslandSilageAnnual::Do(), IRWinterOats::Do(), IRWinterBarley::Do(), IRSpringOats::Do(), IRSpringBarley::Do(), IRSpringWheat::Do(), IRWinterWheat::Do(), WinterWheat::Do(), DE_SugarBeet::Do(), DK_OrchCherry::Do(), IRGrassland_no_reseed::Do(), DE_Potatoes::Do(), DE_PotatoesIndustry::Do(), and IRGrassland_reseed::Do().

◆ FarmActions()

void Farm::FarmActions ( void  )
virtual

FarmActions() will use the global date to manage all queued field events.

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

The main crop management events are done in HandleEvents by the crop management method within CropManagement. This calls all the fields and actions any events on the queue. Subsequently there are some checks for runaway or stuck management codes The FarmerBehaviour section allows for implementation of Farmer behaviour - it implements the Step code of the animals populations approach to allow for complex behaviours to be added.

768  {
773  HandleEvents();
774  for ( unsigned int i = 0; i < m_fields.size(); i++ ) {
775  // Check for infinite loop in management plan.
776  int count = m_fields[ i ]->GetVegStore();
777  if ( count >= 0 )
778  m_fields[ i ]->SetVegStore( ++count );
779  if ( count > 800 ) {
780  // More than two years where nothing happened.
781  // Raise 'Merry Christmas'!
782  char error_num[ 20 ];
783  sprintf( error_num, "%d", m_fields[ i ]->GetVegType() );
784  g_msg->Warn( WARN_BUG, "I the Farm Manager caught infinite loop in tov type:", error_num );
785  sprintf( error_num, "%d", m_fields[ i ]->m_tried_to_do );
786  g_msg->Warn( WARN_BUG, "It was last seen trying to perform action # ""(or thereabouts):", error_num );
787  exit( 1 );
788  }
789  }
790 }

References count, g_msg, MapErrorMsg::Warn(), and WARN_BUG.

◆ FarmerActions()

bool Farm::FarmerActions ( void  )

The starting point for farmer behaviour not part of crop management e.g. decision making.

Call farmer behaviour each day.

This is called each day and call the farmer Step method to exhibit behaviour. This is a simplified form of the animal behaviour but could be expanded by adding BeginStep and EndStep. When a farmer is done for the day GetStepDone returns true.

795  {
801  m_OurFarmer->Step();
802  return m_OurFarmer->GetStepDone();
803 }

◆ FiberCovering()

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

Fiber covering applied on a_field.

1767 {
1768  FarmToDo treatment = fiber_covering;
1769  if ((0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
1770  SetFunctionData(a_field, 1.0, 1.0, 0, treatment);
1771  return true;
1772  }
1773  return false;
1774 }

References DO_IT_PROB, fiber_covering, g_weather, and Weather::Raining().

Referenced by DK_MixedVeg::Do(), and DK_BushFruit_Perm1::Do().

◆ FiberRemoval()

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

Fiber covering removed from a_field.

1781 {
1782  FarmToDo treatment = fiber_removal;
1783  if ((0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
1784  SetFunctionData(a_field, 1.0, 1.0, 0, treatment);
1785  return true;
1786  }
1787  return false;
1788 }

References DO_IT_PROB, fiber_removal, g_weather, and Weather::Raining().

Referenced by DK_MixedVeg::Do(), and DK_BushFruit_Perm1::Do().

◆ FlowerCutting()

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

Flower cutting applied on a_field.

1689 {
1690  FarmToDo treatment = flower_cutting;
1691  if ((0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
1692  LE* um = SetFunctionData(a_field, 0.5, 0.8, EL_TRAMLINE_DECAYTIME, treatment);
1693  a_field->SetVegHeight(35);
1694  if (um != nullptr) {
1695  um->SetVegHeight(35);
1696  }
1697  return true;
1698  }
1699  return false;
1700 }

References DO_IT_PROB, EL_TRAMLINE_DECAYTIME, flower_cutting, g_weather, Weather::Raining(), and LE::SetVegHeight().

Referenced by NLTulips::Do().

◆ 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.

883 {
884  FarmToDo treatment = fp_ammoniumsulphate;
885  if ((0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
886  SetFunctionData(a_field, 1.0, 1.0, EL_TRAMLINE_DECAYTIME, treatment);
887  return true;
888  }
889  return false;
890 }

References DO_IT_PROB, EL_TRAMLINE_DECAYTIME, fp_ammoniumsulphate, g_weather, and Weather::Raining().

Referenced by UKMaize::Do(), DK_SpringOats::Do(), DK_SpringOats_CC::Do(), DK_SpringWheat::Do(), NLMaizeSpring::Do(), UKBeet::Do(), NLBeetSpring::Do(), NLMaize::Do(), UKSpringBarley::Do(), UKWinterBarley::Do(), DK_OWinterRape::Do(), NLCarrotsSpring::Do(), NLBeet::Do(), NLCarrots::Do(), NLCabbageSpring::Do(), DK_WinterBarley::Do(), NLSpringBarleySpring::Do(), NLCabbage::Do(), UKWinterWheat::Do(), PLCarrots::Do(), UKWinterRape::Do(), NLSpringBarley::Do(), PLSpringBarleySpr::Do(), NLWinterWheat::Do(), DK_WinterWheat::Do(), DK_WinterWheat_CC::Do(), UKPotatoes::Do(), PLBeetSpr::Do(), PLBeans::Do(), DK_WinterRape::Do(), DE_Maize::Do(), DE_MaizeSilage::Do(), NLPotatoesSpring::Do(), PLWinterRye::Do(), DE_SpringBarley::Do(), NLPotatoes::Do(), PLMaize::Do(), PLMaizeSilage::Do(), PLSpringBarley::Do(), FR_WinterTriticale::Do(), NLTulips::Do(), PLWinterTriticale::Do(), DE_WinterRye::Do(), PLWinterBarley::Do(), PLWinterWheat::Do(), PLBeet::Do(), PLSpringWheat::Do(), PLWinterWheatLate::Do(), DE_Carrots::Do(), PLPotatoes::Do(), FR_SpringWheat::Do(), DE_Cabbage::Do(), DE_Oats::Do(), DE_WinterBarley::Do(), DK_SeedGrassRye_Spring::Do(), DE_SpringRye::Do(), PLWinterRape::Do(), FI_WinterWheat::Do(), FR_WinterBarley::Do(), IRWinterOats::Do(), IRSpringOats::Do(), IRSpringBarley::Do(), IRWinterBarley::Do(), IRSpringWheat::Do(), DE_WinterWheatLate::Do(), DE_Triticale::Do(), DE_WinterWheat::Do(), FI_WinterRye::Do(), FR_WinterWheat::Do(), IRWinterWheat::Do(), FR_Potatoes::Do(), FR_WinterRape::Do(), DE_WinterRape::Do(), DE_Orchard::Do(), DK_SeedGrassFescue_Spring::Do(), DE_SugarBeet::Do(), DE_Potatoes::Do(), and DE_PotatoesIndustry::Do().

◆ FP_Boron()

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

◆ FP_Calcium()

◆ FP_Cu()

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

Apply Cu fertilizer, on a_field owned by plant farmer (orchard)

1975 {
1976  FarmToDo treatment = fp_cu;
1977  if ((0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
1978  SetFunctionData(a_field, 1.0, 1.0, 0, treatment);
1979  return true;
1980  }
1981  return false;
1982 }

References DO_IT_PROB, fp_cu, g_weather, and Weather::Raining().

Referenced by DK_OOrchApple::Do(), DK_OOrchardCrop_Perm::Do(), DK_OOrchOther::Do(), DK_OrchApple::Do(), DK_OrchardCrop_Perm::Do(), and DK_OrchOther::Do().

◆ 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.

912 {
913  FarmToDo treatment = fp_greenmanure;
914  if ((0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
915  SetFunctionData(a_field, 1.0, 1.0, EL_TRAMLINE_DECAYTIME, treatment);
916  return true;
917  }
918  return false;
919 }

References DO_IT_PROB, EL_TRAMLINE_DECAYTIME, fp_greenmanure, g_weather, and Weather::Raining().

◆ FP_K()

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

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

727 {
728  if ((0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
729  SetFunctionData(a_field, 1.0, 1.0, EL_TRAMLINE_DECAYTIME, fp_k);
730  return true;
731  }
732  return false;
733 }

References DO_IT_PROB, EL_TRAMLINE_DECAYTIME, fp_k, g_weather, and Weather::Raining().

Referenced by DE_WinterWheatLate::Do(), and DE_WinterRape::Do().

◆ 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.

809 {
810  FarmToDo treatment = fp_liquidNH3;
811  if ( (0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
812  SetFunctionData(a_field, 1.0, 1.0, EL_TRAMLINE_DECAYTIME, treatment);
813  return true;
814  }
815  return false;
816 }

References DO_IT_PROB, EL_TRAMLINE_DECAYTIME, fp_liquidNH3, g_weather, and Weather::Raining().

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

◆ 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.

897 {
898  FarmToDo treatment = fp_manure;
899  if ((0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
900  SetFunctionData(a_field, 1.0, 1.0, EL_TRAMLINE_DECAYTIME, treatment);
901  return true;
902  }
903  return false;
904 }

References DO_IT_PROB, EL_TRAMLINE_DECAYTIME, fp_manure, g_weather, and Weather::Raining().

Referenced by NLCatchCropPea::Do(), OWinterBarleyExt::Do(), OWinterBarley::Do(), OWinterRye::Do(), DE_OMaizeSilage::Do(), DE_OMaize::Do(), DK_OCerealLegume_Whole::Do(), DE_OWinterWheat::Do(), OSpringBarleyExt::Do(), DK_Legume_Whole::Do(), DK_OSugarBeet::Do(), DK_OCerealLegume::Do(), OSpringBarley::Do(), FieldPeas::Do(), FieldPeasSilage::Do(), FieldPeasStrigling::Do(), DK_OFodderBeet::Do(), OPotatoes::Do(), DE_OWinterRape::Do(), OWinterWheat::Do(), OWinterWheatUndersown::Do(), OWinterWheatUndersownExt::Do(), OWinterRape::Do(), DE_OSugarBeet::Do(), DE_OPotatoes::Do(), DE_OCarrots::Do(), DK_OCarrots::Do(), DK_OGrassGrazed_Perm::Do(), DK_Cabbages::Do(), DK_GrassGrazed_Perm::Do(), DK_OMixedVeg::Do(), PTCabbage::Do(), PTCabbage_Hort::Do(), DE_PermanentGrassGrazed::Do(), PTHorticulture::Do(), PTPotatoes::Do(), DK_OBushFruit_Perm2::Do(), FR_SpringBarley::Do(), DE_OAsparagusEstablishedPlantation::Do(), FR_SpringOats::Do(), DK_OOrchCherry::Do(), DK_OSpringFodderGrass::Do(), DE_AsparagusEstablishedPlantation::Do(), FR_Maize::Do(), FR_Maize_Silage::Do(), DK_OCloverGrassGrazed3::Do(), DK_OCloverGrassGrazed1::Do(), DK_OCloverGrassGrazed2::Do(), NLTulips::Do(), SE_SpringBarley::Do(), FR_Sunflower::Do(), DE_OWinterRye::Do(), DK_OOrchPear::Do(), DE_OTriticale::Do(), DK_OWinterFodderGrass::Do(), DK_OWinterCloverGrassGrazedSown::Do(), DK_OOrchardCrop_Perm::Do(), DK_OOrchOther::Do(), DE_OWinterBarley::Do(), DK_OOrchApple::Do(), FR_SpringWheat::Do(), DE_Triticale::Do(), FR_Potatoes::Do(), DE_Orchard::Do(), DK_OrchCherry::Do(), DK_OrchPear::Do(), DK_OrchOther::Do(), DK_OrchApple::Do(), DK_OrchardCrop_Perm::Do(), DE_OOrchard::Do(), DK_OChristmasTrees_Perm::Do(), and DK_ChristmasTrees_Perm::Do().

◆ FP_N()

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

◆ FP_NC()

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

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

754 {
755  if ((0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
756  SetFunctionData(a_field, 1.0, 1.0, EL_TRAMLINE_DECAYTIME, fp_nc);
757  return true;
758  }
759  return false;
760 }

References DO_IT_PROB, EL_TRAMLINE_DECAYTIME, fp_nc, g_weather, and Weather::Raining().

Referenced by FR_SpringWheat::Do(), and SE_WinterWheat::Do().

◆ FP_NK()

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

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

767 {
768  if ((0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
769  SetFunctionData(a_field, 1.0, 1.0, EL_TRAMLINE_DECAYTIME, fp_nk);
770  return true;
771  }
772  return false;
773 }

References DO_IT_PROB, EL_TRAMLINE_DECAYTIME, fp_nk, g_weather, and Weather::Raining().

Referenced by FI_OCaraway2::Do(), FI_Caraway2::Do(), and DK_OBushFruit_Perm1::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.

646 {
647  FarmToDo treatment = fp_npk;
648  if ( (0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
649  SetFunctionData(a_field, 1.0, 1.0, EL_TRAMLINE_DECAYTIME, treatment);
650  return true;
651  }
652  return false;
653 }

References DO_IT_PROB, EL_TRAMLINE_DECAYTIME, fp_npk, g_weather, and Weather::Raining().

Referenced by OSeedGrass1::Do(), OSeedGrass2::Do(), SeedGrass1::Do(), PermanentGrassGrazed::Do(), SeedGrass2::Do(), FI_SugarBeet::Do(), SpringBarleySeed::Do(), UKBeet::Do(), Carrots::Do(), NLBeetSpring::Do(), DK_WinterFodderGrass::Do(), UKSpringBarley::Do(), DE_OBushFruitPerm::Do(), NLCarrotsSpring::Do(), DK_SpringFodderGrass::Do(), DK_WinterCloverGrassGrazedSown::Do(), NLGrassGrazedExtensive2::Do(), NLPermanentGrassGrazedExtensive::Do(), DK_OEnergyCrop_Perm::Do(), NLBeet::Do(), NLCarrots::Do(), NLGrassGrazedExtensive1Spring::Do(), NLGrassGrazedExtensiveLast::Do(), NLCabbageSpring::Do(), DK_WinterBarley::Do(), NLSpringBarleySpring::Do(), PotatoesIndustry::Do(), NorwegianPotatoes::Do(), Potatoes::Do(), PTOliveGroveIntensive::Do(), DK_EnergyCrop_Perm::Do(), NLGrassGrazedExtensive1::Do(), DK_Carrots_Spring::Do(), DK_WinterRye::Do(), DK_WinterRye_CC::Do(), NLCabbage::Do(), SpringBarleySKManagement::Do(), WinterRyeStrigling::Do(), PLCarrots::Do(), SpringBarleySilage::Do(), DK_Carrots::Do(), SpringBarleySpr::Do(), SpringBarleyStriglingSingle::Do(), UKWinterRape::Do(), WinterRye::Do(), SpringBarleyStriglingCulm::Do(), NLSpringBarley::Do(), SpringBarleyPTreatment::Do(), SpringBarleyStrigling::Do(), PLSpringBarleySpr::Do(), PTBeans::Do(), PTOliveGroveSuperIntensive::Do(), DK_WinterWheat::Do(), DK_WinterWheat_CC::Do(), DK_OPotato::Do(), FI_OCaraway2::Do(), PTCabbage::Do(), PTCabbage_Hort::Do(), DK_OPotatoIndustry::Do(), DK_OPotatoSeed::Do(), PTOtherDryBeans::Do(), SpringBarley::Do(), PLFodderLucerne1::Do(), PTHorticulture::Do(), UKPermanentGrass::Do(), UKPotatoes::Do(), DK_Potato::Do(), UKTempGrass::Do(), PTOliveGroveTraditional::Do(), PTPotatoes::Do(), FI_Caraway2::Do(), PTOats::Do(), DK_OSeedGrassRye_Spring::Do(), NLGrassGrazed2::Do(), NLPermanentGrassGrazed::Do(), NLGrassGrazed1Spring::Do(), WinterWheatStriglingCulm::Do(), NLGrassGrazedLast::Do(), WinterWheatStrigling::Do(), WinterWheatStriglingSingle::Do(), PTMaize::Do(), PTMaize_Hort::Do(), PTWinterRye::Do(), PTWinterWheat::Do(), PTWinterBarley::Do(), PTFodderMix::Do(), PTCloverGrassGrazed2::Do(), PTTriticale::Do(), ITGrassland::Do(), DK_PotatoSeed::Do(), PTYellowLupin::Do(), BEPotatoesSpring::Do(), PTGrassGrazed::Do(), PTSorghum::Do(), WinterBarleyStrigling::Do(), NLGrassGrazed1::Do(), FI_OCaraway1::Do(), DE_BushFruitPerm::Do(), DK_PotatoIndustry::Do(), WinterBarley::Do(), NLPotatoesSpring::Do(), PTRyegrass::Do(), DK_OOrchCherry::Do(), DK_OBushFruit_Perm1::Do(), FI_GrasslandSilageAnnual::Do(), FR_Sorghum::Do(), FR_Maize_Silage::Do(), FR_Maize::Do(), NLPotatoes::Do(), PLSpringBarley::Do(), FI_Caraway1::Do(), PTCloverGrassGrazed1::Do(), SE_SpringBarley::Do(), DE_Carrots::Do(), DK_BushFruit_Perm1::Do(), SE_WinterRape_Seed::Do(), PTPermanentGrassGrazed::Do(), DE_Oats::Do(), DE_Cabbage::Do(), FR_SpringWheat::Do(), DE_SpringRye::Do(), PTVineyards::Do(), DE_GrasslandSilageAnnual::Do(), DK_BushFruit_Perm2::Do(), FR_WinterBarley::Do(), IRSpringBarley::Do(), IRSpringOats::Do(), FR_Grassland::Do(), FR_WinterWheat::Do(), IRSpringWheat::Do(), DE_WinterRape::Do(), DE_Orchard::Do(), DK_SeedGrassFescue_Spring::Do(), WinterWheat::Do(), DK_OrchCherry::Do(), IRGrassland_no_reseed::Do(), DE_OOrchard::Do(), IRGrassland_reseed::Do(), ITOrchard::Do(), DK_OChristmasTrees_Perm::Do(), ITOOrchard::Do(), and DK_ChristmasTrees_Perm::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.

631 {
632  FarmToDo treatment = fp_npks;
633  if ( (0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
634  SetFunctionData(a_field, 1.0, 1.0, EL_TRAMLINE_DECAYTIME, treatment);
635  return true;
636  }
637  return false;
638 }

References DO_IT_PROB, EL_TRAMLINE_DECAYTIME, fp_npks, g_weather, and Weather::Raining().

Referenced by WinterRapeStrigling::Do(), DK_CerealLegume_Whole::Do(), DK_CerealLegume::Do(), FI_OPotato_South::Do(), FI_OPotatoIndustry_North::Do(), FI_OPotatoIndustry_South::Do(), FI_OStarchPotato_North::Do(), FI_OStarchPotato_South::Do(), DK_SpringBarley_Green::Do(), FI_OPotato_North::Do(), DK_SpringBarleySilage::Do(), FI_SugarBeet::Do(), FI_Potato_North::Do(), FI_StarchPotato_North::Do(), FI_PotatoIndustry_North::Do(), FI_PotatoIndustry_South::Do(), FI_Potato_South::Do(), FI_StarchPotato_South::Do(), DK_SpringBarleyCloverGrass::Do(), DK_OVegSeeds::Do(), DK_SpringBarley::Do(), DK_SpringBarley_CC::Do(), DK_VegSeeds::Do(), SpringRape::Do(), DK_MixedVeg::Do(), FI_OSpringBarley_Malt::Do(), WinterRape::Do(), FI_OFabaBean::Do(), FR_SpringBarley::Do(), FI_OSpringOats::Do(), FI_OSpringRape::Do(), FI_OSpringWheat::Do(), FI_GrasslandPasturePerennial1::Do(), FI_GrasslandSilagePerennial1::Do(), FI_OTurnipRape::Do(), FR_SpringOats::Do(), FI_OSpringBarley_Fodder::Do(), PLWinterRye::Do(), FI_TurnipRape::Do(), FR_Maize_Silage::Do(), FI_FabaBean::Do(), PLSpringBarley::Do(), FI_SpringRape::Do(), FI_OWinterRye::Do(), FI_SpringBarley_Malt::Do(), PLWinterTriticale::Do(), FI_OWinterWheat::Do(), FI_SprSpringBarley_Fodder::Do(), PLWinterWheat::Do(), FI_SpringWheat::Do(), PLWinterBarley::Do(), PLWinterWheatLate::Do(), PLSpringWheat::Do(), FI_SpringOats::Do(), FI_SpringBarley_Fodder::Do(), PLPotatoes::Do(), PLWinterRape::Do(), FI_WinterWheat::Do(), FI_WinterRye::Do(), IRGrassland_no_reseed::Do(), IRGrassland_reseed::Do(), ITOrchard::Do(), and ITOOrchard::Do().

◆ FP_NS()

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

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

741 {
742  if ((0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
743  SetFunctionData(a_field, 1.0, 1.0, EL_TRAMLINE_DECAYTIME, fp_ns);
744  return true;
745  }
746  return false;
747 }

References DO_IT_PROB, EL_TRAMLINE_DECAYTIME, fp_ns, g_weather, and Weather::Raining().

Referenced by SE_SpringBarley::Do(), SE_WinterRape_Seed::Do(), and SE_WinterWheat::Do().

◆ FP_P()

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

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

688 {
689  if ((0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
690  SetFunctionData(a_field, 1.0, 1.0, EL_TRAMLINE_DECAYTIME, fp_p);
691  return true;
692  }
693  return false;
694 }

References DO_IT_PROB, EL_TRAMLINE_DECAYTIME, fp_p, g_weather, and Weather::Raining().

Referenced by FR_Sunflower::Do(), DE_WinterWheatLate::Do(), and FR_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.

674 {
675  FarmToDo treatment = fp_pk;
676  if ( (0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
677  SetFunctionData(a_field, 1.0, 1.0, EL_TRAMLINE_DECAYTIME, treatment);
678  return true;
679  }
680  return false;
681 }

References DO_IT_PROB, EL_TRAMLINE_DECAYTIME, fp_pk, g_weather, and Weather::Raining().

Referenced by UKBeans::Do(), SpringBarleySeed::Do(), PLFodderLucerne2::Do(), DK_WinterRye_CC::Do(), DK_WinterRye::Do(), SpringBarleySKManagement::Do(), SpringBarleySilage::Do(), PLCarrots::Do(), SpringBarleySpr::Do(), SpringBarleyStriglingSingle::Do(), SpringBarleyPTreatment::Do(), SpringBarleyStrigling::Do(), SpringBarleyStriglingCulm::Do(), NLWinterWheat::Do(), SpringBarley::Do(), PLFodderLucerne1::Do(), DE_HerbsPerennial_after1year::Do(), DE_HerbsPerennial_1year::Do(), DE_OHerbsPerennial_after1year::Do(), PLBeetSpr::Do(), PLBeans::Do(), DE_OHerbsPerennial_1year::Do(), DE_OAsparagusEstablishedPlantation::Do(), PLWinterRye::Do(), DE_SpringBarley::Do(), DE_AsparagusEstablishedPlantation::Do(), PLMaize::Do(), PLMaizeSilage::Do(), NLTulips::Do(), PLWinterTriticale::Do(), DE_WinterRye::Do(), PLWinterBarley::Do(), PLBeet::Do(), PLWinterWheat::Do(), PLSpringWheat::Do(), PLWinterWheatLate::Do(), DK_BushFruit_Perm1::Do(), PLPotatoes::Do(), DE_WinterBarley::Do(), DE_GrasslandSilageAnnual::Do(), DK_BushFruit_Perm2::Do(), IRWinterOats::Do(), IRWinterBarley::Do(), FR_WinterWheat::Do(), DE_Triticale::Do(), DE_WinterWheat::Do(), IRWinterWheat::Do(), FR_Potatoes::Do(), DE_Orchard::Do(), DE_SugarBeet::Do(), DE_Potatoes::Do(), and DE_PotatoesIndustry::Do().

◆ FP_PKS()

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

Apply PKS fertilizer to a_field owned by an arable farmer.

660 {
661  FarmToDo treatment = fp_pks;
662  if ((0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
663  SetFunctionData(a_field, 1.0, 1.0, EL_TRAMLINE_DECAYTIME, treatment);
664  return true;
665  }
666  return false;
667 }

References DO_IT_PROB, EL_TRAMLINE_DECAYTIME, fp_pks, g_weather, and Weather::Raining().

Referenced by DE_OPeas::Do(), and DE_OLegume::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.

941 {
942  FarmToDo treatment = fp_rsm;
943  if ((0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
944  SetFunctionData(a_field, 1.0, 1.0, EL_TRAMLINE_DECAYTIME, treatment);
945  return true;
946  }
947  return false;
948 }

References DO_IT_PROB, EL_TRAMLINE_DECAYTIME, fp_rsm, g_weather, and Weather::Raining().

Referenced by PLSpringBarleySpr::Do(), PLWinterRye::Do(), PLMaize::Do(), PLMaizeSilage::Do(), PLSpringBarley::Do(), PLWinterTriticale::Do(), PLWinterWheat::Do(), PLWinterBarley::Do(), PLSpringWheat::Do(), PLWinterWheatLate::Do(), and PLWinterRape::Do().

◆ FP_SK()

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

◆ 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.

927 {
928  FarmToDo treatment = fp_sludge;
929  if ((0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
930  SetFunctionData(a_field, 1.0, 1.0, EL_TRAMLINE_DECAYTIME, treatment);
931  return true;
932  }
933  return false;
934 }

References DO_IT_PROB, EL_TRAMLINE_DECAYTIME, fp_sludge, g_weather, and Weather::Raining().

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.

824 {
825  FarmToDo treatment = fp_slurry;
826  if ( (0 >= a_days) || ((g_weather->GetTemp()>0)&&
827  !g_weather->Raining() && DoIt(DO_IT_PROB)))
828 {
829  SetFunctionData(a_field, 1.0, 1.0, EL_TRAMLINE_DECAYTIME, treatment);
830  return true;
831  }
832  return false;
833 }

References DO_IT_PROB, EL_TRAMLINE_DECAYTIME, fp_slurry, g_weather, Weather::GetTemp(), and Weather::Raining().

Referenced by UKMaize::Do(), WinterRapeStrigling::Do(), NLCatchCropPea::Do(), BECatchPeaCrop::Do(), OCarrots::Do(), FI_OPotato_North::Do(), FI_OPotato_South::Do(), FI_OPotatoIndustry_North::Do(), OWinterBarleyExt::Do(), FI_OPotatoIndustry_South::Do(), FI_OStarchPotato_North::Do(), FI_OStarchPotato_South::Do(), OWinterBarley::Do(), DK_MaizeSilage::Do(), DK_OSpringBarleyCloverGrass::Do(), OWinterRye::Do(), DK_OWinterRye::Do(), FI_SugarBeet::Do(), DK_SpringOats::Do(), DK_SpringOats_CC::Do(), DE_OMaizeSilage::Do(), DK_OWinterRye_CC::Do(), DE_OMaize::Do(), DK_OSpringBarley_CC::Do(), DK_Maize::Do(), DK_OWinterBarley::Do(), BEMaizeSpring::Do(), DK_SpringWheat::Do(), OSpringBarleyExt::Do(), OSpringBarley::Do(), DK_OSpringBarley::Do(), OPotatoes::Do(), FI_Potato_North::Do(), FI_StarchPotato_North::Do(), OWinterWheat::Do(), OWinterWheatUndersown::Do(), OWinterWheatUndersownExt::Do(), FI_PotatoIndustry_North::Do(), FI_Potato_South::Do(), PTOliveGroveTradOrganic::Do(), FI_PotatoIndustry_South::Do(), FI_StarchPotato_South::Do(), OWinterRape::Do(), DK_OSpringOats::Do(), DK_OSpringWheat::Do(), DE_OCabbages::Do(), DK_SpringBarleyCloverGrass::Do(), NLMaize::Do(), Carrots::Do(), UKSpringBarley::Do(), UKWinterBarley::Do(), DK_WinterFodderGrass::Do(), DK_OSpringOats_CC::Do(), DK_OWinterRape::Do(), DK_SpringBarley::Do(), DK_SpringBarley_CC::Do(), DK_OMaize::Do(), DK_OMaizeSilage::Do(), DE_OPotatoes::Do(), DK_SpringFodderGrass::Do(), NLGrassGrazedExtensive2::Do(), DK_WinterCloverGrassGrazedSown::Do(), NLPermanentGrassGrazedExtensive::Do(), DK_OSpringBarleySilage::Do(), NLGrassGrazedExtensive1Spring::Do(), NLGrassGrazedExtensiveLast::Do(), DK_WinterBarley::Do(), NLCabbage::Do(), NLGrassGrazedExtensive1::Do(), DK_WinterRye::Do(), DK_WinterRye_CC::Do(), UKWinterWheat::Do(), TestCrop::Do(), UKWinterRape::Do(), NLSpringBarley::Do(), NLWinterWheat::Do(), DK_OMixedVeg::Do(), DK_WinterWheat::Do(), DK_WinterWheat_CC::Do(), DE_PermanentGrassGrazed::Do(), PLFodderLucerne1::Do(), UKPermanentGrass::Do(), FR_Grassland_Perm::Do(), UKPotatoes::Do(), UKTempGrass::Do(), SpringRape::Do(), DK_OBushFruit_Perm2::Do(), PTOats::Do(), NLGrassGrazed2::Do(), NLPermanentGrassGrazed::Do(), WinterWheatStrigling::Do(), WinterWheatStriglingCulm::Do(), WinterWheatStriglingSingle::Do(), NLGrassGrazed1Spring::Do(), NLGrassGrazedLast::Do(), PLBeans::Do(), PTWinterBarley::Do(), PTWinterWheat::Do(), PTWinterRye::Do(), DE_OGrasslandSilageAnnual::Do(), PTTriticale::Do(), DK_WinterRape::Do(), PTYellowLupin::Do(), WinterRape::Do(), NLGrassGrazed1::Do(), DE_Maize::Do(), OSpringBarleyPigs::Do(), FI_OSpringRape::Do(), FI_OTurnipRape::Do(), DE_MaizeSilage::Do(), PTRyegrass::Do(), PLWinterRye::Do(), DK_OWinterWheat_CC::Do(), NLPotatoes::Do(), PLMaize::Do(), DK_OWinterWheat::Do(), PLMaizeSilage::Do(), PLSpringBarley::Do(), FI_SpringRape::Do(), FI_OWinterRye::Do(), PTCloverGrassGrazed1::Do(), PLWinterTriticale::Do(), SE_SpringBarley::Do(), FI_OWinterWheat::Do(), PLBeet::Do(), PLWinterBarley::Do(), PLWinterWheat::Do(), PLWinterWheatLate::Do(), PLSpringWheat::Do(), PLPotatoes::Do(), PTPermanentGrassGrazed::Do(), DE_Oats::Do(), SE_WinterWheat::Do(), DE_Cabbage::Do(), DE_SpringRye::Do(), PLWinterRape::Do(), FI_WinterWheat::Do(), DE_GrasslandSilageAnnual::Do(), FR_Grassland::Do(), IRWinterBarley::Do(), IRWinterOats::Do(), IRSpringOats::Do(), IRSpringBarley::Do(), IRSpringWheat::Do(), FI_WinterRye::Do(), FR_WinterRape::Do(), IRWinterWheat::Do(), WinterWheat::Do(), DE_SugarBeet::Do(), IRGrassland_no_reseed::Do(), DE_Potatoes::Do(), DE_PotatoesIndustry::Do(), and IRGrassland_reseed::Do().

◆ FruitHarvest()

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

FruitHarvest (harvest of the mature fruits, e.g., grapes) applied on a_field.

  • details needs to be added (e.g., impact on biomass, influence/impacts in species code)!
1960 {
1961 
1962  FarmToDo treatment = harvest;
1963  if ((0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
1964  SetFunctionData(a_field, 1.0, 1.0, 0, treatment);
1965  return true;
1966  }
1967  return false;
1968 }

References DO_IT_PROB, g_weather, harvest, and Weather::Raining().

Referenced by DE_OBushFruitPerm::Do(), DK_OMaize::Do(), PTOliveGroveTraditional::Do(), DE_BushFruitPerm::Do(), DK_OOrchCherry::Do(), DK_OOrchPear::Do(), DK_OOrchOther::Do(), DK_OOrchApple::Do(), DK_OOrchardCrop_Perm::Do(), PTVineyards::Do(), DE_Orchard::Do(), DK_OrchCherry::Do(), DK_OrchPear::Do(), DK_OrchApple::Do(), DK_OrchOther::Do(), DK_OrchardCrop_Perm::Do(), DE_OOrchard::Do(), ITOrchard::Do(), and ITOOrchard::Do().

◆ FungicideTreat()

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

Apply fungicide to a_field.

2102 {
2103  FarmToDo treatment = fungicide_treat;
2104  if (0 >= a_days)
2105  {
2106  if ((!a_field->GetSignal() & LE_SIG_NO_FUNGICIDE))
2107  {
2108  a_field->Trace(treatment);
2109  a_field->SetLastTreatment(treatment);
2112  }
2113  CalculateTreatmentCosts(treatment, a_field);
2114  return true;
2115  }
2116  else if ((g_weather->GetWind() < cfg_pest_max_wind.value()) &&
2117  (!g_weather->Raining()) && DoIt(DO_IT_PROB)) {
2118  if (!(a_field->GetSignal() & LE_SIG_NO_FUNGICIDE)) {
2119  a_field->Trace(treatment);
2120  a_field->SetLastTreatment(treatment);
2123  }
2124  CalculateTreatmentCosts(treatment, a_field);
2125  return true;
2126  }
2127  return false;
2128 }

References cfg_pest_max_wind, Landscape::CheckForPesticideRecord(), DO_IT_PROB, EL_TRAMLINE_DECAYTIME, fungicide, fungicide_treat, g_landscape_ptr, g_weather, Weather::GetWind(), LE_SIG_NO_FUNGICIDE, Weather::Raining(), LE::SetLastTreatment(), LE::SetTramlinesDecay(), and CfgFloat::value().

Referenced by WinterRapeStrigling::Do(), SeedGrass1::Do(), DK_CerealLegume::Do(), DK_CerealLegume_Whole::Do(), DK_SpringBarley_Green::Do(), SeedGrass2::Do(), DK_SpringBarleySilage::Do(), DK_FodderBeet::Do(), DK_MaizeSilage::Do(), FI_SugarBeet::Do(), DK_SpringOats::Do(), DK_SpringOats_CC::Do(), DK_SugarBeet::Do(), DK_Legume_Beans::Do(), UKBeans::Do(), DK_SpringWheat::Do(), DK_Maize::Do(), SpringBarleySeed::Do(), SpringBarleyCloverGrassStrigling::Do(), FieldPeas::Do(), FieldPeasSilage::Do(), FieldPeasStrigling::Do(), FI_Potato_North::Do(), FI_StarchPotato_North::Do(), SpringBarleyCloverGrass::Do(), FI_PotatoIndustry_North::Do(), FI_PotatoIndustry_South::Do(), FI_StarchPotato_South::Do(), Triticale::Do(), UKBeet::Do(), FI_Potato_South::Do(), DK_SpringBarleyCloverGrass::Do(), NLBeetSpring::Do(), UKSpringBarley::Do(), UKWinterBarley::Do(), SpringBarleyPeaCloverGrassStrigling::Do(), DK_SpringBarley_CC::Do(), DK_SpringBarley::Do(), DE_OPotatoes::Do(), NLCarrotsSpring::Do(), NLBeet::Do(), NLCarrots::Do(), NLCabbageSpring::Do(), DK_WinterBarley::Do(), NLSpringBarleySpring::Do(), PotatoesIndustry::Do(), NorwegianPotatoes::Do(), Potatoes::Do(), PTOliveGroveIntensive::Do(), DK_VegSeeds::Do(), SpringBarleySKManagement::Do(), NLCabbage::Do(), DK_Carrots_Spring::Do(), DK_WinterRye::Do(), DK_WinterRye_CC::Do(), SpringBarleySilage::Do(), SpringBarleySpr::Do(), UKWinterWheat::Do(), WinterRyeStrigling::Do(), DK_Carrots::Do(), PLCarrots::Do(), SpringBarleyPTreatment::Do(), SpringBarleyStrigling::Do(), SpringBarleyStriglingCulm::Do(), SpringBarleyStriglingSingle::Do(), DK_Cabbages::Do(), WinterRye::Do(), NLSpringBarley::Do(), UKWinterRape::Do(), PTOliveGroveSuperIntensive::Do(), NLWinterWheat::Do(), PLSpringBarleySpr::Do(), SpringBarley::Do(), DK_WinterWheat::Do(), DK_WinterWheat_CC::Do(), DK_Potato::Do(), UKPotatoes::Do(), PTOliveGroveTraditional::Do(), PTPotatoes::Do(), SpringRape::Do(), FI_Caraway2::Do(), PLBeetSpr::Do(), DK_MixedVeg::Do(), WinterWheatStrigling::Do(), WinterWheatStriglingCulm::Do(), WinterWheatStriglingSingle::Do(), PLBeans::Do(), DK_WinterRape::Do(), DK_PotatoSeed::Do(), WinterBarleyStrigling::Do(), WinterRape::Do(), DE_BushFruitPerm::Do(), DK_PotatoIndustry::Do(), FR_SpringBarley::Do(), FR_SpringOats::Do(), WinterBarley::Do(), NLPotatoesSpring::Do(), DE_SpringBarley::Do(), PLWinterRye::Do(), FI_TurnipRape::Do(), DE_AsparagusEstablishedPlantation::Do(), NLPotatoes::Do(), PLMaizeSilage::Do(), PLMaize::Do(), PLSpringBarley::Do(), FI_FabaBean::Do(), FI_SpringRape::Do(), NLTulips::Do(), FR_WinterTriticale::Do(), DE_Peas::Do(), SE_SpringBarley::Do(), FI_SpringBarley_Malt::Do(), DE_Legumes::Do(), PLWinterTriticale::Do(), FI_Caraway1::Do(), DE_WinterRye::Do(), FI_SpringWheat::Do(), FI_SprSpringBarley_Fodder::Do(), PLWinterBarley::Do(), PLBeet::Do(), PLWinterWheat::Do(), PLSpringWheat::Do(), PLWinterWheatLate::Do(), DE_Carrots::Do(), FI_SpringOats::Do(), FI_SpringBarley_Fodder::Do(), PLPotatoes::Do(), DK_BushFruit_Perm1::Do(), DE_WinterBarley::Do(), DE_Cabbage::Do(), FR_SpringWheat::Do(), SE_WinterWheat::Do(), DE_Oats::Do(), DE_SpringRye::Do(), DK_SeedGrassRye_Spring::Do(), PLWinterRape::Do(), PTVineyards::Do(), FR_WinterBarley::Do(), DK_BushFruit_Perm2::Do(), FI_WinterWheat::Do(), IRSpringBarley::Do(), IRWinterOats::Do(), IRSpringOats::Do(), IRWinterBarley::Do(), IRSpringWheat::Do(), DE_WinterWheat::Do(), DE_Triticale::Do(), FI_WinterRye::Do(), FR_WinterWheat::Do(), DE_WinterWheatLate::Do(), FR_Potatoes::Do(), IRWinterWheat::Do(), FR_WinterRape::Do(), DE_WinterRape::Do(), DE_Orchard::Do(), WinterWheat::Do(), DE_SugarBeet::Do(), DK_OrchCherry::Do(), DE_Potatoes::Do(), DK_OrchPear::Do(), DK_OrchOther::Do(), DK_OrchApple::Do(), DK_OrchardCrop_Perm::Do(), DE_PotatoesIndustry::Do(), ITOrchard::Do(), and ITOOrchard::Do().

◆ GetArea()

int Farm::GetArea ( void  )

Returns the area of arable fields owned by that farm.

1082  {
1083  int area = 0;
1084  for (unsigned int i = 0; i < m_fields.size(); i++) {
1085  if (m_fields[i]->GetElementType() == tole_Field) area += (int)m_fields[i]->GetArea();
1086  }
1087  return area;
1088 }

References tole_Field.

Referenced by AssignPermanentCrop().

◆ GetAreaDouble()

double Farm::GetAreaDouble ( void  )

Returns the area of arable fields owned by that farm.

1101  {
1102  double area = 0;
1103  for ( unsigned int i = 0; i < m_fields.size(); i++ ) {
1104  if (m_fields[i]->GetElementType()==tole_Field) area += m_fields[i]->GetArea();
1105  }
1106  return area;
1107 }

References tole_Field.

◆ 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

1121 {
1122  int area = 0;
1123  for (unsigned int i = 0; i < m_fields.size(); i++) {
1124  if (m_fields[i]->GetOpenness() > a_openness) area += int(m_fields[i]->GetArea());
1125  }
1126  return area;
1127 }

◆ GetCentroids()

APoint Farm::GetCentroids ( )
inline

◆ GetCrop()

TTypesOfVegetation Farm::GetCrop ( int  a_index)
inline
971  {
972  return m_rotation[a_index];
973  }

References m_rotation.

◆ GetFarmer()

Farmer* Farm::GetFarmer ( )
inline

Returns the pointer to this farm's farmer.

817 { return m_OurFarmer; }

References m_OurFarmer.

Referenced by TestCrop::Do().

◆ GetFarmManager()

FarmManager* Farm::GetFarmManager ( )
inline
780 { return m_OurManager; }

References m_OurManager.

◆ GetFarmNumber()

int Farm::GetFarmNumber ( void  )
inline

◆ GetFarmType()

TTypesOfFarm Farm::GetFarmType ( )
inline

Returns the farm type.

791 { return m_FarmType; }

References m_FarmType.

◆ 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.

1136  {
1137  // If g_farm_fixed_rotation, then determine the first
1138  // crop number in the rotation rotation number.
1140 
1142  // We are running all the farms synchronized, so
1143  // simply set the first crop to run on all farm fields.
1144  return 0;
1145  }
1146 
1147  // Each farm runs its fields sync'ed but independently from
1148  // the other farmers.
1149 
1150  // Determine if this farm has selected its own start index
1151  // and set it if not. m_rotation_sync_index is initialized
1152  // to -1 by the Farm::Farm() constructor.
1153  if ( -1 == m_rotation_sync_index ) {
1155  }
1156  // Return farm localized rotation index.
1157  return m_rotation_sync_index;
1158  }
1159 
1160  // Not synchronised, but we want to follow our rotation sequence, so check
1161  // if we have started this process, if not set the sync value.
1162  // afterwards just increment this.
1163  if ( -1 == m_rotation_sync_index ) {
1164  if (int(m_rotation.size()) > 0) m_rotation_sync_index = g_random_fnc(int(m_rotation.size())); else m_rotation_sync_index = 0;
1165  }
1166  else m_rotation_sync_index = (int) ((m_rotation_sync_index+1) % m_rotation.size());
1167  return m_rotation_sync_index;
1168 }

References g_farm_fixed_rotation_enable, g_farm_fixed_rotation_farms_async, g_random_fnc(), and CfgBool::value().

◆ GetFirstDate()

int Farm::GetFirstDate ( TTypesOfVegetation  a_tov)
protected

Gets the start date for a crop type.

2152  {
2153 
2154  vector<Crop*>* crops_mgt_plans = m_OurManager->GetCropMgtPlans();
2155  for (unsigned int i = 0; i < crops_mgt_plans->size(); i++)
2156  {
2157  if (a_tov2 == (*crops_mgt_plans)[i]->m_tov)
2158  return (*crops_mgt_plans)[i]->GetFirstDate();
2159  }
2160 
2161  return 0;
2162 }

◆ GetForceSpringOK()

int Farm::GetForceSpringOK ( TTypesOfVegetation  a_tov)
protected

Gets the start date for a crop type.

2168  {
2169 
2170  vector<Crop*>* crops_mgt_plans = m_OurManager->GetCropMgtPlans();
2171  for (unsigned int i = 0; i < crops_mgt_plans->size(); i++)
2172  {
2173  if (a_tov == (*crops_mgt_plans)[i]->m_tov)
2174  return (*crops_mgt_plans)[i]->GetForceSpringOK();
2175  }
2176  return 0;
2177 }

◆ GetIntensity()

double Farm::GetIntensity ( void  )
inline
963 { return m_intensity; }

References m_intensity.

Referenced by Landscape::SupplyFarmIntensity().

◆ GetMaxOpenness()

int Farm::GetMaxOpenness ( )
inline

Returns the maximum openness score of the fields.

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

References m_fields.

◆ GetNextCrop()

TTypesOfVegetation Farm::GetNextCrop ( int  a_index)
inline
974  {
975  int ind = a_index + 1;
976  if (ind >= (int)m_rotation.size()) ind = ind - (int)m_rotation.size();
977  return m_rotation[ind];
978  }

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

1178  {
1180  // Rotation not enabled.
1181  return a_rot_index;
1182  }
1183 
1184  if ( a_rot_index == -1 )
1185  return -1;
1186 
1187  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
1188  a_rot_index = 0;
1189 
1190  return a_rot_index;
1191 }

References g_farm_enable_crop_rotation, and CfgBool::value().

◆ GetNextCropStartDate()

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

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

920  {
921  TTypesOfVegetation l_tov2;
922 
923  if ( a_field->GetRotIndex() < 0 || g_farm_fixed_crop_enable.value() //|| g_farm_test_crop.value()
924  ) {
925  l_tov2 = a_curr_veg; // don't do it if no rotation
926  } else {
927  l_tov2 = m_rotation[ GetNextCropIndex( a_field->GetRotIndex() ) ];
928  }
929  a_curr_veg = l_tov2;
930  return GetFirstDate( l_tov2 );
931 }

References g_farm_fixed_crop_enable, LE::GetRotIndex(), and CfgBool::value().

Referenced by BroadBeans::Do(), DK_OLegume_Peas_CC::Do(), DK_OLegume_Beans_CC::Do(), DK_SpringOats_CC::Do(), DK_OWinterRye_CC::Do(), DK_OLegume_Whole_CC::Do(), DK_OSpringBarley_CC::Do(), NLMaizeSpring::Do(), NLMaize::Do(), DK_OSpringOats_CC::Do(), DK_SpringBarley_CC::Do(), BEWinterBarleyCC::Do(), BEWinterWheatCC::Do(), DK_WinterRye_CC::Do(), NLWinterWheat::Do(), DK_WinterWheat_CC::Do(), PTCabbage_Hort::Do(), PTMaize_Hort::Do(), and DK_OWinterWheat_CC::Do().

◆ GetNoCrops()

int Farm::GetNoCrops ( )
inline
979  {
980  return (int)m_rotation.size();
981  }

References m_rotation.

◆ GetNoFields()

int Farm::GetNoFields ( )
inline

Returns the number of the fields owned.

797 { 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

1111 {
1112  int num = 0;
1113  for (unsigned int i = 0; i < m_fields.size(); i++) {
1114  if (m_fields[i]->GetOpenness() > a_openness) num++;
1115  }
1116  return num;
1117 }

◆ GetPreviousTov()

TTypesOfVegetation Farm::GetPreviousTov ( int  a_index)
inline
966  {
967  int ind = a_index - 1;
968  if (ind < 0) ind = (int)m_rotation.size() - 1;
969  return m_rotation[ind];
970  }

References m_rotation.

Referenced by UKMaize::Do(), BEOrchardCrop::Do(), BEMaizeSpring::Do(), UKBeans::Do(), BEBeetSpring::Do(), UKBeet::Do(), BEMaize::Do(), PLFodderLucerne2::Do(), UKSpringBarley::Do(), UKWinterBarley::Do(), BEBeet::Do(), BEWinterBarley::Do(), BEWinterBarleyCC::Do(), BEWinterWheat::Do(), BEWinterWheatCC::Do(), DK_Carrots_Spring::Do(), UKWinterWheat::Do(), PLCarrots::Do(), BEGrassGrazed1Spring::Do(), TestCrop::Do(), UKWinterRape::Do(), BEGrassGrazed2::Do(), BEGrassGrazedLast::Do(), BEGrassGrazed1::Do(), PLFodderLucerne1::Do(), FR_Grassland_Perm::Do(), UKPotatoes::Do(), UKPermanentGrass::Do(), FI_GreenFallow_1year::Do(), UKTempGrass::Do(), FI_NaturalGrassland_Perm::Do(), PLBeetSpr::Do(), FI_GreenFallow_Perm::Do(), PLBeans::Do(), FI_BufferZone_Perm::Do(), FI_BufferZone::Do(), ITGrassland::Do(), FI_NaturalGrassland::Do(), FI_OSpringBarley_Malt::Do(), BEPotatoesSpring::Do(), FI_OCaraway1::Do(), FI_OFabaBean::Do(), FI_OSpringOats::Do(), FI_OSpringRape::Do(), FI_OSpringWheat::Do(), FI_OTurnipRape::Do(), FR_SpringOats::Do(), FI_OSpringBarley_Fodder::Do(), FI_FeedingGround::Do(), PLWinterRye::Do(), FR_Sorghum::Do(), BEPotatoes::Do(), PLMaizeSilage::Do(), PLMaize::Do(), PLSpringBarley::Do(), FI_OWinterRye::Do(), PLWinterTriticale::Do(), SE_SpringBarley::Do(), FI_OWinterWheat::Do(), PLWinterWheat::Do(), PLBeet::Do(), PLWinterBarley::Do(), PLSpringWheat::Do(), PLWinterWheatLate::Do(), SE_WinterRape_Seed::Do(), PLPotatoes::Do(), SE_WinterWheat::Do(), PLWinterRape::Do(), IRWinterBarley::Do(), IRSpringOats::Do(), IRSpringBarley::Do(), IRWinterOats::Do(), IRSpringWheat::Do(), IRWinterWheat::Do(), WinterWheat::Do(), IRGrassland_no_reseed::Do(), IRGrassland_reseed::Do(), ITOrchard::Do(), ITOOrchard::Do(), and Field::GetPreviousTov().

◆ GetRotFilename()

string Farm::GetRotFilename ( void  )
inline
957 { return m_rotfilename; }

References m_rotfilename.

◆ GetTotalArea()

int Farm::GetTotalArea ( void  )

Returns the area of all fields owned by that farm.

1091  {
1092  int area = 0;
1093  for (unsigned int i = 0; i < m_fields.size(); i++)
1094  {
1095  area += (int)m_fields[i]->GetArea();
1096  }
1097  return area;
1098 }

◆ GetType()

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

References m_farmtype.

Referenced by PermanentSetAside::Do(), OrchardCrop::Do(), PermanentGrassTussocky::Do(), UKMaize::Do(), DK_GrassTussocky_Perm::Do(), OSeedGrass1::Do(), OSeedGrass2::Do(), BroadBeans::Do(), PermanentGrassLowYield::Do(), YoungForestCrop::Do(), SeedGrass1::Do(), PermanentGrassGrazed::Do(), FI_OPotatoIndustry_North::Do(), FI_OPotatoIndustry_South::Do(), FI_OPotato_South::Do(), FI_OStarchPotato_North::Do(), FI_OStarchPotato_South::Do(), FI_OPotato_North::Do(), BEOrchardCrop::Do(), SeedGrass2::Do(), FI_SugarBeet::Do(), Maize::Do(), MaizeSilage::Do(), OTriticale::Do(), Oats::Do(), BEMaizeSpring::Do(), UKBeans::Do(), DummyCropPestTesting::Do(), FI_Potato_North::Do(), FieldPeas::Do(), FieldPeasSilage::Do(), FI_StarchPotato_North::Do(), OFodderBeet::Do(), FI_PotatoIndustry_North::Do(), BEBeetSpring::Do(), PLFodderLucerne2::Do(), BEMaize::Do(), Triticale::Do(), UKBeet::Do(), Carrots::Do(), UKSpringBarley::Do(), UKWinterBarley::Do(), BEBeet::Do(), SetAside::Do(), BEWinterBarley::Do(), PotatoesIndustry::Do(), BEWinterBarleyCC::Do(), SugarBeet::Do(), NorwegianPotatoes::Do(), DKOBroadBeans_test::Do(), Potatoes::Do(), FodderBeet::Do(), BEWinterWheat::Do(), BEWinterWheatCC::Do(), DK_Carrots_Spring::Do(), PLCarrots::Do(), SpringBarleySilage::Do(), SpringBarleySpr::Do(), UKWinterWheat::Do(), BEGrassGrazed1Spring::Do(), TestCrop::Do(), UKWinterRape::Do(), WinterRye::Do(), BEGrassGrazed2::Do(), PLSpringBarleySpr::Do(), BEGrassGrazedLast::Do(), BEGrassGrazed1::Do(), SpringBarley::Do(), PLFodderLucerne1::Do(), FR_Grassland_Perm::Do(), UKPotatoes::Do(), UKPermanentGrass::Do(), UKTempGrass::Do(), FI_GreenFallow_1year::Do(), FI_NaturalGrassland_Perm::Do(), SpringRape::Do(), PLBeetSpr::Do(), FI_GreenFallow_Perm::Do(), PLBeans::Do(), FI_BufferZone::Do(), FI_BufferZone_Perm::Do(), ITGrassland::Do(), FI_OSpringBarley_Malt::Do(), FI_NaturalGrassland::Do(), BEPotatoesSpring::Do(), WinterRape::Do(), FI_OCaraway1::Do(), FI_OFabaBean::Do(), FI_OSpringRape::Do(), FI_OSpringWheat::Do(), FI_OSpringOats::Do(), FI_OTurnipRape::Do(), FR_SpringOats::Do(), FI_OSpringBarley_Fodder::Do(), WinterBarley::Do(), PLWinterRye::Do(), FI_FeedingGround::Do(), BEPotatoes::Do(), FR_Sorghum::Do(), PLMaize::Do(), PLSpringBarley::Do(), PLMaizeSilage::Do(), FI_OWinterRye::Do(), PLWinterTriticale::Do(), SE_SpringBarley::Do(), FI_OWinterWheat::Do(), FI_SprSpringBarley_Fodder::Do(), PLWinterWheat::Do(), PLBeet::Do(), PLWinterBarley::Do(), PLSpringWheat::Do(), PLWinterWheatLate::Do(), PLPotatoes::Do(), SE_WinterRape_Seed::Do(), SE_WinterWheat::Do(), PLWinterRape::Do(), IRWinterBarley::Do(), IRSpringOats::Do(), IRWinterOats::Do(), IRSpringBarley::Do(), IRSpringWheat::Do(), IRWinterWheat::Do(), WinterWheat::Do(), IRGrassland_no_reseed::Do(), IRGrassland_reseed::Do(), ITOrchard::Do(), and ITOOrchard::Do().

◆ GetValidCoords()

APoint Farm::GetValidCoords ( )
inline

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

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

References m_fields, APoint::m_x, and APoint::m_y.

◆ GreenHarvest()

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

GreenHarvest (remove of excess production that may affect the desired quality of the fruits, e.g., grapes) applied on a_field.

  • details needs to be added (e.g., impact on biomass, influence/impacts in species code)!
1943 {
1944 
1945  FarmToDo treatment = green_harvest;
1946  if ((0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
1947  SetFunctionData(a_field, 1.0, 1.0, 0, treatment);
1948  return true;
1949  }
1950  return false;
1951 }

References DO_IT_PROB, g_weather, green_harvest, and Weather::Raining().

Referenced by DE_HerbsPerennial_after1year::Do(), DE_HerbsPerennial_1year::Do(), DE_OHerbsPerennial_after1year::Do(), DE_OHerbsPerennial_1year::Do(), and PTVineyards::Do().

◆ GrowthRegulator()

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

Apply growth regulator to a_field.

2071 {
2072  FarmToDo treatment = growth_regulator;
2073  if (0 >= a_days)
2074  {
2075 
2076  if ((!g_weather->Raining()) && (g_weather->GetWind() < cfg_pest_max_wind.value()) && (!(a_field->GetSignal() & LE_SIG_NO_GROWTH_REG))) {
2077  a_field->Trace(treatment);
2078  a_field->SetLastTreatment(treatment);
2080  }
2081  CalculateTreatmentCosts(treatment, a_field);
2082  return true;
2083  }
2084  else if ((g_weather->GetWind() < cfg_pest_max_wind.value()) &&
2085  (!g_weather->Raining()) && DoIt(DO_IT_PROB)) {
2086  if (!(a_field->GetSignal() & LE_SIG_NO_GROWTH_REG)) {
2087  a_field->Trace(treatment);
2088  a_field->SetLastTreatment(treatment);
2090  }
2091  CalculateTreatmentCosts(treatment, a_field);
2092  return true;
2093  }
2094  return false;
2095 }

References cfg_pest_max_wind, DO_IT_PROB, EL_TRAMLINE_DECAYTIME, g_weather, Weather::GetWind(), growth_regulator, LE_SIG_NO_GROWTH_REG, Weather::Raining(), LE::SetLastTreatment(), LE::SetTramlinesDecay(), and CfgFloat::value().

Referenced by SeedGrass2::Do(), DK_SpringOats_CC::Do(), DK_SpringOats::Do(), DK_SpringWheat::Do(), SpringBarleySeed::Do(), FieldPeas::Do(), SpringBarleyCloverGrassStrigling::Do(), FieldPeasSilage::Do(), FieldPeasStrigling::Do(), SpringBarleyCloverGrass::Do(), Triticale::Do(), DK_SpringBarleyCloverGrass::Do(), UKSpringBarley::Do(), UKWinterBarley::Do(), SpringBarleyPeaCloverGrassStrigling::Do(), DK_SpringBarley_CC::Do(), DK_SpringBarley::Do(), DK_WinterBarley::Do(), NLSpringBarleySpring::Do(), PotatoesIndustry::Do(), NorwegianPotatoes::Do(), Potatoes::Do(), SpringBarleySKManagement::Do(), DK_WinterRye::Do(), DK_WinterRye_CC::Do(), SpringBarleySilage::Do(), SpringBarleySpr::Do(), UKWinterWheat::Do(), WinterRyeStrigling::Do(), SpringBarleyPTreatment::Do(), SpringBarleyStrigling::Do(), SpringBarleyStriglingCulm::Do(), SpringBarleyStriglingSingle::Do(), UKWinterRape::Do(), WinterRye::Do(), NLSpringBarley::Do(), NLWinterWheat::Do(), DK_WinterWheat::Do(), DK_WinterWheat_CC::Do(), SpringBarley::Do(), WinterWheatStrigling::Do(), WinterWheatStriglingCulm::Do(), WinterWheatStriglingSingle::Do(), DK_WinterRape::Do(), WinterBarleyStrigling::Do(), FR_SpringBarley::Do(), FR_SpringOats::Do(), WinterBarley::Do(), DE_SpringBarley::Do(), PLWinterRye::Do(), FR_WinterTriticale::Do(), PLWinterTriticale::Do(), FI_Caraway1::Do(), FI_SpringBarley_Malt::Do(), DE_WinterRye::Do(), FI_SprSpringBarley_Fodder::Do(), FI_SpringWheat::Do(), PLWinterWheat::Do(), PLWinterBarley::Do(), FI_SpringOats::Do(), PLSpringWheat::Do(), PLWinterWheatLate::Do(), FI_SpringBarley_Fodder::Do(), SE_WinterRape_Seed::Do(), DE_Oats::Do(), SE_WinterWheat::Do(), DE_WinterBarley::Do(), FR_SpringWheat::Do(), DK_SeedGrassRye_Spring::Do(), DE_SpringRye::Do(), FR_WinterBarley::Do(), FI_WinterWheat::Do(), DE_Triticale::Do(), DE_WinterWheat::Do(), FR_WinterWheat::Do(), DE_WinterWheatLate::Do(), FI_WinterRye::Do(), DK_SeedGrassFescue_Spring::Do(), WinterWheat::Do(), DK_OrchCherry::Do(), DK_OrchPear::Do(), DK_OrchardCrop_Perm::Do(), DK_OrchOther::Do(), DK_OrchApple::Do(), ITOrchard::Do(), and ITOOrchard::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

Save the crop veg type as the Field vegetation type

938  {
939  if (m_queue.Empty())
940  return;
941 
943  FarmEvent* ev = pair.m_element;
944  while (pair.m_pri <= g_date->Date()) {
945  m_queue.Pop();
947  if (LeSwitch(ev)) {
948  // This crop management plan has terminated.
949 #ifdef __CALCULATE_MANAGEMENT_NORMS
951 #endif
952  // If the farmer is simulated in detail he may need to know how he did relative to norms for this crop, so transfer this information now before its lost.
953  if (cfg_UseSocioEconomicFarm.value()) m_OurFarmer->CheckManagementImpacts(ev);
954 
955  // First check for an infinite loop in the rotation scheme,
956  // ie. a scenario where all crops decide not to run given
957  // the date.
959 
960  // Outdate any remaining events for this field.
961  ev->m_field->BumpRunNum();
962 
963  // Crop treatment done, select and initiate new crop if in rotation.
964  TTypesOfVegetation new_veg = ev->m_field->GetVegType();
965 
966  if (ev->m_field->GetRotIndex() >= 0) {
967  int new_index = GetNextCropIndex(ev->m_field->GetRotIndex());
968  new_veg = m_rotation[new_index];
969  // Running in fixed crop mode?
972  }
973  TTypesOfCrops new_crop = m_OurManager->GetCropTypeFromPlan(new_veg);
975  ev->m_field->SetRotIndex(new_index);
977  ev->m_field->SetVegType(new_veg, tov_Undefined);
978  ev->m_field->SetPollenNectarType(new_veg);
979  if(new_crop == toc_OCloverGrassGrazed1
980  || new_crop == toc_CloverGrassGrazed1
981  || new_crop == toc_GrazingPigs
982  || new_crop == toc_OGrazingPigs
983  || new_crop == toc_OCloverGrassSilage1
984  || new_crop == toc_OSetAside
985  || new_crop == toc_SetAside){ // we need to set it to force growth for first year crops
987  if (ev->m_field->GetUnsprayedMarginPolyRef() != -1){
990  }
991  }
992  else{
993  ev->m_field->SetVegHeight(10);
995  if (ev->m_field->GetUnsprayedMarginPolyRef() != -1){
997  um->SetVegHeight(10);
998  um->ResetDigestibility();
999  }
1000  }
1001  if (ev->m_field->GetUnsprayedMarginPolyRef() != -1)
1002  {
1004  um->SetVegType(new_veg, tov_Undefined);
1005  um->SetPollenNectarType(new_veg);
1006  }
1007  /* Recalculate the attributes */
1008  ev->m_field->GetLandscape()->Set_TOV_Att(ev->m_field);
1010  ev->m_field->SetCropType(m_OurManager->GetCropTypeFromPlan(new_veg));
1011  }
1012  // Reset the event list for this field.
1013  ev->m_field->ResetTrace();
1014  // Reset event timeout counter.
1015  ev->m_field->SetVegStore(0);
1016 
1017  // The next bit simply determines the start date of the next crop in
1018  // the rotation and passes this to the start crop event.
1019  // The crop is responsible for raising an error if the next crop is
1020  // not possible or otherwise handling the problem
1021 
1022  // 19/5-2003: Note: This code was moved out into a dedicated
1023  // method of the Farm class, GetNextCropStartDate(), as precisely
1024  // the same piece of code needs to be run during initialization of
1025  // farm management.
1026  TTypesOfVegetation l_tov = new_veg;
1027  int l_nextcropstartdate = GetNextCropStartDate(ev->m_field, l_tov);
1028  bool forcespringOK = GetForceSpringOK(l_tov);
1029  // Create 'start' event for today and put it on the queue.
1030  AddNewEvent(new_veg, g_date->Date(), ev->m_field, PROG_START, ev->m_field->GetRunNum(), false, l_nextcropstartdate, false, l_tov, fmc_Others, ev->m_forcespring, forcespringOK);
1031  // Set starting date for rotation mgmt loop detection.
1032  ev->m_field->SetMgtLoopDetectDate(g_date->Date());
1033  // Now reset the random slope factor for the field growth
1035  }
1036 
1037  delete ev;
1038 
1039  if (m_queue.Empty())
1040  return;
1041  pair = m_queue.Bottom();
1042  ev = pair.m_element;
1043 
1044  }
1045 }

References cfg_UseSocioEconomicFarm, Calendar::Date(), fmc_Others, LE::ForceGrowthInitialiseForFirstYearCrop(), g_date, g_farm_fixed_crop_enable, g_farm_fixed_crop_type, g_landscape_ptr, g_letype, LE::GetRotIndex(), LE::GetUnsprayedMarginPolyRef(), LowPriPair< ELEMTYPE >::m_element, FarmEvent::m_field, FarmEvent::m_forcespring, LowPriPair< ELEMTYPE >::m_pri, PROG_START, LE::ResetDigestibility(), LE::SetPollenNectarType(), LE::SetRotIndex(), LE::SetVegGrowthScalerRand(), LE::SetVegHeight(), LE::SetVegStore(), LE::SetVegType(), Landscape::SupplyLEPointer(), toc_CloverGrassGrazed1, toc_GrazingPigs, toc_OCloverGrassGrazed1, toc_OCloverGrassSilage1, toc_OGrazingPigs, toc_OSetAside, toc_SetAside, tov_Undefined, LE_TypeClass::TranslateVegTypes(), CfgInt::value(), and CfgBool::value().

◆ Harvest()

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

Carry out a harvest on a_field.

1365 {
1366  FarmToDo treatment = harvest;
1367  //5 days good weather before
1368  if ((0 >= a_days) || ((g_weather->GetRainPeriod(g_date->Date(), 5) < 0.1) && DoIt(DO_IT_PROB))) {
1369  LE* um = SetFunctionData(a_field, 0.4, 1.0, 0, treatment);
1370  float biomassBefore = a_field->GetVegBiomass();
1371  a_field->SetGrowthPhase(harvest1);
1372  // Here we have to do a little skip to avoid too low insect populations after harvest, but a correct veg biomass
1373  double insects = a_field->GetInsectPop();
1374  a_field->RecalculateBugsNStuff();
1375  float reduc = a_field->GetVegBiomass() / biomassBefore;
1376  if (reduc > 0 && reduc < 1) g_pest->ReducePlantPesticide(a_field->GetMinX(), a_field->GetMaxX(), a_field->GetMinY(), a_field->GetMaxY(), a_field->GetMapIndex(), reduc, true);
1377  //else (cout << "Before: " << biomassBefore << ", after: " << a_field->GetVegBiomass());
1378  a_field->ResetDigestibility();
1379  a_field->SetInsectPop(insects);
1380  a_field->PollenNectarReset();
1381  // Are we a cereal crop? If so we need to have some spilled grain
1382  double someseed = 0.0;
1383  double somemaize = 0.0;
1384  if (dynamic_cast<VegElement*>(a_field)->IsMatureCereal()) {
1385  someseed = m_OurManager->GetSpilledGrain();
1386  a_field->SetStubble(true);
1387  }
1388  else if (dynamic_cast<VegElement*>(a_field)->IsMaize()) {
1389  // Maize in stubble
1390  a_field->SetStubble(true);
1391  somemaize = m_OurManager->GetSpilledMaize();
1392  }
1393  a_field->SetBirdSeed(someseed);
1394  a_field->SetBirdMaize(somemaize);
1395  if (um != nullptr) {
1396  um->SetGrowthPhase(harvest1);
1397  double biomassBefore = um->GetVegBiomass();
1398  um->RecalculateBugsNStuff();
1399  double reduc = um->GetVegBiomass() / biomassBefore;
1400  if (reduc > 0 && reduc < 1) g_pest->ReducePlantPesticide(um->GetMinX(), um->GetMaxX(), um->GetMinY(), um->GetMapIndex(), reduc, true);
1401  um->ResetDigestibility();
1402  um->SetInsectPop(insects);
1403  um->SetBirdSeed(someseed);
1404  um->SetBirdMaize(somemaize);
1405  um->PollenNectarReset();
1406 
1407  if ((somemaize > 0) || (someseed > 0)) um->SetStubble(true);
1408  }
1409  // Calculate economics
1410  if (m_OurManager->GetUseSocioEconomicFarmers()) Harvested(a_field->GetCropType(), a_field->GetVegBiomass() * a_field->GetArea());
1411  return true;
1412  }
1413  return false;
1414 }

References Calendar::Date(), DO_IT_PROB, g_date, g_pest, g_weather, LE::GetArea(), LE::GetInsectPop(), LE::GetMapIndex(), LE::GetMaxX(), LE::GetMaxY(), LE::GetMinX(), LE::GetMinY(), Weather::GetRainPeriod(), LE::GetVegBiomass(), harvest, harvest1, LE::PollenNectarReset(), LE::RecalculateBugsNStuff(), Pesticide::ReducePlantPesticide(), LE::ResetDigestibility(), LE::SetBirdMaize(), LE::SetBirdSeed(), LE::SetGrowthPhase(), LE::SetInsectPop(), and LE::SetStubble().

Referenced by UKMaize::Do(), GenericCatchCrop::Do(), NorwegianOats::Do(), WinterRapeStrigling::Do(), NorwegianSpringBarley::Do(), OSeedGrass1::Do(), BroadBeans::Do(), OSeedGrass2::Do(), OFieldPeas::Do(), OFieldPeasSilage::Do(), OCarrots::Do(), DE_OPeas::Do(), DK_OLegume::Do(), SeedGrass1::Do(), DK_CerealLegume::Do(), DK_CerealLegume_Whole::Do(), OBarleyPeaCloverGrass::Do(), OMaizeSilage::Do(), DE_OLegume::Do(), DK_SpringBarley_Green::Do(), DK_Legume_Peas::Do(), OWinterBarleyExt::Do(), DK_OLegume_Peas_CC::Do(), DK_OLentils::Do(), DK_SpringBarleySilage::Do(), OWinterBarley::Do(), DK_OLegume_Beans::Do(), DK_OLegume_Peas::Do(), SeedGrass2::Do(), DK_OLegume_Beans_CC::Do(), DK_OLupines::Do(), DK_OSpringBarleyCloverGrass::Do(), DK_MaizeSilage::Do(), OWinterRye::Do(), DE_OSpringRye::Do(), DK_OWinterRye::Do(), OOats::Do(), DK_Legume_Beans::Do(), DK_SpringOats::Do(), DK_SpringOats_CC::Do(), DE_OMaizeSilage::Do(), DE_OOats::Do(), DK_OLegume_Whole_CC::Do(), DK_OLegumeCloverGrass_Whole::Do(), DK_OSpringBarley_CC::Do(), Maize::Do(), MaizeSilage::Do(), MaizeStrigling::Do(), DE_OWinterWheat::Do(), DK_OWinterRye_CC::Do(), OTriticale::Do(), DE_OMaize::Do(), DK_OCerealLegume_Whole::Do(), DK_OLegume_Whole::Do(), DK_OWinterBarley::Do(), NLMaizeSpring::Do(), Oats::Do(), OSpringBarleyExt::Do(), DK_SpringWheat::Do(), DK_Maize::Do(), UKBeans::Do(), DK_OSpringBarley::Do(), OSpringBarley::Do(), DK_Legume_Whole::Do(), DK_OCerealLegume::Do(), SpringBarleySeed::Do(), FieldPeas::Do(), FieldPeasSilage::Do(), FieldPeasStrigling::Do(), OPotatoes::Do(), SpringBarleyCloverGrassStrigling::Do(), DE_OWinterRape::Do(), OWinterWheat::Do(), OWinterWheatUndersown::Do(), OWinterWheatUndersownExt::Do(), OFodderBeet::Do(), SpringBarleyCloverGrass::Do(), UKBeet::Do(), DK_OSpringOats::Do(), DK_OSpringWheat::Do(), Triticale::Do(), OWinterRape::Do(), PTOliveGroveTradOrganic::Do(), DE_OCabbages::Do(), DE_OSugarBeet::Do(), DK_OVegSeeds::Do(), NLBeetSpring::Do(), Carrots::Do(), NLMaize::Do(), DK_SpringBarleyCloverGrass::Do(), UKSpringBarley::Do(), UKWinterBarley::Do(), DK_OSpringOats_CC::Do(), DK_WinterFodderGrass::Do(), DK_OMaizeSilage::Do(), DE_OPotatoes::Do(), DK_OWinterRape::Do(), NLCarrotsSpring::Do(), DK_SpringBarley::Do(), DK_SpringBarley_CC::Do(), SpringBarleyPeaCloverGrassStrigling::Do(), DK_OSpringBarleySilage::Do(), NLBeet::Do(), DK_SpringFodderGrass::Do(), DE_OCarrots::Do(), DK_WinterCloverGrassGrazedSown::Do(), DK_OCabbages::Do(), DK_OEnergyCrop_Perm::Do(), NLCarrots::Do(), DK_OCarrots::Do(), NLCabbageSpring::Do(), NLSpringBarleySpring::Do(), DK_WinterBarley::Do(), PotatoesIndustry::Do(), FodderBeet::Do(), NorwegianPotatoes::Do(), DKOBroadBeans_test::Do(), Potatoes::Do(), PTOliveGroveIntensive::Do(), DK_EnergyCrop_Perm::Do(), DK_VegSeeds::Do(), DK_Carrots_Spring::Do(), NLCabbage::Do(), DK_WinterRye::Do(), DK_WinterRye_CC::Do(), SpringBarleySKManagement::Do(), UKWinterWheat::Do(), DK_Carrots::Do(), WinterRyeStrigling::Do(), PLCarrots::Do(), SpringBarleySilage::Do(), SpringBarleySpr::Do(), UKWinterRape::Do(), DK_Cabbages::Do(), NLSpringBarley::Do(), WinterRye::Do(), SpringBarleyPTreatment::Do(), SpringBarleyStrigling::Do(), SpringBarleyStriglingSingle::Do(), SpringBarleyStriglingCulm::Do(), DK_OMixedVeg::Do(), NLWinterWheat::Do(), PLSpringBarleySpr::Do(), PTBeans::Do(), PTOliveGroveSuperIntensive::Do(), PTCabbage::Do(), DK_WinterWheat::Do(), DK_WinterWheat_CC::Do(), PTCabbage_Hort::Do(), FI_OCaraway2::Do(), PTOtherDryBeans::Do(), SpringBarley::Do(), PTHorticulture::Do(), UKPotatoes::Do(), PTPotatoes::Do(), DK_OSeedGrassRye_Spring::Do(), SpringRape::Do(), FI_Caraway2::Do(), PTOats::Do(), DK_MixedVeg::Do(), PLBeetSpr::Do(), DK_CloverGrassGrazed1::Do(), WinterWheatStriglingCulm::Do(), WinterWheatStriglingSingle::Do(), WinterWheatStrigling::Do(), PLBeans::Do(), PTMaize_Hort::Do(), PTWinterWheat::Do(), PTMaize::Do(), PTWinterBarley::Do(), PTWinterRye::Do(), PTFodderMix::Do(), DK_WinterRape::Do(), PTCloverGrassGrazed2::Do(), FI_OSpringBarley_Malt::Do(), PTTriticale::Do(), WinterBarleyStrigling::Do(), WinterRape::Do(), PTGrassGrazed::Do(), PTSorghum::Do(), FI_OFabaBean::Do(), FI_OCaraway1::Do(), DE_Maize::Do(), FI_OSpringOats::Do(), FR_SpringBarley::Do(), DE_MaizeSilage::Do(), OSpringBarleyPigs::Do(), FI_OSpringWheat::Do(), FI_GrasslandSilagePerennial1::Do(), FI_OTurnipRape::Do(), FI_GrasslandPasturePerennial1::Do(), FI_OSpringRape::Do(), FR_SpringOats::Do(), WinterBarley::Do(), PTRyegrass::Do(), FI_OSpringBarley_Fodder::Do(), NLPotatoesSpring::Do(), DE_SpringBarley::Do(), PLWinterRye::Do(), FR_Sorghum::Do(), FI_TurnipRape::Do(), FI_GrasslandSilageAnnual::Do(), FR_Maize::Do(), DK_OWinterWheat_CC::Do(), FR_Maize_Silage::Do(), PLMaizeSilage::Do(), FI_FabaBean::Do(), PLSpringBarley::Do(), NLPotatoes::Do(), PLMaize::Do(), DK_OWinterWheat::Do(), FI_OWinterRye::Do(), FR_WinterTriticale::Do(), FI_SpringRape::Do(), FR_Sunflower::Do(), FI_Caraway1::Do(), DE_Peas::Do(), SE_SpringBarley::Do(), FI_SpringBarley_Malt::Do(), DE_Legumes::Do(), PLWinterTriticale::Do(), PTCloverGrassGrazed1::Do(), DE_WinterRye::Do(), DE_OTriticale::Do(), FI_OWinterWheat::Do(), DE_OWinterRye::Do(), PLWinterBarley::Do(), PLWinterWheat::Do(), FI_SprSpringBarley_Fodder::Do(), DK_CloverGrassGrazed3::Do(), FI_SpringWheat::Do(), PLBeet::Do(), DE_OWinterBarley::Do(), DK_CloverGrassGrazed2::Do(), DE_Carrots::Do(), FI_SpringOats::Do(), PLSpringWheat::Do(), PLWinterWheatLate::Do(), FI_SpringBarley_Fodder::Do(), PLPotatoes::Do(), SE_WinterRape_Seed::Do(), SE_WinterWheat::Do(), DE_WinterBarley::Do(), DE_Cabbage::Do(), DE_Oats::Do(), FR_SpringWheat::Do(), DK_SeedGrassRye_Spring::Do(), DE_SpringRye::Do(), PLWinterRape::Do(), FR_WinterBarley::Do(), FI_WinterWheat::Do(), IRSpringBarley::Do(), IRWinterBarley::Do(), IRSpringOats::Do(), IRWinterOats::Do(), DE_WinterWheatLate::Do(), FR_WinterWheat::Do(), FI_WinterRye::Do(), IRSpringWheat::Do(), DE_Triticale::Do(), DE_WinterWheat::Do(), IRWinterWheat::Do(), FR_Potatoes::Do(), FR_WinterRape::Do(), DE_WinterRape::Do(), DK_SeedGrassFescue_Spring::Do(), WinterWheat::Do(), DE_SugarBeet::Do(), DE_Potatoes::Do(), DE_PotatoesIndustry::Do(), DK_OChristmasTrees_Perm::Do(), and DK_ChristmasTrees_Perm::Do().

◆ HarvestBF_Machine()

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

Harvest bush fruit on a_field - tramlines since fruits are picked by machine, the bush stays on field with same vegetation height, thus suspects same % insects.

1815 {
1816  FarmToDo treatment = harvest_bushfruit;
1817  if ((0 >= a_days) || ((g_weather->GetRainPeriod(g_date->Date(), 5) < 0.1)
1818  && DoIt(DO_IT_PROB)))
1819  {
1820  LE* um = SetFunctionData(a_field, 1.0, 1.0, EL_TRAMLINE_DECAYTIME, treatment);
1821  a_field->SetGrowthPhase(harvest1);
1822  if (um != nullptr) {
1823  um->SetGrowthPhase(harvest1);
1824  }
1825  return true;
1826  }
1827  return false;
1828 }

References Calendar::Date(), DO_IT_PROB, EL_TRAMLINE_DECAYTIME, g_date, g_weather, Weather::GetRainPeriod(), harvest1, harvest_bushfruit, and LE::SetGrowthPhase().

Referenced by DK_OBushFruit_Perm2::Do(), DK_OBushFruit_Perm1::Do(), and DK_BushFruit_Perm2::Do().

◆ HarvestBushFruit()

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

Harvest bush fruit on a_field - no tramlines since fruits are picked by hand, the bush stays on field with same vegetation height, thus suspects same % insects.

1795 {
1796  FarmToDo treatment = harvest_bushfruit;
1797  if ((0 >= a_days) || ((g_weather->GetRainPeriod(g_date->Date(), 5) < 0.1)
1798  && DoIt(DO_IT_PROB)))
1799  {
1800  LE* um = SetFunctionData(a_field, 1.0, 1.0, 0, treatment);
1801  a_field->SetGrowthPhase(harvest1);
1802  if (um != nullptr) {
1803  um->SetGrowthPhase(harvest1);
1804  }
1805  return true;
1806  }
1807  return false;
1808 }

References Calendar::Date(), DO_IT_PROB, g_date, g_weather, Weather::GetRainPeriod(), harvest1, harvest_bushfruit, and LE::SetGrowthPhase().

Referenced by DK_BushFruit_Perm1::Do().

◆ Harvested()

void Farm::Harvested ( TTypesOfCrops  a_toc,
double  a_yield 
)
virtual

Records harvest results.

6039 {
6040  // We need to look up the return on a_yield of a_tov
6041  // Then tell the farmer that he earned this money
6042  // In this case there is no change to risk or environmental impact
6043  m_OurFarmer->AddProfit(m_OurManager->GetIncome(a_toc) * a_yield);
6044 }

References FarmManager::GetIncome(), m_OurFarmer, and m_OurManager.

◆ HarvestLong()

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

Carry out a harvest on a_field (only differs in the DoIt chance cf harvest)

1422 {
1423  FarmToDo treatment = harvest;
1424  //5 days good weather before
1425  if ((0 >= a_days) || ((g_weather->GetRainPeriod(g_date->Date(), 5)<0.1) && DoIt(DO_IT_PROB_LONG))
1426  ) {
1427  LE* um = SetFunctionData(a_field, 0.4, 1.0, 0, treatment);
1428  a_field->SetGrowthPhase(harvest1);
1429  // Here we have to do a little skip to avoid too low insect populations after harvest, but a correct veg biomass
1430  double insects = a_field->GetInsectPop();
1431  double biomassBefore = a_field->GetVegBiomass();
1432  a_field->RecalculateBugsNStuff();
1433  a_field->ResetDigestibility();
1434  double reduc = a_field->GetVegBiomass() / biomassBefore;
1435  if (reduc > 0 && reduc < 1) g_pest->ReducePlantPesticide(a_field->GetMinX(), a_field->GetMaxX(), a_field->GetMinY(), a_field->GetMaxY(), a_field->GetMapIndex(), reduc, true); a_field->ResetDigestibility();
1436  a_field->SetInsectPop(insects);
1437  // Are we a cereal crop? If so we need to have some spilled grain
1438  double someseed = 0.0;
1439  double somemaize = 0.0;
1440  if (dynamic_cast<VegElement*>(a_field)->IsMatureCereal()) {
1441  someseed = m_OurManager->GetSpilledGrain();
1442  a_field->SetStubble(true);
1443  }
1444  else if (dynamic_cast<VegElement*>(a_field)->IsMaize()) {
1445  // Maize in stubble
1446  a_field->SetStubble(true);
1447  somemaize = m_OurManager->GetSpilledMaize();
1448  }
1449  a_field->SetBirdSeed(someseed);
1450  a_field->SetBirdMaize(somemaize);
1451  if (um != nullptr) {
1452  um->SetGrowthPhase(harvest1);
1453  double biomassBefore = um->GetVegBiomass();
1454  um->RecalculateBugsNStuff();
1455  um->ResetDigestibility();
1456  double reduc = um->GetVegBiomass() / biomassBefore;
1457  if (reduc > 0 && reduc < 1) g_pest->ReducePlantPesticide(um->GetMinX(), um->GetMaxX(), um->GetMinY(), um->GetMapIndex(), reduc, true); um->ResetDigestibility();
1458  um->SetInsectPop(insects);
1459  um->SetBirdSeed(someseed);
1460  um->SetBirdMaize(somemaize);
1461  if ((somemaize > 0) || (someseed > 0)) um->SetStubble(true);
1462  }
1463  // Calculate economics
1464  if (m_OurManager->GetUseSocioEconomicFarmers()) Harvested(a_field->GetCropType(), a_field->GetVegBiomass() * a_field->GetArea());
1465  return true;
1466  }
1467  return false;
1468 }

References Calendar::Date(), DO_IT_PROB_LONG, g_date, g_pest, g_weather, LE::GetArea(), LE::GetInsectPop(), LE::GetMapIndex(), LE::GetMaxX(), LE::GetMaxY(), LE::GetMinX(), LE::GetMinY(), Weather::GetRainPeriod(), LE::GetVegBiomass(), harvest, harvest1, LE::RecalculateBugsNStuff(), Pesticide::ReducePlantPesticide(), LE::ResetDigestibility(), LE::SetBirdMaize(), LE::SetBirdSeed(), LE::SetGrowthPhase(), LE::SetInsectPop(), and LE::SetStubble().

Referenced by FI_OPotato_North::Do(), FI_OStarchPotato_South::Do(), FI_OPotato_South::Do(), FI_OPotatoIndustry_North::Do(), FI_OPotatoIndustry_South::Do(), FI_OStarchPotato_North::Do(), DK_FodderBeet::Do(), DK_SugarBeet::Do(), FI_SugarBeet::Do(), DK_OSugarBeet::Do(), FI_Potato_North::Do(), DK_OFodderBeet::Do(), FI_StarchPotato_North::Do(), FI_PotatoIndustry_North::Do(), FI_Potato_South::Do(), FI_StarchPotato_South::Do(), FI_PotatoIndustry_South::Do(), SugarBeet::Do(), DK_OPotato::Do(), DK_OPotatoIndustry::Do(), DK_OPotatoSeed::Do(), DK_Potato::Do(), DK_PotatoSeed::Do(), and DK_PotatoIndustry::Do().

◆ HarvestShoots()

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

HarvestShoots applied on a_field (e.g. asparagus) - details needs to be added (e.g., impact on biomass, influence/impacts in species code)!

1884 {
1885  FarmToDo treatment = harvestshoots;
1886  if ((0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
1887  SetFunctionData(a_field, 1.0, 1.0, 0, treatment);
1888  return true;
1889  }
1890  return false;
1891 }

References DO_IT_PROB, g_weather, harvestshoots, and Weather::Raining().

Referenced by DE_OAsparagusEstablishedPlantation::Do(), and DE_AsparagusEstablishedPlantation::Do().

◆ HayBailing()

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

Carry out hay bailing on a_field.

1508 {
1509  FarmToDo treatment = hay_bailing;
1510  if ( (0 >= a_days) ||
1511  ((g_weather->GetRainPeriod(g_date->Date(),5)<0.1) && DoIt(DO_IT_PROB))
1512  ) {
1513  SetFunctionData(a_field, 1.0, 1.0, 0, treatment);
1514  return true;
1515  }
1516  return false;
1517 }

References Calendar::Date(), DO_IT_PROB, g_date, g_weather, Weather::GetRainPeriod(), and hay_bailing.

Referenced by NorwegianOats::Do(), NorwegianSpringBarley::Do(), WinterRapeStrigling::Do(), PermanentGrassLowYield::Do(), OPermanentGrassGrazed::Do(), DK_OGrassLowYield_Perm::Do(), DK_GrassLowYield_Perm::Do(), PermanentGrassGrazed::Do(), OWinterBarleyExt::Do(), OWinterBarley::Do(), OWinterRye::Do(), DK_OSpringBarleyCloverGrass::Do(), DE_OOats::Do(), OOats::Do(), DE_OSpringRye::Do(), DK_OWinterRye::Do(), OTriticale::Do(), DK_OLegumeCloverGrass_Whole::Do(), DK_OSpringBarley_CC::Do(), DE_OWinterWheat::Do(), DK_OWinterRye_CC::Do(), Oats::Do(), OSpringBarleyExt::Do(), DK_OWinterBarley::Do(), OSpringBarley::Do(), DK_OSpringBarley::Do(), SpringBarleySeed::Do(), SpringBarleyCloverGrassStrigling::Do(), OWinterWheat::Do(), OWinterWheatUndersownExt::Do(), OWinterWheatUndersown::Do(), SpringBarleyCloverGrass::Do(), DK_OSpringOats::Do(), DK_OSpringWheat::Do(), Triticale::Do(), DK_SpringBarleyCloverGrass::Do(), DK_OSpringOats_CC::Do(), UKWinterBarley::Do(), UKSpringBarley::Do(), DK_SpringBarley_CC::Do(), DK_SpringBarley::Do(), SpringBarleyPeaCloverGrassStrigling::Do(), DK_OSpringBarleySilage::Do(), NLSpringBarleySpring::Do(), SpringBarleySKManagement::Do(), SpringBarleySpr::Do(), UKWinterWheat::Do(), WinterRyeStrigling::Do(), UKWinterRape::Do(), SpringBarleyPTreatment::Do(), SpringBarleyStrigling::Do(), SpringBarleyStriglingCulm::Do(), SpringBarleyStriglingSingle::Do(), WinterRye::Do(), NLSpringBarley::Do(), PLSpringBarleySpr::Do(), NLWinterWheat::Do(), SpringBarley::Do(), SpringRape::Do(), DK_OSeedGrassRye_Spring::Do(), WinterWheatStriglingCulm::Do(), WinterWheatStrigling::Do(), WinterWheatStriglingSingle::Do(), FI_OSpringBarley_Malt::Do(), PTCloverGrassGrazed2::Do(), PTFodderMix::Do(), WinterRape::Do(), PTSorghum::Do(), WinterBarleyStrigling::Do(), FI_OCaraway1::Do(), OSpringBarleyPigs::Do(), FI_OSpringOats::Do(), FI_OSpringWheat::Do(), FR_SpringBarley::Do(), PTRyegrass::Do(), FI_OSpringBarley_Fodder::Do(), FR_SpringOats::Do(), WinterBarley::Do(), DE_SpringBarley::Do(), PLWinterRye::Do(), DK_OWinterWheat_CC::Do(), PLMaize::Do(), PLMaizeSilage::Do(), PLSpringBarley::Do(), DK_OWinterWheat::Do(), FR_WinterTriticale::Do(), FI_Caraway1::Do(), FI_SpringBarley_Malt::Do(), PLWinterTriticale::Do(), PTCloverGrassGrazed1::Do(), DE_OTriticale::Do(), FI_OWinterWheat::Do(), DE_WinterRye::Do(), DE_OWinterRye::Do(), FI_SpringWheat::Do(), PLWinterBarley::Do(), FI_SprSpringBarley_Fodder::Do(), DE_OWinterBarley::Do(), PLWinterWheat::Do(), FI_SpringOats::Do(), PLWinterWheatLate::Do(), PLSpringWheat::Do(), FI_SpringBarley_Fodder::Do(), DE_Oats::Do(), DE_WinterBarley::Do(), FR_SpringWheat::Do(), DE_SpringRye::Do(), PLWinterRape::Do(), FI_WinterWheat::Do(), FR_WinterBarley::Do(), IRSpringBarley::Do(), IRWinterBarley::Do(), IRWinterOats::Do(), IRSpringOats::Do(), FR_WinterWheat::Do(), DE_WinterWheat::Do(), IRSpringWheat::Do(), DE_WinterWheatLate::Do(), DE_Triticale::Do(), IRWinterWheat::Do(), DE_WinterRape::Do(), and WinterWheat::Do().

◆ HayTurning()

◆ 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.

260 {
261  if ((0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
262  SetFunctionData(a_field, 0.1, 0.0, 0,heavy_cultivator_aggregate);
263  return true; // completed
264  }
265  return false; // not completed
266 }

References DO_IT_PROB, g_weather, heavy_cultivator_aggregate, and Weather::Raining().

Referenced by PLSpringBarleySpr::Do(), PLFodderLucerne1::Do(), PLBeetSpr::Do(), PLBeans::Do(), PLSpringBarley::Do(), PLMaizeSilage::Do(), PLMaize::Do(), PLBeet::Do(), PLSpringWheat::Do(), DE_GrasslandSilageAnnual::Do(), and DE_SugarBeet::Do().

◆ Herbicide()

void Farm::Herbicide ( int  a_area)
virtual

Records the costs of herbicide treatment, and associated score change.

6059 {
6060  // We need to look up the return on cost of applying the insecticide to a_tov
6061  // Then tell the farmer that he spent this money
6062  // In this case there is a change to risk or environmental impact
6063  /*
6064  m_OurFarmer->AddCost(m_HerbicideCost);
6065  m_OurFarmer->ChangeRiskScore(m_HerbiicideRiskChange);
6066  m_OurFarmer->ChangeEnvironmentScore(m_EnvironmentalRiskChange);
6067  */
6068 }

◆ HerbicideTreat()

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

Apply herbicide to a_field.

Pesticide and similar in this next section

2026 {
2027  FarmToDo treatment = herbicide_treat;
2028  if (0 >= a_days) // Must do this
2029  {
2030  if (((a_field->GetSignal() & LE_SIG_NO_HERBICIDE) == 0))
2031  {
2032  a_field->Trace(treatment);
2033  a_field->SetLastTreatment(treatment);
2035  {
2036  a_field->ReduceWeedBiomass(0.05);
2037  }
2041 
2042  }
2043  CalculateTreatmentCosts(treatment, a_field);
2044  return true;
2045  }
2046  else if ((g_weather->GetWind() < cfg_pest_max_wind.value()) && (!g_weather->Raining()) && DoIt(DO_IT_PROB))
2047  {
2048  if (!(a_field->GetSignal() & LE_SIG_NO_HERBICIDE))
2049  {
2050  a_field->Trace(treatment);
2051  a_field->SetLastTreatment(treatment);
2053  {
2054  a_field->ReduceWeedBiomass(0.05);
2055  }
2059  }
2060  CalculateTreatmentCosts(treatment, a_field);
2061  return true;
2062  }
2063  return false;
2064 }

References cfg_pest_max_wind, Landscape::CheckForPesticideRecord(), DO_IT_PROB, EL_HERBICIDE_DELAYTIME, EL_TRAMLINE_DECAYTIME, g_landscape_ptr, g_weather, Weather::GetWind(), herbicide, herbicide_treat, l_farm_herbicide_kills, LE_SIG_NO_HERBICIDE, Weather::Raining(), LE::ReduceWeedBiomass(), LE::SetHerbicideDelay(), LE::SetLastTreatment(), LE::SetTramlinesDecay(), CfgFloat::value(), and CfgBool::value().

Referenced by UKMaize::Do(), PermanentGrassLowYield::Do(), DK_GrassLowYield_Perm::Do(), SeedGrass1::Do(), DK_CerealLegume::Do(), PermanentGrassGrazed::Do(), DK_CerealLegume_Whole::Do(), DK_SpringBarley_Green::Do(), DK_Legume_Peas::Do(), DK_CatchCrop::Do(), DK_SpringBarleySilage::Do(), SeedGrass2::Do(), DK_FodderBeet::Do(), DK_MaizeSilage::Do(), DK_SpringOats::Do(), DK_SpringOats_CC::Do(), DK_SugarBeet::Do(), DK_Legume_Beans::Do(), FI_SugarBeet::Do(), Maize::Do(), MaizeSilage::Do(), MaizeStrigling::Do(), NLMaizeSpring::Do(), DK_SpringWheat::Do(), Oats::Do(), UKBeans::Do(), DK_Maize::Do(), SpringBarleySeed::Do(), DK_Legume_Whole::Do(), FI_Potato_North::Do(), FieldPeas::Do(), FieldPeasSilage::Do(), FI_StarchPotato_North::Do(), FI_PotatoIndustry_North::Do(), SpringBarleyCloverGrass::Do(), UKBeet::Do(), PLFodderLucerne2::Do(), FI_Potato_South::Do(), FI_PotatoIndustry_South::Do(), Triticale::Do(), FI_StarchPotato_South::Do(), DK_SpringBarleyCloverGrass::Do(), NLBeetSpring::Do(), NLMaize::Do(), Carrots::Do(), DK_WinterFodderGrass::Do(), UKSpringBarley::Do(), UKWinterBarley::Do(), DK_SpringBarley::Do(), DK_SpringBarley_CC::Do(), NLCarrotsSpring::Do(), NLBeet::Do(), DK_SpringFodderGrass::Do(), DK_WinterCloverGrassGrazedSown::Do(), NLCarrots::Do(), NLCabbageSpring::Do(), BEWinterBarley::Do(), NLSpringBarleySpring::Do(), SugarBeet::Do(), DK_WinterBarley::Do(), BEWinterBarleyCC::Do(), PotatoesIndustry::Do(), NorwegianPotatoes::Do(), Potatoes::Do(), PTOliveGroveIntensive::Do(), FodderBeet::Do(), BEWinterWheatCC::Do(), DK_VegSeeds::Do(), DK_EnergyCrop_Perm::Do(), BEWinterWheat::Do(), NLCabbage::Do(), DK_Carrots_Spring::Do(), NLGrassGrazedExtensive1::Do(), DK_WinterRye::Do(), DK_WinterRye_CC::Do(), SpringBarleySKManagement::Do(), DK_Carrots::Do(), PLCarrots::Do(), PTSetAside::Do(), SpringBarleySilage::Do(), SpringBarleySpr::Do(), UKWinterWheat::Do(), DK_Cabbages::Do(), NLSpringBarley::Do(), DK_GrassGrazed_Perm::Do(), SpringBarleyPTreatment::Do(), UKWinterRape::Do(), WinterRye::Do(), NLWinterWheat::Do(), PLSpringBarleySpr::Do(), PTOliveGroveSuperIntensive::Do(), DK_WinterWheat::Do(), DK_WinterWheat_CC::Do(), PTCabbage::Do(), PTCabbage_Hort::Do(), SpringBarley::Do(), PTHorticulture::Do(), PLFodderLucerne1::Do(), UKPotatoes::Do(), DK_Potato::Do(), PTOliveGroveTraditional::Do(), PTPotatoes::Do(), FI_Caraway2::Do(), DE_HerbsPerennial_after1year::Do(), SpringRape::Do(), DK_MixedVeg::Do(), DK_CloverGrassGrazed1::Do(), PLBeetSpr::Do(), DE_HerbsPerennial_1year::Do(), PLBeans::Do(), PTMaize::Do(), PTMaize_Hort::Do(), DK_WinterRape::Do(), DK_SetAside::Do(), WinterRape::Do(), WinterBarleyStrigling::Do(), DK_PotatoSeed::Do(), NLGrassGrazed1::Do(), DE_Maize::Do(), DE_BushFruitPerm::Do(), FI_GrasslandSilagePerennial1::Do(), FI_GrasslandPasturePerennial1::Do(), FR_SpringBarley::Do(), DK_PotatoIndustry::Do(), DE_MaizeSilage::Do(), DK_SetAside_SummerMow::Do(), WinterBarley::Do(), NLPotatoesSpring::Do(), FR_SpringOats::Do(), DE_SpringBarley::Do(), PLWinterRye::Do(), FI_TurnipRape::Do(), FR_Sorghum::Do(), FI_GrasslandSilageAnnual::Do(), DE_AsparagusEstablishedPlantation::Do(), FR_Maize::Do(), FR_Maize_Silage::Do(), NLPotatoes::Do(), FI_FabaBean::Do(), PLMaize::Do(), PLMaizeSilage::Do(), PLSpringBarley::Do(), FI_SpringRape::Do(), NLTulips::Do(), FR_WinterTriticale::Do(), DE_Peas::Do(), PLWinterTriticale::Do(), SE_SpringBarley::Do(), FI_SpringBarley_Malt::Do(), FI_Caraway1::Do(), DE_Legumes::Do(), FR_Sunflower::Do(), DE_WinterRye::Do(), FI_SprSpringBarley_Fodder::Do(), PLWinterWheat::Do(), DK_CloverGrassGrazed3::Do(), PLWinterBarley::Do(), PLBeet::Do(), FI_SpringWheat::Do(), FI_SpringOats::Do(), PLSpringWheat::Do(), DE_Carrots::Do(), PLWinterWheatLate::Do(), DK_CloverGrassGrazed2::Do(), FI_SpringBarley_Fodder::Do(), PLPotatoes::Do(), SE_WinterRape_Seed::Do(), DK_BushFruit_Perm1::Do(), DE_Oats::Do(), SE_WinterWheat::Do(), DE_WinterBarley::Do(), DE_Cabbage::Do(), FR_SpringWheat::Do(), DE_SpringRye::Do(), DK_SeedGrassRye_Spring::Do(), PLWinterRape::Do(), PTVineyards::Do(), FR_WinterBarley::Do(), DE_GrasslandSilageAnnual::Do(), FI_WinterWheat::Do(), DK_BushFruit_Perm2::Do(), IRSpringOats::Do(), IRSpringBarley::Do(), IRWinterOats::Do(), FR_Grassland::Do(), IRWinterBarley::Do(), FI_WinterRye::Do(), FR_WinterWheat::Do(), IRSpringWheat::Do(), DE_WinterWheatLate::Do(), DE_WinterWheat::Do(), DE_Triticale::Do(), FR_Potatoes::Do(), IRWinterWheat::Do(), FR_WinterRape::Do(), DE_WinterRape::Do(), DE_Orchard::Do(), DK_SeedGrassFescue_Spring::Do(), WinterWheat::Do(), DE_SugarBeet::Do(), DK_OrchCherry::Do(), IRGrassland_no_reseed::Do(), DE_Potatoes::Do(), DK_OrchPear::Do(), DK_OrchOther::Do(), DK_OrchApple::Do(), DK_OrchardCrop_Perm::Do(), DE_PotatoesIndustry::Do(), IRGrassland_reseed::Do(), ITOrchard::Do(), DK_ChristmasTrees_Perm::Do(), and WinterRape::HerbiZero().

◆ HillingUp()

◆ InitiateManagement()

void Farm::InitiateManagement ( void  )
virtual

Kicks off the farm's management.

Save the crop veg type as the Field vegetation type

Reimplemented in UserDefinedFarm.

1295  {
1296  for ( unsigned int i = 0; i < m_fields.size(); i++ ) {
1297  int rot_index = m_fields[ i ]->GetRotIndex();
1299  // If the field has been designated as non-rotating and therefore already has its veg type, then skip it.
1300  if ( rot_index < -1 ) {
1301  // Check for any type of permanent element type with management plan.
1302  TTypesOfLandscapeElement ele = m_fields[ i ]->GetElementType();
1303  switch (ele) {
1304  case tole_AsparagusPerm:
1305  if (this->m_OurManager->GetLandscape()->SupplyCountryCode() == "DE")
1306  {
1309  break;
1310  }
1311  else if (this->m_OurManager->GetLandscape()->SupplyCountryCode() == "NL")
1312  {
1313  new_veg = tov_DEAsparagusEstablishedPlantation; //EZ: DE management used for NL
1315  break;
1316  }
1317  else {
1318  g_msg->Warn(WARN_BUG, "Farm::InitiateManagement(): "
1319  "Unable to allocate tov type to tole_AsparagusPerm! ", "");
1320  exit(1);
1321  break;
1322  }
1323  case tole_OAsparagusPerm:
1324  if (this->m_OurManager->GetLandscape()->SupplyCountryCode() == "DE")
1325  {
1328  break;
1329  }
1330  else {
1331  g_msg->Warn(WARN_BUG, "Farm::InitiateManagement(): "
1332  "Unable to allocate tov type to tole_OAsparagusPerm! ", "");
1333  exit(1);
1334  break;
1335  }
1336  case tole_BushFruit:
1337  if (this->m_OurManager->GetLandscape()->SupplyCountryCode() == "DE")
1338  {
1339  new_veg = tov_DKBushFruit_Perm1; //EZ: 2nd year of management used here /* \todo Should this be DEBushFruit indstead */
1340  m_fields[i]->SetCropType(toc_BushFruit);
1341  break;
1342  }
1343  else if (this->m_OurManager->GetLandscape()->SupplyCountryCode() == "DK")
1344  {
1345  new_veg = tov_DKBushFruit_Perm1; //LKM: all strawberry management in this code
1346  m_fields[i]->SetCropType(toc_BushFruit);
1347  break;
1348  }
1349  else if (this->m_OurManager->GetLandscape()->SupplyCountryCode() == "BE")
1350  {
1351  new_veg = tov_DKBushFruit_Perm1; //DK management used for BE
1352  m_fields[i]->SetCropType(toc_BushFruit);
1353  break;
1354  }
1355  else if (this->m_OurManager->GetLandscape()->SupplyCountryCode() == "FI")
1356  {
1357  new_veg = tov_DKBushFruit_Perm1; //LKM: all strawberry management in this code
1358  m_fields[i]->SetCropType(toc_BushFruit);
1359  break;
1360  }
1361  else if (this->m_OurManager->GetLandscape()->SupplyCountryCode() == "NL")
1362  {
1363  new_veg = tov_DKBushFruit_Perm1; //DK management used for NL
1364  m_fields[i]->SetCropType(toc_BushFruit);
1365  break;
1366  }
1367  else if (this->m_OurManager->GetLandscape()->SupplyCountryCode() == "PL")
1368  {
1369  new_veg = tov_DKBushFruit_Perm1; //DK management used for PL
1370  m_fields[i]->SetCropType(toc_BushFruit);
1371  break;
1372  }
1373  else if (this->m_OurManager->GetLandscape()->SupplyCountryCode() == "FR")
1374  {
1375  new_veg = tov_DKBushFruit_Perm1; //LKM: all strawberry management in this code /* \todo Could probably be removed if running FR landscapes (for now NL landscapes for FR crops) */
1376  m_fields[i]->SetCropType(toc_BushFruit);
1377  break;
1378  }
1379  else {
1380  g_msg->Warn(WARN_BUG, "Farm::InitiateManagement(): "
1381  "Unable to allocate tov type to tole_BushFruit! ", "");
1382  exit(1);
1383  break;
1384  }
1385  case tole_OBushFruit:
1386  if (this->m_OurManager->GetLandscape()->SupplyCountryCode() == "DE")
1387  {
1388  new_veg = tov_DEOBushFruitPerm;
1389  m_fields[i]->SetCropType(toc_OBushFruit);
1390  break;
1391  }
1392  else if (this->m_OurManager->GetLandscape()->SupplyCountryCode() == "DK")
1393  {
1394  new_veg = tov_DKOBushFruit_Perm1; // LKM: all organic strawberry management in this code
1395  m_fields[i]->SetCropType(toc_OBushFruit);
1396  break;
1397  }
1398  else {
1399  g_msg->Warn(WARN_BUG, "Farm::InitiateManagement(): "
1400  "Unable to allocate tov type to tole_OBushFruit! ", "");
1401  exit(1);
1402  break;
1403  }
1404  case tole_ChristmasTrees:
1405  if (this->m_OurManager->GetLandscape()->SupplyCountryCode() == "DE")
1406  {
1407  new_veg = tov_DKChristmasTrees_Perm; //EZ: DK management used for DE
1408  m_fields[i]->SetCropType(toc_YoungForestCrop);
1409  break;
1410  }
1411  else if (this->m_OurManager->GetLandscape()->SupplyCountryCode() == "DK")
1412  {
1413  new_veg = tov_DKChristmasTrees_Perm;
1414  m_fields[i]->SetCropType(toc_YoungForestCrop);
1415  break;
1416  }
1417  else if (this->m_OurManager->GetLandscape()->SupplyCountryCode() == "NL")
1418  {
1419  new_veg = tov_DKChristmasTrees_Perm; //EZ: DK management used for DE
1420  m_fields[i]->SetCropType(toc_YoungForestCrop);
1421  break;
1422  }
1423  else if (this->m_OurManager->GetLandscape()->SupplyCountryCode() == "FI")
1424  {
1425  new_veg = tov_DKChristmasTrees_Perm; /* \todo Could probably be removed if running FR landscapes (for now NL landscapes for FR crops) */
1426  m_fields[i]->SetCropType(toc_YoungForestCrop);
1427  break;
1428  }
1429  if (this->m_OurManager->GetLandscape()->SupplyCountryCode() == "BE")
1430  {
1431  new_veg = tov_DKChristmasTrees_Perm; //EZ: DK management used for BE
1432  m_fields[i]->SetCropType(toc_YoungForestCrop);
1433  break;
1434  }
1435  else {
1436  g_msg->Warn(WARN_BUG, "Farm::InitiateManagement(): "
1437  "Unable to allocate tov type to tole_ChristmasTrees! ", "");
1438  exit(1);
1439  break;
1440  }
1441  case tole_OChristmasTrees:
1442  if (this->m_OurManager->GetLandscape()->SupplyCountryCode() == "DE")
1443  {
1444  new_veg = tov_DKOChristmasTrees_Perm; //EZ: DK crop code used for DE -> to be changed later
1445  m_fields[i]->SetCropType(toc_YoungForestCrop);
1446  }
1447  else if (this->m_OurManager->GetLandscape()->SupplyCountryCode() == "DK")
1448  {
1449  new_veg = tov_DKOChristmasTrees_Perm; //
1450  m_fields[i]->SetCropType(toc_YoungForestCrop);
1451  break;
1452  }
1453  else {
1454  g_msg->Warn(WARN_BUG, "Farm::InitiateManagement(): "
1455  "Unable to allocate tov type to tole_OChristmasTrees! ", "");
1456  exit(1);
1457  break;
1458  }
1459  case tole_EnergyCrop:
1460  if (this->m_OurManager->GetLandscape()->SupplyCountryCode() == "DE")
1461  {
1462  new_veg = tov_DKEnergyCrop_Perm; //EZ: DK management used for DE
1463  m_fields[i]->SetCropType(toc_YoungForestCrop);
1464  break;
1465  }
1466  else if (this->m_OurManager->GetLandscape()->SupplyCountryCode() == "DK")
1467  {
1468  new_veg = tov_DKEnergyCrop_Perm;
1469  m_fields[i]->SetCropType(toc_YoungForestCrop);
1470  break;
1471  }
1472  else if (this->m_OurManager->GetLandscape()->SupplyCountryCode() == "FR")
1473  {
1474  new_veg = tov_DKEnergyCrop_Perm;
1475  m_fields[i]->SetCropType(toc_YoungForestCrop);
1476  break;
1477  }
1478  else {
1479  g_msg->Warn(WARN_BUG, "Farm::InitiateManagement(): "
1480  "Unable to allocate tov type to tole_EnergyCrop! ", "");
1481  exit(1);
1482  break;
1483  }
1484  case tole_OEnergyCrop:
1485  if (this->m_OurManager->GetLandscape()->SupplyCountryCode() == "DE")
1486  {
1487  new_veg = tov_DKOEnergyCrop_Perm; //EZ: DK management used for DE
1488  m_fields[i]->SetCropType(toc_OYoungForestCrop);
1489  break;
1490  }
1491  else if (this->m_OurManager->GetLandscape()->SupplyCountryCode() == "DK")
1492  {
1493  new_veg = tov_DKOEnergyCrop_Perm;
1494  m_fields[i]->SetCropType(toc_OYoungForestCrop);
1495  break;
1496  }
1497  else {
1498  g_msg->Warn(WARN_BUG, "Farm::InitiateManagement(): "
1499  "Unable to allocate tov type to tole_OEnergyCrop! ", "");
1500  exit(1);
1501  break;
1502  }
1503  case tole_FarmBufferZone:
1504  if (this->m_OurManager->GetLandscape()->SupplyCountryCode() == "FI")
1505  {
1506  new_veg = tov_FIBufferZone_Perm;
1507  m_fields[i]->SetCropType(toc_PermanentSetAside);
1508  break;
1509  }
1510  else if (this->m_OurManager->GetLandscape()->SupplyCountryCode() == "FR")
1511  {
1512  new_veg = tov_FIBufferZone_Perm;
1513  m_fields[i]->SetCropType(toc_PermanentSetAside);
1514  break;
1515  }
1516  else {
1517  g_msg->Warn(WARN_BUG, "Farm::InitiateManagement(): "
1518  "Unable to allocate tov type to tole_FarmBufferZone! ", "");
1519  exit(1);
1520  break;
1521  }
1523  if (this->m_OurManager->GetLandscape()->SupplyCountryCode() == "FI")
1524  {
1525  new_veg = tov_FIFeedingGround;
1526  m_fields[i]->SetCropType(toc_PermanentGrassGrazed);
1527  break;
1528  }
1529  else {
1530  g_msg->Warn(WARN_BUG, "Farm::InitiateManagement(): "
1531  "Unable to allocate tov type to tole_FarmFeedingGround! ", "");
1532  exit(1);
1533  break;
1534  }
1535  case tole_FarmForest:
1536  if (this->m_OurManager->GetLandscape()->SupplyCountryCode() == "DE")
1537  {
1538  new_veg = tov_DKFarmForest_Perm; //EZ: DK management used for DE
1539  m_fields[i]->SetCropType(toc_FarmForest);
1540  break;
1541  }
1542  else if (this->m_OurManager->GetLandscape()->SupplyCountryCode() == "DK")
1543  {
1544  new_veg = tov_DKFarmForest_Perm;
1545  m_fields[i]->SetCropType(toc_FarmForest);
1546  break;
1547  }
1548  else if (this->m_OurManager->GetLandscape()->SupplyCountryCode() == "BE")
1549  {
1550  new_veg = tov_DKFarmForest_Perm;
1551  m_fields[i]->SetCropType(toc_FarmForest);
1552  break;
1553  }
1554  else if (this->m_OurManager->GetLandscape()->SupplyCountryCode() == "FI")
1555  {
1556  new_veg = tov_DKFarmForest_Perm; //EZ: DK management used for FI
1557  m_fields[i]->SetCropType(toc_FarmForest);
1558  break;
1559  }
1560  else if (this->m_OurManager->GetLandscape()->SupplyCountryCode() == "FR")
1561  {
1562  new_veg = tov_DKFarmForest_Perm;//LKM: DK management used for FR /* \todo Could probably be removed if running FR landscapes (for now NL landscapes for FR crops) */
1563  m_fields[i]->SetCropType(toc_FarmForest);
1564  break;
1565  }
1566  else if (this->m_OurManager->GetLandscape()->SupplyCountryCode() == "NL")
1567  {
1568  new_veg = tov_DKFarmForest_Perm; //EZ: DK management used for NL
1569  m_fields[i]->SetCropType(toc_FarmForest);
1570  break;
1571  }
1572  else {
1573  g_msg->Warn(WARN_BUG, "Farm::InitiateManagement(): "
1574  "Unable to allocate tov type to tole_FarmForest! ", "");
1575  exit(1);
1576  break;
1577  }
1578  case tole_OFarmForest:
1579  if (this->m_OurManager->GetLandscape()->SupplyCountryCode() == "DE")
1580  {
1581  new_veg = tov_DKOFarmForest_Perm; //DK management used for DE
1582  m_fields[i]->SetCropType(toc_OFarmForest);
1583  break;
1584  }
1585  else if (this->m_OurManager->GetLandscape()->SupplyCountryCode() == "DK")
1586  {
1587  new_veg = tov_DKOFarmForest_Perm;
1588  m_fields[i]->SetCropType(toc_OFarmForest);
1589  break;
1590  }
1591  else {
1592  g_msg->Warn(WARN_BUG, "Farm::InitiateManagement(): "
1593  "Unable to allocate tov type to tole_FarmForest! ", "");
1594  exit(1);
1595  break;
1596  }
1597  case tole_FarmYoungForest:
1598  if (this->m_OurManager->GetLandscape()->SupplyCountryCode() == "DK")
1599  {
1600  new_veg = tov_DKFarmYoungForest_Perm;
1601  m_fields[i]->SetCropType(toc_YoungForestCrop);
1602  break;
1603  }
1604  else if (this->m_OurManager->GetLandscape()->SupplyCountryCode() == "BE")
1605  {
1606  new_veg = tov_DKFarmYoungForest_Perm;
1607  m_fields[i]->SetCropType(toc_YoungForestCrop);
1608  break;
1609  }
1610  else {
1611  g_msg->Warn(WARN_BUG, "Farm::InitiateManagement(): "
1612  "Unable to allocate tov type to tole_FarmYoungForest! ", "");
1613  exit(1);
1614  break;
1615  }
1616  case tole_OFarmYoungForest:
1617  if (this->m_OurManager->GetLandscape()->SupplyCountryCode() == "DK")
1618  {
1619  new_veg = tov_DKOFarmYoungForest_Perm;
1620  m_fields[i]->SetCropType(toc_OYoungForestCrop);
1621  break;
1622  }
1623  else {
1624  g_msg->Warn(WARN_BUG, "Farm::InitiateManagement(): "
1625  "Unable to allocate tov type to tole_OFarmYoungForest! ", "");
1626  exit(1);
1627  break;
1628  }
1629  case tole_FlowersPerm:
1630  if (this->m_OurManager->GetLandscape()->SupplyCountryCode() == "NL")
1631  {
1632  new_veg = tov_NLTulips;
1633  m_fields[i]->SetCropType(toc_Tulips);
1634  break;
1635  }
1636  else if (this->m_OurManager->GetLandscape()->SupplyCountryCode() == "BE")
1637  {
1638  new_veg = tov_NLTulips;
1639  m_fields[i]->SetCropType(toc_Tulips);
1640  break;
1641  }
1642  else {
1643  g_msg->Warn(WARN_BUG, "Farm::InitiateManagement(): "
1644  "Unable to allocate tov type to tole_FlowersPerm! ", "");
1645  exit(1);
1646  break;
1647  }
1648  case tole_GreenFallow:
1649  if (this->m_OurManager->GetLandscape()->SupplyCountryCode() == "FI")
1650  {
1651  new_veg = tov_FIGreenFallow_Perm;
1652  m_fields[i]->SetCropType(toc_PermanentGrassGrazed);
1653  break;
1654  }
1655  else {
1656  g_msg->Warn(WARN_BUG, "Farm::InitiateManagement(): "
1657  "Unable to allocate tov type to tole_GreenFallow! ", "");
1658  exit(1);
1659  break;
1660  }
1661  case tole_NaturalFarmGrass:
1662  if (this->m_OurManager->GetLandscape()->SupplyCountryCode() == "FI")
1663  {
1664  new_veg = tov_FINaturalGrassland_Perm;
1665  m_fields[i]->SetCropType(toc_PermanentGrassGrazed);
1666  break;
1667  }
1668  else if (this->m_OurManager->GetLandscape()->SupplyCountryCode() == "BE")
1669  {
1670  new_veg = tov_FINaturalGrassland_Perm;
1671  m_fields[i]->SetCropType(toc_PermanentGrassGrazed);
1672  break;
1673  }
1674  else if (this->m_OurManager->GetLandscape()->SupplyCountryCode() == "NL")
1675  {
1676  new_veg = tov_FINaturalGrassland_Perm; //EZ: FI management used for NL
1677  m_fields[i]->SetCropType(toc_PermanentGrassGrazed);
1678  break;
1679  }
1680  else if (this->m_OurManager->GetLandscape()->SupplyCountryCode() == "FR")
1681  {
1682  new_veg = tov_FINaturalGrassland_Perm;
1683  m_fields[i]->SetCropType(toc_PermanentGrassGrazed);
1684  break;
1685  }
1686  else {
1687  g_msg->Warn(WARN_BUG, "Farm::InitiateManagement(): "
1688  "Unable to allocate tov type to tole_NaturalFarmGrass! ", "");
1689  exit(1);
1690  break;
1691  }
1692  case tole_Orchard:
1693  case tole_WoodyEnergyCrop:
1694  if (this->m_OurManager->GetLandscape()->SupplyCountryCode() == "BE")
1695  {
1696  new_veg = tov_BEOrchardCrop;
1697  m_fields[i]->SetCropType(toc_OrchardCrop);
1698  break;
1699  }
1700  else if (this->m_OurManager->GetLandscape()->SupplyCountryCode() == "DE")
1701  {
1702  new_veg = tov_DEOrchard;
1703  m_fields[i]->SetCropType(toc_OrchardCrop);
1704  break;
1705  }
1706  else if (this->m_OurManager->GetLandscape()->SupplyCountryCode() == "DK")
1707  {
1708  new_veg = tov_DKOrchardCrop_Perm;
1709  m_fields[i]->SetCropType(toc_OrchardCrop);
1710  break;
1711  }
1712  else if (this->m_OurManager->GetLandscape()->SupplyCountryCode() == "FI")
1713  {
1714  new_veg = tov_DKOrchardCrop_Perm; //EZ: DK crop code used for FI -> to be changed later
1715  m_fields[i]->SetCropType(toc_OrchardCrop);
1716  break;
1717  }
1718  else if (this->m_OurManager->GetLandscape()->SupplyCountryCode() == "FR")
1719  {
1720  new_veg = tov_DKOrchardCrop_Perm;//LKM: DK management used for FR /* \todo Could probably be removed if running FR landscapes (for now NL landscapes for FR crops) */
1721  m_fields[i]->SetCropType(toc_OrchardCrop);
1722  break;
1723  }
1724  else if (this->m_OurManager->GetLandscape()->SupplyCountryCode() == "IT")
1725  {
1726  new_veg = tov_ITOrchard;
1727  m_fields[i]->SetCropType(toc_OrchardCrop);
1728  break;
1729  }
1730  else if (this->m_OurManager->GetLandscape()->SupplyCountryCode() == "NL")
1731  {
1732  new_veg = tov_NLOrchardCrop;
1733  m_fields[i]->SetCropType(toc_OrchardCrop);
1734  break;
1735  }
1736  else if (this->m_OurManager->GetLandscape()->SupplyCountryCode() == "PL")
1737  {
1738  new_veg = tov_NLOrchardCrop; /* \todo EZ: NL crop code used for PL -> to be changed later */
1739  m_fields[i]->SetCropType(toc_OrchardCrop);
1740  break;
1741  }
1742  else if (this->m_OurManager->GetLandscape()->SupplyCountryCode() == "PT")
1743  {
1744  new_veg = tov_OrchardCrop;
1745  m_fields[i]->SetCropType(toc_OrchardCrop);
1746  break;
1747  }
1748  else {
1749  g_msg->Warn(WARN_BUG, "Farm::InitiateManagement(): "
1750  "Unable to allocate tov type to tole_Orchard! ", "");
1751  exit(1);
1752  break;
1753  }
1754  case tole_OOrchard:
1755  if (this->m_OurManager->GetLandscape()->SupplyCountryCode() == "DE")
1756  {
1757  new_veg = tov_DEOOrchard;
1758  m_fields[i]->SetCropType(toc_OOrchardCrop);
1759  break;
1760  }
1761  else if (this->m_OurManager->GetLandscape()->SupplyCountryCode() == "DK")
1762  {
1763  new_veg = tov_DKOOrchardCrop_Perm;
1764  m_fields[i]->SetCropType(toc_OOrchardCrop);
1765  break;
1766  }
1767  else if (this->m_OurManager->GetLandscape()->SupplyCountryCode() == "IT")
1768  {
1769  new_veg = tov_ITOOrchard;
1770  m_fields[i]->SetCropType(toc_OOrchardCrop);
1771  break;
1772  }
1773  else {
1774  g_msg->Warn(WARN_BUG, "Farm::InitiateManagement(): "
1775  "Unable to allocate tov type to tole_Orchard! ", "");
1776  exit(1);
1777  break;
1778  }
1779  case tole_PermPasture:
1780  if (this->m_OurManager->GetLandscape()->SupplyCountryCode() == "DE")
1781  {
1782  new_veg = tov_DEPermanentGrassGrazed;
1783  m_fields[i]->SetCropType(toc_PermanentGrassGrazed);
1784  break;
1785  }
1786  else if (this->m_OurManager->GetLandscape()->SupplyCountryCode() == "DK")
1787  {
1788  new_veg = tov_DKGrassGrazed_Perm;
1789  m_fields[i]->SetCropType(toc_PermanentGrassGrazed);
1790  break;
1791  }
1792  else if (this->m_OurManager->GetLandscape()->SupplyCountryCode() == "BE")
1793  {
1794  new_veg = tov_DKGrassGrazed_Perm;
1795  m_fields[i]->SetCropType(toc_PermanentGrassGrazed);
1796  break;
1797  }
1798  else if (this->m_OurManager->GetLandscape()->SupplyCountryCode() == "FI")
1799  {
1800  new_veg = tov_FINaturalGrassland_Perm;
1801  m_fields[i]->SetCropType(toc_PermanentGrassGrazed);
1802  break;
1803  }
1804  else if (this->m_OurManager->GetLandscape()->SupplyCountryCode() == "FR")
1805  {
1806  new_veg = tov_FRGrassland_Perm;
1807  m_fields[i]->SetCropType(toc_PermanentGrassGrazed);
1808  break;
1809  }
1810  else if (this->m_OurManager->GetLandscape()->SupplyCountryCode() == "IT")
1811  {
1812  new_veg = tov_ITGrassland;
1813  m_fields[i]->SetCropType(toc_PermanentGrassGrazed);
1814  break;
1815  }
1816  else if (this->m_OurManager->GetLandscape()->SupplyCountryCode() == "NL")
1817  {
1818  new_veg = tov_NLPermanentGrassGrazed;
1819  m_fields[i]->SetCropType(toc_PermanentGrassGrazed);
1820  break;
1821  }
1822  else if (this->m_OurManager->GetLandscape()->SupplyCountryCode() == "PL")
1823  {
1824  new_veg = tov_DEPermanentGrassGrazed; /* \todo EZ: DE crop code used for PL -> to be changed later */
1825  m_fields[i]->SetCropType(toc_PermanentGrassGrazed);
1826  break;
1827  }
1828  else if (this->m_OurManager->GetLandscape()->SupplyCountryCode() == "PT")
1829  {
1830  new_veg = tov_PTPermanentGrassGrazed;
1831  m_fields[i]->SetCropType(toc_PermanentGrassGrazed);
1832  break;
1833  }
1834  else if (this->m_OurManager->GetLandscape()->SupplyCountryCode() == "UK")
1835  {
1836  new_veg = tov_UKPermanentGrass;
1837  m_fields[i]->SetCropType(toc_PermanentGrassGrazed);
1838  break;
1839  }
1840 
1841  else {
1842  g_msg->Warn(WARN_BUG, "Farm::InitiateManagement(): "
1843  "Unable to allocate tov type to tole_PermPasture! ", "");
1844  exit(1);
1845  break;
1846  }
1847  case tole_OPermPasture:
1848  if (this->m_OurManager->GetLandscape()->SupplyCountryCode() == "DE")
1849  {
1850  new_veg = tov_DEOPermanentGrassGrazed;
1851  m_fields[i]->SetCropType(toc_OPermanentGrassGrazed);
1852  break;
1853  }
1854  else if (this->m_OurManager->GetLandscape()->SupplyCountryCode() == "DK")
1855  {
1856  new_veg = tov_DKOGrassGrazed_Perm;
1857  m_fields[i]->SetCropType(toc_OPermanentGrassGrazed);
1858  break;
1859  }
1860  else {
1861  g_msg->Warn(WARN_BUG, "Farm::InitiateManagement(): "
1862  "Unable to allocate tov type to tole_OPermPasture! ", "");
1863  exit(1);
1864  break;
1865  }
1867  if (this->m_OurManager->GetLandscape()->SupplyCountryCode() == "DE")
1868  {
1869  new_veg = tov_DEPermanentGrassLowYield;
1870  m_fields[i]->SetCropType(toc_PermanentGrassLowYield);
1871  break;
1872  }
1873  else if (this->m_OurManager->GetLandscape()->SupplyCountryCode() == "DK")
1874  {
1875  new_veg = tov_DKGrassLowYield_Perm;
1876  m_fields[i]->SetCropType(toc_PermanentGrassLowYield);
1877  break;
1878  }
1879  else if (this->m_OurManager->GetLandscape()->SupplyCountryCode() == "NL")
1880  {
1882  m_fields[i]->SetCropType(toc_PermanentGrassLowYield);
1883  break;
1884  }
1885  else if (this->m_OurManager->GetLandscape()->SupplyCountryCode() == "PL")
1886  {
1887  new_veg = tov_DEPermanentGrassLowYield; /* \todo EZ: DE crop code used for PL -> to be changed later */
1888  m_fields[i]->SetCropType(toc_PermanentGrassLowYield);
1889  break;
1890  }
1891  else if (this->m_OurManager->GetLandscape()->SupplyCountryCode() == "FI")
1892  {
1893  new_veg = tov_DEPermanentGrassLowYield; /* \todo EZ: DE crop code used for FI -> to be changed later */
1894  m_fields[i]->SetCropType(toc_PermanentGrassLowYield);
1895  break;
1896  }
1897  else if (this->m_OurManager->GetLandscape()->SupplyCountryCode() == "FR")
1898  {
1899  new_veg = tov_DEPermanentGrassLowYield; /* \todo JC: DE crop code used for FI -> to be changed later */
1900  m_fields[i]->SetCropType(toc_PermanentGrassLowYield);
1901  break;
1902  }
1903  else {
1904  g_msg->Warn(WARN_BUG, "Farm::InitiateManagement(): "
1905  "Unable to allocate tov type to tole_PermPastureLowYield! ", "");
1906  exit(1);
1907  break;
1908  }
1910  if (this->m_OurManager->GetLandscape()->SupplyCountryCode() == "DE")
1911  {
1913  m_fields[i]->SetCropType(toc_OPermanentGrassLowYield);
1914  break;
1915  }
1916  else if (this->m_OurManager->GetLandscape()->SupplyCountryCode() == "DK")
1917  {
1918  new_veg = tov_DKOGrassLowYield_Perm;
1919  m_fields[i]->SetCropType(toc_OPermanentGrassLowYield);
1920  break;
1921  }
1922  else {
1923  g_msg->Warn(WARN_BUG, "Farm::InitiateManagement(): "
1924  "Unable to allocate tov type to tole_OPermPastureLowYield! ", "");
1925  exit(1);
1926  break;
1927  }
1928  case tole_PermPasturePigs:
1929  if (this->m_OurManager->GetLandscape()->SupplyCountryCode() == "DK")
1930  {
1931  new_veg = tov_DKGrazingPigs_Perm;
1932  m_fields[i]->SetCropType(toc_GrazingPigs);
1933  break;
1934  }
1935  else {
1936  g_msg->Warn(WARN_BUG, "Farm::InitiateManagement(): "
1937  "Unable to allocate tov type to tole_PermPasturePigs! ", "");
1938  exit(1);
1939  break;
1940  }
1941  case tole_OPermPasturePigs:
1942  if (this->m_OurManager->GetLandscape()->SupplyCountryCode() == "DK")
1943  {
1944  new_veg = tov_DKOGrazingPigs_Perm;
1945  m_fields[i]->SetCropType(toc_OGrazingPigs);
1946  break;
1947  }
1948  else {
1949  g_msg->Warn(WARN_BUG, "Farm::InitiateManagement(): "
1950  "Unable to allocate tov type to tole_OPermPasturePigs! ", "");
1951  exit(1);
1952  break;
1953  }
1954  case tole_PlantNursery:
1955  if (this->m_OurManager->GetLandscape()->SupplyCountryCode() == "DE")
1956  {
1957  new_veg = tov_DKPlantNursery_Perm; //DK management used for DE
1958  m_fields[i]->SetCropType(toc_Horticulture);
1959  break;
1960  }
1961  else if (this->m_OurManager->GetLandscape()->SupplyCountryCode() == "DK")
1962  {
1963  new_veg = tov_DKPlantNursery_Perm;
1964  m_fields[i]->SetCropType(toc_Horticulture);
1965  break;
1966  }
1967  else if (this->m_OurManager->GetLandscape()->SupplyCountryCode() == "BE")
1968  {
1969  new_veg = tov_DKPlantNursery_Perm;
1970  m_fields[i]->SetCropType(toc_Horticulture);
1971  break;
1972  }
1973  else if (this->m_OurManager->GetLandscape()->SupplyCountryCode() == "FI") /* \todo LKM probably not needed, but here due to testing with not FI landscape */
1974  {
1975  new_veg = tov_DKPlantNursery_Perm;
1976  m_fields[i]->SetCropType(toc_Horticulture);
1977  break;
1978  }
1979  else if (this->m_OurManager->GetLandscape()->SupplyCountryCode() == "FR") /* \todo LKM probably not needed, but here due to testing with not FR landscape */
1980  {
1981  new_veg = tov_DKPlantNursery_Perm;
1982  m_fields[i]->SetCropType(toc_Horticulture);
1983  break;
1984  }
1985  else if (this->m_OurManager->GetLandscape()->SupplyCountryCode() == "PL")
1986  {
1987  new_veg = tov_DKPlantNursery_Perm; //DK management used for PL
1988  m_fields[i]->SetCropType(toc_Horticulture);
1989  break;
1990  }
1991  else if (this->m_OurManager->GetLandscape()->SupplyCountryCode() == "PT")
1992  {
1993  new_veg = tov_DKPlantNursery_Perm; //DK management used for PT
1994  m_fields[i]->SetCropType(toc_Horticulture);
1995  break;
1996  }
1997  else if (this->m_OurManager->GetLandscape()->SupplyCountryCode() == "NL")
1998  {
1999  new_veg = tov_DKPlantNursery_Perm; //DK management used for NL
2000  m_fields[i]->SetCropType(toc_Horticulture);
2001  break;
2002  }
2003  else {
2004  g_msg->Warn(WARN_BUG, "Farm::InitiateManagement(): "
2005  "Unable to allocate tov type to tole_PlantNursery! ", "");
2006  exit(1);
2007  break;
2008  }
2009  case tole_Vineyard:
2010  if (this->m_OurManager->GetLandscape()->SupplyCountryCode() == "DE")
2011  {
2012  new_veg = tov_DEOrchard; /* \todo EZ: orchards used instead for DE */
2013  m_fields[i]->SetCropType(toc_OrchardCrop);
2014  break;
2015  }
2016  else if (this->m_OurManager->GetLandscape()->SupplyCountryCode() == "BE")
2017  {
2018  new_veg = tov_BEOrchardCrop; /* \todo EZ: orchards used instead for BE */
2019  m_fields[i]->SetCropType(toc_OrchardCrop);
2020  break;
2021  }
2022  else if (this->m_OurManager->GetLandscape()->SupplyCountryCode() == "FR")
2023  {
2024  new_veg = tov_DKOrchardCrop_Perm; /* \todo EZ: orchards used instead for BE */
2025  m_fields[i]->SetCropType(toc_OrchardCrop);
2026  break;
2027  }
2028  else if (this->m_OurManager->GetLandscape()->SupplyCountryCode() == "PT")
2029  {
2030  new_veg = tov_PTVineyards;
2031  m_fields[i]->SetCropType(toc_Vineyards);
2032  break;
2033  }
2034  else {
2035  g_msg->Warn(WARN_BUG, "Farm::InitiateManagement(): "
2036  "Unable to allocate tov type to tole_Vineyard! ", "");
2037  exit(1);
2038  break;
2039  }
2040  case tole_OliveGrove:
2041  if (this->m_OurManager->GetLandscape()->SupplyCountryCode() == "PT")
2042  {
2044  new_veg = tov_PTOliveGroveIntensive;
2045  m_fields[i]->SetCropType(toc_OliveGrove);
2046  }
2047  else {
2050  m_fields[i]->SetCropType(toc_OliveGrove);
2051  }
2052  else {
2054  new_veg = tov_PTOliveGroveTraditional;
2055  m_fields[i]->SetCropType(toc_OliveGrove);
2056  }
2057  else {
2058  new_veg = tov_PTOliveGroveTradOrganic;
2059  m_fields[i]->SetCropType(toc_OliveGrove);
2060  }
2061  }
2062  }
2063  break;
2064  }
2065  else {
2066  g_msg->Warn(WARN_BUG, "Farm::InitiateManagement(): "
2067  "Unable to allocate tov type to tole_OliveGrove! ", "");
2068  exit(1);
2069  break;
2070  }
2071  // Permanent crops with no specific management plan - needs to be changed later
2072  case tole_RiceField:
2073  case tole_AlmondPlantation:
2074  case tole_WalnutPlantation:
2075  case tole_MushroomPerm:
2076  case tole_OtherPermCrop:
2077  new_veg = tov_PermanentSetAside; // to be changed if the crop code is available
2078  m_fields[i]->SetCropType(toc_PermanentSetAside);
2079  break;
2080 
2081  // Old permanent crops with no specific management plan - needs to be changed later
2083  if (this->m_OurManager->GetLandscape()->SupplyCountryCode() == "DK")
2084  {
2085  new_veg = tov_DKGrassTussocky_Perm;
2086  m_fields[i]->SetCropType(toc_PermanentGrassTussocky);
2087  break;
2088  }
2089  else
2090  new_veg = tov_PermanentGrassTussocky;
2091  m_fields[i]->SetCropType(toc_PermanentGrassTussocky);
2092  break;
2093  case tole_YoungForest:
2094  new_veg = tov_YoungForest;
2095  m_fields[i]->SetCropType(toc_YoungForestCrop);
2096  break;
2098  new_veg = tov_PermanentSetAside;
2099  m_fields[i]->SetCropType(toc_PermanentSetAside);
2100  break;
2101 
2102  default:
2103  if (rot_index != -4) {
2104  // Error
2105  g_msg->Warn("Unexpected negative value in Farm::InitiateManagement","");
2106  exit(0);
2107  }
2108  else
2109  {
2110  new_veg = m_fields[i]->GetVegType();
2111  }
2112  }
2113  }
2114  else {
2115  rot_index = GetFirstCropIndex(m_fields[i]->GetElementType());
2116  new_veg = m_rotation[rot_index];
2117  // Running in fixed crop mode?
2119  int fv = g_farm_fixed_crop_type.value();
2120  new_veg = g_letype->TranslateVegTypes(fv);
2121  }
2122  }
2123  m_fields[ i ]->SetVegType( new_veg, tov_Undefined ); // lct: crop & weed
2124  //m_fields[i]->PollenNectarReset(); // Removed because control is on the management
2125  m_fields[i]->SetPollenNectarType(new_veg);
2126  m_fields[ i ]->SetRotIndex( rot_index );
2127  m_fields[ i ]->SetGrowthPhase( janfirst );
2128  if (m_fields[i]->GetUnsprayedMarginPolyRef() != -1)
2129  {
2130  LE* um = g_landscape_ptr->SupplyLEPointer(m_fields[i]->GetUnsprayedMarginPolyRef());
2131  um->SetVegType(new_veg, tov_Undefined);
2132  um->SetGrowthPhase(janfirst);
2133  um->SetPollenNectarType(new_veg);
2134  }
2136  m_fields[ i ]->SetCropType(m_OurManager->GetCropTypeFromPlan(new_veg));
2137  // Reset event timeout counter. We are now 800 days from
2138  // oblivion.
2139  long prog_start_date = g_date->Date();
2140  m_fields[i]->SetVegStore(0);
2141  TTypesOfVegetation l_tov = new_veg;
2142  int l_nextcropstartdate = GetNextCropStartDate(m_fields[i], l_tov);
2143  bool SpringOK = GetForceSpringOK(l_tov);
2144  AddNewEvent(new_veg, prog_start_date, m_fields[i], PROG_START, 0, false, l_nextcropstartdate, true, l_tov, fmc_Others, true, SpringOK);
2145  }
2146 }

References cfg_OliveGroveIntensivePct, cfg_OliveGroveSuperIntensivePct, cfg_OliveGroveTradPct, Calendar::Date(), fmc_Others, g_date, g_farm_fixed_crop_enable, g_farm_fixed_crop_type, g_landscape_ptr, g_letype, g_msg, janfirst, PROG_START, LE::SetGrowthPhase(), LE::SetPollenNectarType(), LE::SetVegType(), Landscape::SupplyLEPointer(), toc_AsparagusEstablishedPlantation, toc_BushFruit, toc_FarmForest, toc_GrazingPigs, toc_Horticulture, toc_OAsparagusEstablishedPlantation, toc_OBushFruit, toc_OFarmForest, toc_OGrazingPigs, toc_OliveGrove, toc_OOrchardCrop, toc_OPermanentGrassGrazed, toc_OPermanentGrassLowYield, toc_OrchardCrop, toc_OYoungForestCrop, toc_PermanentGrassGrazed, toc_PermanentGrassLowYield, toc_PermanentGrassTussocky, toc_PermanentSetAside, toc_Tulips, toc_Vineyards, toc_YoungForestCrop, tole_AlmondPlantation, tole_AsparagusPerm, tole_BushFruit, tole_ChristmasTrees, tole_EnergyCrop, tole_FarmBufferZone, tole_FarmFeedingGround, tole_FarmForest, tole_FarmYoungForest, tole_FlowersPerm, tole_GreenFallow, tole_MushroomPerm, tole_NaturalFarmGrass, tole_OAsparagusPerm, tole_OBushFruit, tole_OChristmasTrees, tole_OEnergyCrop, tole_OFarmForest, tole_OFarmYoungForest, tole_OliveGrove, tole_OOrchard, tole_OPermPasture, tole_OPermPastureLowYield, tole_OPermPasturePigs, tole_Orchard, tole_OtherPermCrop, tole_PermanentSetaside, tole_PermPasture, tole_PermPastureLowYield, tole_PermPasturePigs, tole_PermPastureTussocky, tole_PlantNursery, tole_RiceField, tole_Vineyard, tole_WalnutPlantation, tole_WoodyEnergyCrop, tole_YoungForest, tov_BEOrchardCrop, tov_DEAsparagusEstablishedPlantation, tov_DEOAsparagusEstablishedPlantation, tov_DEOBushFruitPerm, tov_DEOOrchard, tov_DEOPermanentGrassGrazed, tov_DEOPermanentGrassLowYield, tov_DEOrchard, tov_DEPermanentGrassGrazed, tov_DEPermanentGrassLowYield, tov_DKBushFruit_Perm1, tov_DKChristmasTrees_Perm, tov_DKEnergyCrop_Perm, tov_DKFarmForest_Perm, tov_DKFarmYoungForest_Perm, tov_DKGrassGrazed_Perm, tov_DKGrassLowYield_Perm, tov_DKGrassTussocky_Perm, tov_DKGrazingPigs_Perm, tov_DKOBushFruit_Perm1, tov_DKOChristmasTrees_Perm, tov_DKOEnergyCrop_Perm, tov_DKOFarmForest_Perm, tov_DKOFarmYoungForest_Perm, tov_DKOGrassGrazed_Perm, tov_DKOGrassLowYield_Perm, tov_DKOGrazingPigs_Perm, tov_DKOOrchardCrop_Perm, tov_DKOrchardCrop_Perm, tov_DKPlantNursery_Perm, tov_FIBufferZone_Perm, tov_FIFeedingGround, tov_FIGreenFallow_Perm, tov_FINaturalGrassland_Perm, tov_FRGrassland_Perm, tov_ITGrassland, tov_ITOOrchard, tov_ITOrchard, tov_NLOrchardCrop, tov_NLPermanentGrassGrazed, tov_NLPermanentGrassGrazedExtensive, tov_NLTulips, tov_OrchardCrop, tov_PermanentGrassTussocky, tov_PermanentSetAside, tov_PTOliveGroveIntensive, tov_PTOliveGroveSuperIntensive, tov_PTOliveGroveTraditional, tov_PTOliveGroveTradOrganic, tov_PTPermanentGrassGrazed, tov_PTVineyards, tov_UKPermanentGrass, tov_Undefined, tov_YoungForest, LE_TypeClass::TranslateVegTypes(), CfgInt::value(), CfgFloat::value(), CfgBool::value(), MapErrorMsg::Warn(), and WARN_BUG.

Referenced by UserDefinedFarm::InitiateManagement().

◆ Insecticide()

void Farm::Insecticide ( int  a_area)
virtual

Records the costs of insecticide treatment, and associated score changes.

6047 {
6048  // We need to look up the return on cost of applying the insecticide to a_tov
6049  // Then tell the farmer that he spent this money
6050  // In this case there is a change to risk or environmental impact
6051  /*
6052  m_OurFarmer->AddCost(m_InsecticideCost);
6053  m_OurFarmer->ChangeRiskScore(m_InsecticideRiskChange);
6054  m_OurFarmer->ChangeEnvironmentScore(m_EnvironmentalRiskChange);
6055  */
6056 }

◆ InsecticideTreat()

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

Apply insecticide to a_field.

2136 {
2137  FarmToDo treatment = insecticide_treat;
2138  if (0 >= a_days)
2139  {
2140  if ((!(a_field->GetSignal() & LE_SIG_NO_INSECTICIDE)))
2141  {
2142  a_field->Trace(treatment);
2143  a_field->SetLastTreatment(treatment);
2145  {
2146  a_field->Insecticide(0.36);
2147  }
2150  }
2151  CalculateTreatmentCosts(treatment, a_field);
2152  return true;
2153  }
2154  else if ((g_weather->GetWind() < cfg_pest_max_wind.value()) &&
2155  (!g_weather->Raining()) && DoIt(DO_IT_PROB)) {
2156  if (!(a_field->GetSignal() & LE_SIG_NO_INSECTICIDE)) {
2157  a_field->Trace(treatment);
2158  a_field->SetLastTreatment(treatment);
2160  a_field->Insecticide(0.36);
2161  }
2164  }
2165  CalculateTreatmentCosts(treatment, a_field);
2166  return true;
2167  }
2168  return false;
2169 }

References cfg_pest_max_wind, Landscape::CheckForPesticideRecord(), DO_IT_PROB, EL_TRAMLINE_DECAYTIME, g_landscape_ptr, g_weather, Weather::GetWind(), LE::Insecticide(), insecticide, insecticide_treat, l_farm_insecticide_kills, LE_SIG_NO_INSECTICIDE, Weather::Raining(), LE::SetLastTreatment(), LE::SetTramlinesDecay(), CfgFloat::value(), and CfgBool::value().

Referenced by WinterRapeStrigling::Do(), DK_CerealLegume::Do(), DK_CerealLegume_Whole::Do(), DK_Legume_Peas::Do(), DK_SpringBarley_Green::Do(), BEOrchardCrop::Do(), DK_SpringBarleySilage::Do(), DK_FodderBeet::Do(), NLOrchardCrop::Do(), DK_Legume_Beans::Do(), FI_SugarBeet::Do(), DK_SpringOats::Do(), DK_SpringOats_CC::Do(), DK_SugarBeet::Do(), UKBeans::Do(), DK_SpringWheat::Do(), Oats::Do(), DK_Legume_Whole::Do(), DummyCropPestTesting::Do(), FI_Potato_North::Do(), SpringBarleyCloverGrassStrigling::Do(), FieldPeas::Do(), FieldPeasSilage::Do(), FieldPeasStrigling::Do(), FI_StarchPotato_North::Do(), FI_PotatoIndustry_North::Do(), SpringBarleyCloverGrass::Do(), FI_Potato_South::Do(), PTOliveGroveTradOrganic::Do(), FI_PotatoIndustry_South::Do(), Triticale::Do(), FI_StarchPotato_South::Do(), Carrots::Do(), DK_SpringBarleyCloverGrass::Do(), UKSpringBarley::Do(), UKWinterBarley::Do(), DK_WinterFodderGrass::Do(), SpringBarleyPeaCloverGrassStrigling::Do(), DK_SpringBarley::Do(), DK_SpringBarley_CC::Do(), DK_SpringFodderGrass::Do(), DK_WinterCloverGrassGrazedSown::Do(), PotatoesIndustry::Do(), BEWinterBarley::Do(), BEWinterBarleyCC::Do(), SugarBeet::Do(), NLCabbageSpring::Do(), NLSpringBarleySpring::Do(), Potatoes::Do(), PTOliveGroveIntensive::Do(), FodderBeet::Do(), NorwegianPotatoes::Do(), BEWinterWheat::Do(), BEWinterWheatCC::Do(), DK_VegSeeds::Do(), DK_WinterRye::Do(), DK_WinterRye_CC::Do(), DK_Carrots_Spring::Do(), SpringBarleySKManagement::Do(), NLCabbage::Do(), DK_Carrots::Do(), SpringBarleySilage::Do(), SpringBarleySpr::Do(), UKWinterWheat::Do(), WinterRyeStrigling::Do(), SpringBarleyStrigling::Do(), SpringBarleyStriglingCulm::Do(), SpringBarleyStriglingSingle::Do(), WinterRye::Do(), NLSpringBarley::Do(), UKWinterRape::Do(), DK_Cabbages::Do(), PTOliveGroveSuperIntensive::Do(), NLWinterWheat::Do(), PLSpringBarleySpr::Do(), DK_WinterWheat::Do(), PTCabbage::Do(), PTCabbage_Hort::Do(), DK_WinterWheat_CC::Do(), SpringBarley::Do(), PTHorticulture::Do(), UKPotatoes::Do(), DK_Potato::Do(), PTOliveGroveTraditional::Do(), FI_Caraway2::Do(), SpringRape::Do(), DK_MixedVeg::Do(), PLBeetSpr::Do(), WinterWheatStrigling::Do(), WinterWheatStriglingCulm::Do(), WinterWheatStriglingSingle::Do(), PLBeans::Do(), PTMaize_Hort::Do(), PTMaize::Do(), DK_WinterRape::Do(), WinterBarleyStrigling::Do(), WinterRape::Do(), BEPotatoesSpring::Do(), DK_PotatoSeed::Do(), DE_Maize::Do(), DE_BushFruitPerm::Do(), FR_SpringBarley::Do(), DK_PotatoIndustry::Do(), DE_MaizeSilage::Do(), WinterBarley::Do(), FR_SpringOats::Do(), NLPotatoesSpring::Do(), DE_SpringBarley::Do(), BEPotatoes::Do(), FI_TurnipRape::Do(), DE_AsparagusEstablishedPlantation::Do(), FR_Maize::Do(), FR_Maize_Silage::Do(), PLMaize::Do(), NLPotatoes::Do(), PLSpringBarley::Do(), PLMaizeSilage::Do(), FI_SpringRape::Do(), NLTulips::Do(), DE_Peas::Do(), SE_SpringBarley::Do(), FI_SpringBarley_Malt::Do(), PLWinterTriticale::Do(), FR_Sunflower::Do(), DE_Legumes::Do(), DE_WinterRye::Do(), PLWinterBarley::Do(), PLBeet::Do(), DK_CloverGrassGrazed3::Do(), PLWinterWheat::Do(), FI_SprSpringBarley_Fodder::Do(), FI_SpringWheat::Do(), PLWinterWheatLate::Do(), FI_SpringOats::Do(), DK_CloverGrassGrazed2::Do(), PLSpringWheat::Do(), PLPotatoes::Do(), SE_WinterRape_Seed::Do(), DK_BushFruit_Perm1::Do(), FI_SpringBarley_Fodder::Do(), DE_WinterBarley::Do(), DE_Cabbage::Do(), DE_Oats::Do(), SE_WinterWheat::Do(), FR_SpringWheat::Do(), DE_SpringRye::Do(), PLWinterRape::Do(), PTVineyards::Do(), FR_WinterBarley::Do(), FI_WinterWheat::Do(), DK_BushFruit_Perm2::Do(), IRWinterOats::Do(), IRSpringOats::Do(), IRSpringBarley::Do(), IRWinterBarley::Do(), DE_WinterWheatLate::Do(), DE_Triticale::Do(), FR_WinterWheat::Do(), DE_WinterWheat::Do(), FI_WinterRye::Do(), IRSpringWheat::Do(), FR_Potatoes::Do(), IRWinterWheat::Do(), FR_WinterRape::Do(), DE_WinterRape::Do(), DE_Orchard::Do(), WinterWheat::Do(), DE_SugarBeet::Do(), DK_OrchCherry::Do(), DE_Potatoes::Do(), DK_OrchPear::Do(), DK_OrchOther::Do(), DK_OrchApple::Do(), DK_OrchardCrop_Perm::Do(), DE_PotatoesIndustry::Do(), ITOrchard::Do(), and ITOOrchard::Do().

◆ InvIntPartition()

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

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

3826  {
3827  //Figure out how many bitmasks we need...
3828  //4 bits have a maximum value of 15, so we need 15 masks.
3829  //Calculated as:
3830  // (2 ^ ItemCount) - 1
3831  long long int sz = (long long int) items->size();
3832  if (sz>63) {
3833  // This is a warning that we did no consider all combinations of fields but 2^63 combinations should be enough :)
3834  g_msg->WarnAddInfo(WARN_MSG,"Too many potential fields in UserDefinedFarm::InvIntPartition: ",double(sz));
3835  g_msg->WarnAddInfo(WARN_MSG,"Farm Number: ",GetFarmNumber());
3836  sz = 63;
3837  }
3838  long int calcs = (1 << sz);
3839  //Spit out the corresponding calculation for each bitmask
3840  int sum;
3841  int found = 0;
3842  int diff = 100;
3843  for (long int i=1; i<calcs; i++) {
3844  //Get the items from our array that correspond to
3845  //the on bits in our mask
3846  sum = 0;
3847  int mask = 1;
3848  for (int bit=0; bit<sz; bit++) {
3849  if ((i & mask) > 0) {
3850  sum+=(*items)[bit].pct;
3851  }
3852  mask = mask << 1;
3853  }
3854 
3855  if (abs(sum-target) < diff ){
3856  found = i;
3857  diff = abs(sum-target);
3858  if (diff<1) break; //added 01.11.12 to prevent from checking all the combinations when the right one is found
3859  }
3860  }
3861  return found;
3862 }

References g_msg, GetFarmNumber(), WARN_MSG, and MapErrorMsg::WarnAddInfo().

Referenced by AssignPermanentCrop().

◆ Irrigation()

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

Generate an 'irrigation' event with a frequency defined by a_freq in the irrigation period on a_field.

1857 {
1858  FarmToDo treatment = water;
1859  if (!g_weather->Raining())
1860  {
1861  LE* um = SetFunctionData(a_field, 1.0, 1.0, EL_TRAMLINE_DECAYTIME, treatment);
1862  }
1863  if ((g_date->DayInYear() > a_max) || (0 >= a_days))
1864  {
1865  a_field->ToggleIrrigation();
1866  int pref = a_field->GetUnsprayedMarginPolyRef();
1867  if (pref != -1) {
1868  // Must have an unsprayed margin so need to pass the information on to it
1869  LE* um = g_landscape_ptr->SupplyLEPointer(pref);
1870  if (um != nullptr) {
1871  um->ToggleIrrigation();
1872  }
1873  }
1874  return true; // Only returns true when finsihed irrigation
1875  }
1876  return false;
1877 }

References Calendar::DayInYear(), EL_TRAMLINE_DECAYTIME, g_date, g_landscape_ptr, g_weather, LE::GetUnsprayedMarginPolyRef(), Weather::Raining(), Landscape::SupplyLEPointer(), LE::ToggleIrrigation(), and water.

Referenced by PTCabbage::Do(), PTCabbage_Hort::Do(), PTHorticulture::Do(), PTPotatoes::Do(), PTMaize_Hort::Do(), PTMaize::Do(), PTSorghum::Do(), DE_OAsparagusEstablishedPlantation::Do(), DE_AsparagusEstablishedPlantation::Do(), ITOrchard::Do(), and ITOOrchard::Do().

◆ IrrigationStart()

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

Start a irrigation event on a_field today.

This is the main initiate irrigation method and as such is called at the moment irrigation is started.

1835 {
1836  FarmToDo treatment = water;
1840  if ((0 >= a_days) || ((g_weather->GetRainPeriod(g_date->Date(), 5) < 0.1) && DoIt(DO_IT_PROB)))
1841  {
1842  LE* um = SetFunctionData(a_field, 1.0, 1.0, EL_TRAMLINE_DECAYTIME, treatment);
1843  a_field->ToggleIrrigation();
1844  if (um != nullptr) {
1845  um->ToggleIrrigation();
1846  }
1847  return true;
1848  }
1849  return false;
1850 }

References Calendar::Date(), DO_IT_PROB, EL_TRAMLINE_DECAYTIME, g_date, g_weather, Weather::GetRainPeriod(), LE::ToggleIrrigation(), and water.

Referenced by PTCabbage::Do(), PTCabbage_Hort::Do(), PTHorticulture::Do(), PTPotatoes::Do(), PTMaize_Hort::Do(), PTMaize::Do(), PTSorghum::Do(), DE_OAsparagusEstablishedPlantation::Do(), and DE_AsparagusEstablishedPlantation::Do().

◆ IsStockFarmer()

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

References m_stockfarmer.

Referenced by UKMaize::Do(), WinterRapeStrigling::Do(), NLCatchCropPea::Do(), OPermanentGrassGrazed::Do(), BECatchPeaCrop::Do(), DE_OPeas::Do(), OCarrots::Do(), DK_CerealLegume::Do(), PermanentGrassGrazed::Do(), DK_CerealLegume_Whole::Do(), DK_SpringBarley_Green::Do(), DK_Legume_Peas::Do(), DK_OLegume_Peas_CC::Do(), OWinterBarleyExt::Do(), DE_OLegume::Do(), DK_SpringBarleySilage::Do(), DK_OLegume_Beans::Do(), DK_OLegume_Beans_CC::Do(), DK_OLegume_Peas::Do(), DK_OLentils::Do(), OWinterBarley::Do(), DK_MaizeSilage::Do(), DK_OLupines::Do(), DK_OSpringBarleyCloverGrass::Do(), OWinterRye::Do(), DK_Legume_Beans::Do(), DK_SpringOats::Do(), DK_SpringOats_CC::Do(), DE_OSpringRye::Do(), OOats::Do(), DE_OMaizeSilage::Do(), DE_OOats::Do(), DK_OWinterRye::Do(), DK_OCerealLegume_Whole::Do(), DE_OWinterWheat::Do(), DK_OLegume_Whole::Do(), DK_OLegume_Whole_CC::Do(), DK_OLegumeCloverGrass_Whole::Do(), OTriticale::Do(), DK_OSpringBarley_CC::Do(), DE_OMaize::Do(), DK_OWinterRye_CC::Do(), DK_Maize::Do(), UKBeans::Do(), DK_SpringWheat::Do(), NLMaizeSpring::Do(), Oats::Do(), OSpringBarleyExt::Do(), BEMaizeSpring::Do(), DK_OWinterBarley::Do(), DK_Legume_Whole::Do(), DK_OCerealLegume::Do(), OSpringBarley::Do(), DK_OSpringBarley::Do(), DK_OSugarBeet::Do(), FieldPeas::Do(), FieldPeasSilage::Do(), FieldPeasStrigling::Do(), DK_OFodderBeet::Do(), OPotatoes::Do(), DE_OWinterRape::Do(), OWinterWheat::Do(), OWinterWheatUndersown::Do(), OWinterWheatUndersownExt::Do(), BEMaize::Do(), UKBeet::Do(), OWinterRape::Do(), PLFodderLucerne2::Do(), DK_OSpringOats::Do(), DK_OSpringWheat::Do(), Carrots::Do(), DE_OSugarBeet::Do(), DE_OCabbages::Do(), NLBeetSpring::Do(), NLMaize::Do(), DK_SpringBarleyCloverGrass::Do(), DK_OVegSeeds::Do(), UKSpringBarley::Do(), UKWinterBarley::Do(), DK_WinterFodderGrass::Do(), DE_OBushFruitPerm::Do(), DK_OSpringOats_CC::Do(), DE_OPotatoes::Do(), DK_SpringBarley::Do(), DK_SpringBarley_CC::Do(), NLCarrotsSpring::Do(), DK_OMaize::Do(), DK_OMaizeSilage::Do(), DK_OWinterRape::Do(), SetAside::Do(), DK_WinterCloverGrassGrazedSown::Do(), DK_OEnergyCrop_Perm::Do(), NLBeet::Do(), NLGrassGrazedExtensive2::Do(), DE_OCarrots::Do(), NLPermanentGrassGrazedExtensive::Do(), DK_SpringFodderGrass::Do(), DK_OSpringBarleySilage::Do(), DK_OCarrots::Do(), NLCarrots::Do(), NLGrassGrazedExtensive1Spring::Do(), NLGrassGrazedExtensiveLast::Do(), DK_WinterBarley::Do(), NLCabbageSpring::Do(), NLSpringBarleySpring::Do(), PotatoesIndustry::Do(), NorwegianPotatoes::Do(), Potatoes::Do(), DK_VegSeeds::Do(), DK_EnergyCrop_Perm::Do(), SpringBarleySKManagement::Do(), DK_WinterRye::Do(), DK_WinterRye_CC::Do(), NLCabbage::Do(), NLGrassGrazedExtensive1::Do(), DK_Carrots_Spring::Do(), SpringBarleySilage::Do(), UKWinterWheat::Do(), WinterRyeStrigling::Do(), SpringBarleySpr::Do(), DK_OGrassGrazed_Perm::Do(), PLCarrots::Do(), DK_Carrots::Do(), SpringBarleyStriglingSingle::Do(), TestCrop::Do(), SpringBarleyStrigling::Do(), WinterRye::Do(), SpringBarleyStriglingCulm::Do(), BEGrassGrazed1Spring::Do(), NLSpringBarley::Do(), UKWinterRape::Do(), SpringBarleyPTreatment::Do(), DK_GrassGrazed_Perm::Do(), DK_OMixedVeg::Do(), NLWinterWheat::Do(), BEGrassGrazedLast::Do(), BEGrassGrazed2::Do(), PLSpringBarleySpr::Do(), PTBeans::Do(), SpringBarley::Do(), DK_WinterWheat::Do(), DK_WinterWheat_CC::Do(), DE_PermanentGrassGrazed::Do(), DK_OPotato::Do(), PTCabbage_Hort::Do(), DK_OPotatoIndustry::Do(), DK_OPotatoSeed::Do(), PTCabbage::Do(), PTOtherDryBeans::Do(), PLFodderLucerne1::Do(), PTHorticulture::Do(), UKPermanentGrass::Do(), UKPotatoes::Do(), DK_Potato::Do(), UKTempGrass::Do(), PTPotatoes::Do(), DE_HerbsPerennial_after1year::Do(), SpringRape::Do(), DK_OSeedGrassRye_Spring::Do(), DK_OBushFruit_Perm2::Do(), PTOats::Do(), DK_MixedVeg::Do(), DE_OHerbsPerennial_after1year::Do(), NLGrassGrazed2::Do(), NLPermanentGrassGrazed::Do(), PLBeetSpr::Do(), DE_HerbsPerennial_1year::Do(), WinterWheatStriglingSingle::Do(), WinterWheatStriglingCulm::Do(), WinterWheatStrigling::Do(), FI_GreenFallow_Perm::Do(), NLGrassGrazedLast::Do(), DE_OHerbsPerennial_1year::Do(), PLBeans::Do(), NLGrassGrazed1Spring::Do(), PTMaize::Do(), FI_BufferZone::Do(), PTMaize_Hort::Do(), PTWinterRye::Do(), PTWinterWheat::Do(), DE_OGrasslandSilageAnnual::Do(), PTWinterBarley::Do(), DK_WinterRape::Do(), ITGrassland::Do(), PTFodderMix::Do(), PTCloverGrassGrazed2::Do(), PTTriticale::Do(), WinterRape::Do(), PTSorghum::Do(), WinterBarleyStrigling::Do(), DK_PotatoSeed::Do(), BEPotatoesSpring::Do(), PTGrassGrazed::Do(), PTYellowLupin::Do(), DE_BushFruitPerm::Do(), NLGrassGrazed1::Do(), DE_Maize::Do(), DE_MaizeSilage::Do(), DE_OAsparagusEstablishedPlantation::Do(), DK_PotatoIndustry::Do(), FI_OSpringBarley_Fodder::Do(), FR_SpringOats::Do(), WinterBarley::Do(), NLPotatoesSpring::Do(), PTRyegrass::Do(), PLWinterRye::Do(), DK_OOrchCherry::Do(), DE_SpringBarley::Do(), DK_OSpringFodderGrass::Do(), DK_OBushFruit_Perm1::Do(), DK_OWinterWheat_CC::Do(), DE_AsparagusEstablishedPlantation::Do(), FR_Maize::Do(), DK_OCloverGrassGrazed3::Do(), DK_OCloverGrassGrazed1::Do(), DK_OCloverGrassGrazed2::Do(), DK_OWinterWheat::Do(), PLSpringBarley::Do(), NLPotatoes::Do(), PLMaize::Do(), PLMaizeSilage::Do(), NLTulips::Do(), FR_Sunflower::Do(), DE_Peas::Do(), SE_SpringBarley::Do(), PLWinterTriticale::Do(), PTCloverGrassGrazed1::Do(), DE_Legumes::Do(), DK_OOrchPear::Do(), DE_OWinterRye::Do(), DE_OTriticale::Do(), DK_OWinterFodderGrass::Do(), DE_WinterRye::Do(), PLWinterWheat::Do(), DE_OWinterBarley::Do(), DK_OOrchOther::Do(), DK_OOrchApple::Do(), DK_OOrchardCrop_Perm::Do(), FI_SprSpringBarley_Fodder::Do(), DK_OWinterCloverGrassGrazedSown::Do(), PLWinterBarley::Do(), PLBeet::Do(), PLSpringWheat::Do(), PLWinterWheatLate::Do(), DE_Carrots::Do(), PTPermanentGrassGrazed::Do(), FI_SpringBarley_Fodder::Do(), DK_BushFruit_Perm1::Do(), PLPotatoes::Do(), DE_WinterBarley::Do(), FR_SpringWheat::Do(), DE_Oats::Do(), DE_Cabbage::Do(), DK_SeedGrassRye_Spring::Do(), DE_SpringRye::Do(), PLWinterRape::Do(), DE_GrasslandSilageAnnual::Do(), DK_BushFruit_Perm2::Do(), IRWinterBarley::Do(), IRSpringOats::Do(), IRSpringBarley::Do(), IRWinterOats::Do(), IRSpringWheat::Do(), DE_WinterWheat::Do(), DE_WinterWheatLate::Do(), DE_Triticale::Do(), IRWinterWheat::Do(), DE_WinterRape::Do(), DE_Orchard::Do(), DK_SeedGrassFescue_Spring::Do(), WinterWheat::Do(), DE_SugarBeet::Do(), DK_OrchCherry::Do(), IRGrassland_no_reseed::Do(), DE_Potatoes::Do(), DK_OrchPear::Do(), DK_OrchardCrop_Perm::Do(), DK_OrchApple::Do(), DK_OrchOther::Do(), DE_PotatoesIndustry::Do(), DE_OOrchard::Do(), IRGrassland_reseed::Do(), ITOrchard::Do(), DK_OChristmasTrees_Perm::Do(), ITOOrchard::Do(), DK_ChristmasTrees_Perm::Do(), and WinterRape::HerbiZero().

◆ LeafThinning()

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

LeafThinning (leaf removal to increase areation and sun exposure of fruits, e.g., grapes) applied on a_field.

  • details needs to be added (e.g., impact on biomass, influence/impacts in species code)!
1928 {
1929  FarmToDo treatment = pruning;
1930  if ((0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
1931  SetFunctionData(a_field, 1.0, 1.0, 0, treatment);
1932  return true;
1933  }
1934  return false;
1935 }

References DO_IT_PROB, g_weather, pruning, and Weather::Raining().

Referenced by PTVineyards::Do(), ITOrchard::Do(), and ITOOrchard::Do().

◆ LeSwitch()

bool Farm::LeSwitch ( FarmEvent ev)
protected

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

810  {
811  // Ignore this event if it is from the execution of
812  // a previous management plan.
813  if (ev->m_field->GetRunNum() > ev->m_run)
814  return false;
815  // Store what we are trying to do this time.
816  // ***FN*** To be cleaned up later.
817  ev->m_field->m_tried_to_do = ev->m_todo;
818 
819  bool done = false;
820 
821  /* We loop through the loaded cropprog in the FarmManager (for the entire landscape)
822  and stop when we find the cropprog corresponding to this particular FarmEvent.
823  We then call the correct Do() function of the crop progs, beneifiting from runtime polymorphism
824  since all cropprogs are derived from the base class Crop */
825  vector<Crop*> * cropprogs = m_OurManager->GetCropMgtPlans();
826  for (unsigned int i = 0; i < cropprogs->size(); i++)
827  {
828  if ( (ev->m_event == (*cropprogs)[i]->m_tov) ||
829  (ev->m_event == tov_PlantNursery && (*cropprogs)[i]->m_tov == tov_YoungForest ) ) // Preserve logic from before: "uses youngforrest management because this effectively does nothing, but stops the crop management creating looping error"
830  {
831  done = (*cropprogs)[i]->Do(this, ev->m_field, ev);
832  break;
833  }
834 
835  }
836 
837  return done;
838 }

References FarmEvent::m_event, FarmEvent::m_field, FarmEvent::m_run, FarmEvent::m_todo, LE::m_tried_to_do, tov_PlantNursery, 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.

6075 {
6076  polylist* p_list = new polylist;
6077  int nf = (int) m_fields.size();
6078  for ( int i = 0; i < nf; i++ )
6079  {
6080  if ( m_fields[ i ]->GetOpenness() >= a_openness )
6081  {
6082  p_list->push_back( m_fields[i]->GetPoly());
6083  }
6084  }
6085  return p_list;
6086 }

References m_fields.

◆ MakeStockFarmer()

virtual void Farm::MakeStockFarmer ( void  )
inlinevirtual

◆ ManualWeeding()

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

Manual weeding on a_field - no tramlines since weeding by hand, the bush stays on field with same vegetation height, thus suspects same % insects.

2003 {
2004  FarmToDo treatment = manual_weeding;
2005  if ((0 >= a_days) || ((g_weather->GetRainPeriod(g_date->Date(), 5) < 0.1)
2006  && DoIt(DO_IT_PROB)))
2007  {
2008  SetFunctionData(a_field, 1.0, 0.95, 0, treatment);
2009  return true;
2010  }
2011  return false;
2012 }

References Calendar::Date(), DO_IT_PROB, g_date, g_weather, Weather::GetRainPeriod(), and manual_weeding.

Referenced by DK_OSugarBeet::Do(), DK_OFodderBeet::Do(), DE_OSugarBeet::Do(), DE_OCabbages::Do(), DE_OBushFruitPerm::Do(), DE_OCarrots::Do(), DK_OCabbages::Do(), DK_OCarrots::Do(), DK_Cabbages::Do(), DK_OBushFruit_Perm2::Do(), DE_BushFruitPerm::Do(), DK_BushFruit_Perm2::Do(), DE_OOrchard::Do(), DK_OChristmasTrees_Perm::Do(), and DK_ChristmasTrees_Perm::Do().

◆ Molluscicide()

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

Apply molluscicide to a_field.

2311 {
2312  FarmToDo treatment = molluscicide;
2313  if (0 >= a_days) {
2314  if ((!g_weather->Raining()) && (g_weather->GetWind() < cfg_pest_max_wind.value()) &&
2315  (!(a_field->GetSignal() & LE_SIG_NO_MOLLUSC))) {
2316  a_field->Trace(treatment);
2317  a_field->SetLastTreatment(treatment);
2320  }
2321  CalculateTreatmentCosts(treatment, a_field);
2322  return true;
2323  }
2324  else if ((0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
2325  if (!(a_field->GetSignal() & LE_SIG_NO_MOLLUSC)) {
2326  a_field->Trace(treatment);
2327  a_field->SetLastTreatment(treatment);
2330  }
2331  CalculateTreatmentCosts(treatment, a_field);
2332  return true;
2333  }
2334  return false;
2335 }

References cfg_pest_max_wind, Landscape::CheckForPesticideRecord(), DO_IT_PROB, EL_TRAMLINE_DECAYTIME, g_landscape_ptr, g_weather, Weather::GetWind(), insecticide, LE_SIG_NO_MOLLUSC, molluscicide, Weather::Raining(), LE::SetLastTreatment(), LE::SetTramlinesDecay(), and CfgFloat::value().

Referenced by DK_FodderBeet::Do(), DK_SugarBeet::Do(), DK_OSugarBeet::Do(), DK_OFodderBeet::Do(), DK_OVegSeeds::Do(), DK_OCabbages::Do(), DK_WinterBarley::Do(), DK_VegSeeds::Do(), DK_Cabbages::Do(), DK_WinterWheat::Do(), DK_WinterWheat_CC::Do(), DK_OBushFruit_Perm2::Do(), DK_MixedVeg::Do(), DK_OBushFruit_Perm1::Do(), DK_BushFruit_Perm1::Do(), PLWinterRape::Do(), DK_BushFruit_Perm2::Do(), IRWinterOats::Do(), IRWinterBarley::Do(), IRSpringOats::Do(), IRSpringBarley::Do(), IRSpringWheat::Do(), IRWinterWheat::Do(), and DE_WinterRape::Do().

◆ Mowing()

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

Physical/mechanical weed control in the between-row area using a rotary mower cutter.

434  {
435  if ((0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
436  a_field->Trace(mow);
437  a_field->SetLastTreatment(mow);
438  // 30% insect mortality
439  a_field->InsectMortality(0.7);
440  // remove vegetation partly
441  a_field->ReduceVeg(0.8);
442  int pref = a_field->GetUnsprayedMarginPolyRef();
443  if (pref != -1) {
444  // Must have an unsprayed margin so need to pass the information on to it
445  LE* um = g_landscape_ptr->SupplyLEPointer(pref);
446  um->SetLastTreatment(mow);
447  um->InsectMortality(0.7);
448  um->ReduceVeg(0.8);
449  }
450  return true;
451  }
452  return false;
453 }

References DO_IT_PROB, g_landscape_ptr, g_weather, LE::GetUnsprayedMarginPolyRef(), LE::InsectMortality(), mow, Weather::Raining(), LE::ReduceVeg(), LE::SetLastTreatment(), and Landscape::SupplyLEPointer().

Referenced by PTOliveGroveTradOrganic::Do(), PTOliveGroveIntensive::Do(), and PTOliveGroveTraditional::Do().

◆ OrganicFungicide()

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

Biocide applied on a_field.

2232 {
2233  FarmToDo treatment = org_fungicide;
2234  if ((0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
2235  a_field->Trace(treatment);
2236  a_field->SetLastTreatment(treatment);
2238  /* LKM: Assume not applied for unsprayed margins
2239  */ CalculateTreatmentCosts(treatment, a_field);
2240  return true;
2241  }
2242  return false;
2243 }

References DO_IT_PROB, EL_TRAMLINE_DECAYTIME, g_weather, org_fungicide, Weather::Raining(), LE::SetLastTreatment(), and LE::SetTramlinesDecay().

Referenced by DK_OOrchPear::Do(), DK_OOrchOther::Do(), DK_OOrchApple::Do(), DK_OOrchardCrop_Perm::Do(), and DE_OOrchard::Do().

◆ OrganicHerbicide()

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

Biocide applied on a_field.

2214 {
2215  FarmToDo treatment = org_herbicide;
2216  if ((0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
2217  a_field->Trace(treatment);
2218  a_field->SetLastTreatment(treatment);
2220  /* LKM: Assume not applied for unsprayed margins
2221  */ CalculateTreatmentCosts(treatment, a_field);
2222  return true;
2223  }
2224  return false;
2225 }

References DO_IT_PROB, EL_TRAMLINE_DECAYTIME, g_weather, org_herbicide, Weather::Raining(), LE::SetLastTreatment(), and LE::SetTramlinesDecay().

◆ OrganicInsecticide()

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

Biocide applied on a_field.

2196 {
2197  FarmToDo treatment = org_insecticide;
2198  if ((0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
2199  a_field->Trace(treatment);
2200  a_field->SetLastTreatment(treatment);
2202  /* LKM: Assume not applied for unsprayed margins
2203  */ CalculateTreatmentCosts(treatment, a_field);
2204  return true;
2205  }
2206  return false;
2207 }

References DO_IT_PROB, EL_TRAMLINE_DECAYTIME, g_weather, org_insecticide, Weather::Raining(), LE::SetLastTreatment(), and LE::SetTramlinesDecay().

Referenced by DE_OPotatoes::Do(), DK_OMixedVeg::Do(), DK_OOrchCherry::Do(), DK_OOrchPear::Do(), DK_OOrchardCrop_Perm::Do(), DK_OOrchApple::Do(), DK_OOrchOther::Do(), and DE_OOrchard::Do().

◆ Pheromone()

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

Pheromone applied on a_field - same as with org. pesticides for now.

2250 {
2251  FarmToDo treatment = pheromone;
2252  if ((0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
2253  a_field->Trace(treatment);
2254  a_field->SetLastTreatment(treatment);
2256  /* LKM: Assume not applied for unsprayed margins
2257  */ CalculateTreatmentCosts(treatment, a_field);
2258  return true;
2259  }
2260  return false;
2261 }

References DO_IT_PROB, EL_TRAMLINE_DECAYTIME, g_weather, pheromone, Weather::Raining(), LE::SetLastTreatment(), and LE::SetTramlinesDecay().

Referenced by DE_OOrchard::Do().

◆ 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.

2704 {
2705 
2706  if ((0 >= a_days) || DoIt(50 / a_days)) {
2707  a_field->TogglePigGrazing();
2708  int pref = a_field->GetUnsprayedMarginPolyRef();
2709  if (pref != -1) {
2710  // Must have an unsprayed margin so need to pass the information on to it
2711  LE* um = g_landscape_ptr->SupplyLEPointer(pref);
2712  um->TogglePigGrazing();
2713  }
2714  return true;
2715  }
2716  return false;
2717 }

References g_landscape_ptr, LE::GetUnsprayedMarginPolyRef(), Landscape::SupplyLEPointer(), and LE::TogglePigGrazing().

Referenced by DK_GrazingPigs::Do(), OGrazingPigs::Do(), DK_OGrazingPigs_Perm::Do(), DK_OGrazingPigs::Do(), DK_GrazingPigs_Perm::Do(), DK_OChristmasTrees_Perm::Do(), and DK_ChristmasTrees_Perm::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.

2680 {
2681  FarmToDo treatment = pigs_out;
2682  a_field->SetLastTreatment(treatment);
2683  a_field->Trace(treatment);
2684  // Reduce the vegetation because of grazing
2686  // make this a function of grazing pressure
2687  //and field size - perhaps in a later life
2688  int pref = a_field->GetUnsprayedMarginPolyRef();
2689  if (pref != -1) {
2690  // Must have an unsprayed margin so need to pass the information on to it
2691  LE* um = g_landscape_ptr->SupplyLEPointer(pref);
2692  um->SetLastTreatment(treatment);
2694  }
2695  CalculateTreatmentCosts(treatment, a_field); // should be there a return true?
2696  return false;
2697 }

References g_landscape_ptr, LE::GetUnsprayedMarginPolyRef(), l_farm_pig_veg_reduce, pigs_out, LE::ReduceVeg_Extended(), LE::SetLastTreatment(), Landscape::SupplyLEPointer(), and CfgFloat::value().

Referenced by DK_GrazingPigs::Do(), OGrazingPigs::Do(), DK_OGrazingPigs_Perm::Do(), DK_OGrazingPigs::Do(), and DK_GrazingPigs_Perm::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.

2651 {
2652  FarmToDo treatment = pigs_out;
2653  if ((0 >= a_days) || DoIt(DO_IT_PROB))
2654  {
2655  a_field->TogglePigGrazing();
2656  a_field->Trace(treatment);
2657  a_field->SetLastTreatment(treatment);
2658  // Reduce the vegetation because of grazing
2660  // make this a function of grazing pressure
2661  //and field size - perhaps in a later life
2662  int pref = a_field->GetUnsprayedMarginPolyRef();
2663  if (pref != -1) {
2664  // Must have an unsprayed margin so need to pass the information on to it
2665  LE* um = g_landscape_ptr->SupplyLEPointer(pref);
2668  }
2669  CalculateTreatmentCosts(treatment, a_field);
2670  return true;
2671  }
2672  return false;
2673 }

References DO_IT_PROB, g_landscape_ptr, LE::GetUnsprayedMarginPolyRef(), l_farm_pig_veg_reduce, pigs_out, LE::ReduceVeg_Extended(), LE::SetLastTreatment(), Landscape::SupplyLEPointer(), LE::TogglePigGrazing(), and CfgFloat::value().

Referenced by DK_GrazingPigs::Do(), OGrazingPigs::Do(), DK_OGrazingPigs_Perm::Do(), DK_OGrazingPigs::Do(), DK_GrazingPigs_Perm::Do(), DK_OChristmasTrees_Perm::Do(), and DK_ChristmasTrees_Perm::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)

313 {
314  if ((0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
315  SetFunctionData(a_field, 0.1, 0.0, 0,preseeding_cultivator);
316  return true;
317  }
318  return false;
319 }

References DO_IT_PROB, g_weather, preseeding_cultivator, and Weather::Raining().

Referenced by UKMaize::Do(), FI_OPotato_North::Do(), FI_OStarchPotato_South::Do(), FI_OStarchPotato_North::Do(), FI_OPotato_South::Do(), FI_OPotatoIndustry_North::Do(), FI_OPotatoIndustry_South::Do(), FI_SugarBeet::Do(), NLMaizeSpring::Do(), UKBeans::Do(), FI_Potato_North::Do(), FI_StarchPotato_North::Do(), FI_PotatoIndustry_North::Do(), FI_Potato_South::Do(), FI_PotatoIndustry_South::Do(), UKBeet::Do(), FI_StarchPotato_South::Do(), NLMaize::Do(), NLBeetSpring::Do(), UKSpringBarley::Do(), NLCarrotsSpring::Do(), NLBeet::Do(), NLGrassGrazedExtensive1Spring::Do(), NLCarrots::Do(), NLSpringBarleySpring::Do(), NLCabbageSpring::Do(), NLGrassGrazedExtensive1::Do(), NLCabbage::Do(), PLCarrots::Do(), BEGrassGrazed1Spring::Do(), NLSpringBarley::Do(), UKWinterRape::Do(), PLSpringBarleySpr::Do(), PLFodderLucerne1::Do(), UKTempGrass::Do(), PLBeetSpr::Do(), DE_HerbsPerennial_1year::Do(), NLGrassGrazed1Spring::Do(), PLBeans::Do(), DE_OHerbsPerennial_1year::Do(), DE_OGrasslandSilageAnnual::Do(), FI_OSpringBarley_Malt::Do(), NLGrassGrazed1::Do(), FI_OFabaBean::Do(), FI_OCaraway1::Do(), DE_Maize::Do(), FI_OTurnipRape::Do(), FI_GrasslandPasturePerennial1::Do(), FI_GrasslandSilagePerennial1::Do(), FI_OSpringOats::Do(), DE_MaizeSilage::Do(), FI_OSpringRape::Do(), FI_OSpringWheat::Do(), FI_OSpringBarley_Fodder::Do(), PLWinterRye::Do(), FI_GrasslandSilageAnnual::Do(), FI_TurnipRape::Do(), FI_FabaBean::Do(), PLMaizeSilage::Do(), PLSpringBarley::Do(), PLMaize::Do(), FI_OWinterRye::Do(), FI_SpringRape::Do(), FI_Caraway1::Do(), FI_SpringBarley_Malt::Do(), PLWinterTriticale::Do(), FR_Sunflower::Do(), FI_OWinterWheat::Do(), PLBeet::Do(), PLWinterBarley::Do(), PLWinterWheat::Do(), FI_SpringWheat::Do(), FI_SprSpringBarley_Fodder::Do(), PLSpringWheat::Do(), FI_SpringOats::Do(), PLWinterWheatLate::Do(), DE_Carrots::Do(), PLPotatoes::Do(), FI_SpringBarley_Fodder::Do(), DE_Oats::Do(), DE_Cabbage::Do(), FR_SpringWheat::Do(), DE_SpringRye::Do(), PLWinterRape::Do(), FR_WinterBarley::Do(), FI_WinterWheat::Do(), DE_GrasslandSilageAnnual::Do(), FI_WinterRye::Do(), FR_WinterWheat::Do(), FR_WinterRape::Do(), DE_WinterRape::Do(), DE_SugarBeet::Do(), DE_Potatoes::Do(), and DE_PotatoesIndustry::Do().

◆ PreseedingCultivatorSow()

bool Farm::PreseedingCultivatorSow ( LE a_field,
double  a_user,
int  a_days,
double  a_seed_coating_amount = -1,
PlantProtectionProducts  a_ppp = ppp_foobar 
)
virtual

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

326 {
327  if ((0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
328  LE* um = SetFunctionData(a_field, 0.1, 0.0, 0,preseeding_cultivator_sow);
329  a_field->SetGrowthPhase(sow); // as with AutumnSow treatment
330  a_field->SetLastSownVeg(a_field->GetVegType()); // as with AutumnSow treatment
331  //start the flowering period.
332  if(a_field->GetPollenNectarCurveRef()<0){
333  a_field->CalculateFlowerResourceForCropSow(a_field->GetVegType());
334  }
335  // Apply seed coating if turned on
336  if (a_seed_coating_amount > 0) {
337  g_pest->DailyQueueAddSeedCoating(a_field, a_seed_coating_amount/10000, a_ppp); // Application rate is changed from g/ha to g/m2
338  }
339  if (um != nullptr) {
340  um->SetGrowthPhase(sow);
341  um->SetLastSownVeg(a_field->GetVegType());
342  //start the flowering period.
343  if(um->GetPollenNectarCurveRef()<0){
344  um->CalculateFlowerResourceForCropSow(um->GetVegType());
345  }
346  // Apply seed coating if turned on
347  if (a_seed_coating_amount > 0) {
348  g_pest->DailyQueueAddSeedCoating(um, a_seed_coating_amount/10000, a_ppp); // Application rate is changed from g/ha to g/m2
349  }
350  }
351  return true;
352  }
353  return false;
354 }

References LE::CalculateFlowerResourceForCropSow(), Pesticide::DailyQueueAddSeedCoating(), DO_IT_PROB, g_pest, g_weather, LE::GetPollenNectarCurveRef(), preseeding_cultivator_sow, Weather::Raining(), LE::SetGrowthPhase(), LE::SetLastSownVeg(), and sow.

Referenced by NLCatchCropPea::Do(), DK_Legume_Peas::Do(), FI_OStarchPotato_North::Do(), FI_OStarchPotato_South::Do(), FI_OPotato_North::Do(), FI_OPotato_South::Do(), FI_OPotatoIndustry_North::Do(), FI_OPotatoIndustry_South::Do(), DK_MaizeSilage::Do(), DK_SpringOats_CC::Do(), FI_SugarBeet::Do(), DK_Legume_Beans::Do(), DK_SpringOats::Do(), DK_Maize::Do(), DK_SpringWheat::Do(), DK_Legume_Whole::Do(), FI_Potato_North::Do(), FI_StarchPotato_North::Do(), FI_PotatoIndustry_North::Do(), FI_Potato_South::Do(), FI_PotatoIndustry_South::Do(), FI_StarchPotato_South::Do(), DK_OVegSeeds::Do(), DK_SpringBarleyCloverGrass::Do(), UKWinterBarley::Do(), DK_OWinterRape::Do(), DK_SpringBarley_CC::Do(), DK_SpringBarley::Do(), NLSpringBarleySpring::Do(), DK_WinterBarley::Do(), DK_VegSeeds::Do(), DK_WinterRye::Do(), DK_WinterRye_CC::Do(), NLSpringBarley::Do(), NLWinterWheat::Do(), PLSpringBarleySpr::Do(), DK_WinterWheat::Do(), PTOats::Do(), PLBeetSpr::Do(), PTWinterBarley::Do(), PTWinterWheat::Do(), PTWinterRye::Do(), DK_WinterRape::Do(), PTTriticale::Do(), FI_OSpringBarley_Malt::Do(), PTYellowLupin::Do(), PTGrassGrazed::Do(), FI_OFabaBean::Do(), FI_OSpringOats::Do(), FI_OSpringRape::Do(), FI_OTurnipRape::Do(), FI_OSpringWheat::Do(), FR_SpringBarley::Do(), FR_SpringOats::Do(), FI_OSpringBarley_Fodder::Do(), PLWinterRye::Do(), DE_SpringBarley::Do(), FI_TurnipRape::Do(), FR_Sorghum::Do(), FR_Maize_Silage::Do(), FR_Maize::Do(), PLSpringBarley::Do(), FI_FabaBean::Do(), FR_WinterTriticale::Do(), FI_SpringRape::Do(), FI_SpringBarley_Malt::Do(), PLWinterTriticale::Do(), PTCloverGrassGrazed1::Do(), FI_OWinterWheat::Do(), PLWinterWheat::Do(), PLBeet::Do(), FI_SprSpringBarley_Fodder::Do(), PLWinterBarley::Do(), FI_SpringWheat::Do(), PLWinterWheatLate::Do(), PLSpringWheat::Do(), FI_SpringOats::Do(), FI_SpringBarley_Fodder::Do(), PTPermanentGrassGrazed::Do(), DE_Oats::Do(), DE_SpringRye::Do(), FI_WinterWheat::Do(), IRSpringOats::Do(), IRWinterBarley::Do(), IRWinterOats::Do(), FR_Grassland::Do(), IRSpringBarley::Do(), IRSpringWheat::Do(), IRWinterWheat::Do(), and DE_SugarBeet::Do().

◆ Prob_multiplier()

◆ ProductApplication()

bool Farm::ProductApplication ( LE a_field,
double  a_user,
int  a_days,
double  a_applicationrate,
PlantProtectionProducts  a_ppp,
bool  a_isgranularpesticide = false,
int  a_orcharddrifttype = 0 
)
virtual

Apply test pesticide to a_field.

2268 {
2269  if (a_applicationrate <= 0.0) return true;
2270 
2271  FarmToDo treatment = product_treat;
2272  // NOTE Differs from normal pesticide in that it will be done on the last
2273  // day if not managed before
2274  if (0 >= a_days) {
2275  a_field->Trace(treatment);
2276  a_field->SetLastTreatment(treatment);
2278  {
2280  }
2283  if (a_isgranularpesticide) g_pest->DailyQueueAddGranular(a_field, a_applicationrate/10000, a_ppp); // Application rate is changed from g/ha to g/m2
2284  else g_pest->DailyQueueAdd(a_field, a_applicationrate/10000, a_ppp, a_drifttype);
2285  CalculateTreatmentCosts(treatment, a_field);
2286  return true;
2287  }
2288  else {
2289  if ((!g_weather->Raining()) && (g_weather->GetWind() < cfg_pest_max_wind.value())) {
2290  a_field->Trace(treatment);
2291  a_field->SetLastTreatment(treatment);
2294  }
2297  if (a_isgranularpesticide) g_pest->DailyQueueAddGranular(a_field, a_applicationrate/10000, a_ppp);
2298  else g_pest->DailyQueueAdd(a_field, a_applicationrate/10000, a_ppp, a_drifttype);
2299  CalculateTreatmentCosts(treatment, a_field);
2300  return true;
2301  }
2302  }
2303  return false;
2304 }

References cfg_CustomInsecticidesSurvProp, cfg_pest_max_wind, Landscape::CheckForPesticideRecord(), Pesticide::DailyQueueAdd(), Pesticide::DailyQueueAddGranular(), EL_TRAMLINE_DECAYTIME, g_landscape_ptr, g_pest, g_weather, Weather::GetWind(), LE::Insecticide(), l_farm_insecticide_kills, product_treat, Weather::Raining(), LE::SetLastTreatment(), LE::SetTramlinesDecay(), testpesticide, CfgFloat::value(), and CfgBool::value().

Referenced by OrchardCrop::Do(), DK_CerealLegume_Whole::Do(), DK_CerealLegume::Do(), DK_Legume_Peas::Do(), DK_SpringBarley_Green::Do(), BEOrchardCrop::Do(), DK_SpringBarleySilage::Do(), DK_FodderBeet::Do(), NLOrchardCrop::Do(), DK_Legume_Beans::Do(), DK_SpringOats::Do(), DK_SpringOats_CC::Do(), DK_SugarBeet::Do(), DK_SpringWheat::Do(), UKBeans::Do(), DK_Legume_Whole::Do(), FI_Potato_North::Do(), FI_StarchPotato_North::Do(), FI_PotatoIndustry_North::Do(), FI_Potato_South::Do(), FI_PotatoIndustry_South::Do(), FI_StarchPotato_South::Do(), DK_SpringBarleyCloverGrass::Do(), DK_WinterFodderGrass::Do(), UKSpringBarley::Do(), UKWinterBarley::Do(), DK_SpringBarley_CC::Do(), DK_SpringBarley::Do(), DK_SpringFodderGrass::Do(), DK_WinterCloverGrassGrazedSown::Do(), BEWinterBarley::Do(), BEWinterBarleyCC::Do(), NLCabbageSpring::Do(), NLSpringBarleySpring::Do(), BEWinterWheat::Do(), BEWinterWheatCC::Do(), DK_VegSeeds::Do(), DK_WinterRye::Do(), DK_WinterRye_CC::Do(), DK_Carrots_Spring::Do(), NLCabbage::Do(), DK_Carrots::Do(), UKWinterWheat::Do(), NLSpringBarley::Do(), DK_Cabbages::Do(), SpringBarleyPTreatment::Do(), NLWinterWheat::Do(), PLSpringBarleySpr::Do(), DK_WinterWheat::Do(), DK_WinterWheat_CC::Do(), DK_Potato::Do(), UKPotatoes::Do(), FI_Caraway2::Do(), SpringRape::Do(), DK_MixedVeg::Do(), PLBeetSpr::Do(), PLBeans::Do(), DK_WinterRape::Do(), BEPotatoesSpring::Do(), DK_PotatoSeed::Do(), WinterRape::Do(), DE_BushFruitPerm::Do(), DE_Maize::Do(), FR_SpringBarley::Do(), DK_PotatoIndustry::Do(), DE_MaizeSilage::Do(), FR_SpringOats::Do(), NLPotatoesSpring::Do(), DE_SpringBarley::Do(), BEPotatoes::Do(), FI_TurnipRape::Do(), DE_AsparagusEstablishedPlantation::Do(), FR_Maize_Silage::Do(), FR_Maize::Do(), PLMaize::Do(), PLSpringBarley::Do(), NLPotatoes::Do(), PLMaizeSilage::Do(), FI_SpringRape::Do(), NLTulips::Do(), DE_Peas::Do(), FI_SpringBarley_Malt::Do(), FR_Sunflower::Do(), DE_Legumes::Do(), PLWinterTriticale::Do(), DE_WinterRye::Do(), FI_SprSpringBarley_Fodder::Do(), DK_CloverGrassGrazed3::Do(), FI_SpringWheat::Do(), PLWinterBarley::Do(), PLWinterWheat::Do(), PLBeet::Do(), DK_CloverGrassGrazed2::Do(), PLSpringWheat::Do(), PLWinterWheatLate::Do(), FI_SpringOats::Do(), PLPotatoes::Do(), FI_SpringBarley_Fodder::Do(), DK_BushFruit_Perm1::Do(), DE_Oats::Do(), DE_Cabbage::Do(), FR_SpringWheat::Do(), DE_WinterBarley::Do(), DE_SpringRye::Do(), PLWinterRape::Do(), PTVineyards::Do(), DK_BushFruit_Perm2::Do(), FR_WinterBarley::Do(), FI_WinterWheat::Do(), DE_WinterWheat::Do(), DE_WinterWheatLate::Do(), FR_WinterWheat::Do(), FI_WinterRye::Do(), DE_Triticale::Do(), FR_Potatoes::Do(), FR_WinterRape::Do(), DE_WinterRape::Do(), DE_Orchard::Do(), WinterWheat::Do(), DE_SugarBeet::Do(), DK_OrchCherry::Do(), DE_Potatoes::Do(), DK_OrchPear::Do(), DK_OrchardCrop_Perm::Do(), DK_OrchApple::Do(), DK_OrchOther::Do(), and DE_PotatoesIndustry::Do().

◆ ProductApplication_DateLimited()

bool Farm::ProductApplication_DateLimited ( LE a_field,
double  ,
int  ,
double  a_applicationrate,
PlantProtectionProducts  a_ppp,
bool  a_isgranularpesticide = false 
)
virtual

Special pesticide trial functionality.

This methods tests for date limitations

2343 {
2344  FarmToDo treatment = trial_insecticidetreat;
2346  int year = g_landscape_ptr->SupplyYearNumber();
2347  if (year < cfg_productapplicstartyear.value()) return false;
2348  if (year > cfg_productapplicendyear.value()) return false;
2349  a_field->Trace(treatment); // Debug function only
2350  a_field->SetLastTreatment(treatment);
2351  a_field->InsectMortality(cfg_CustomInsecticidesSurvProp.value()); // Change this manually if it is really a herbicide
2353  a_field->SetSprayedToday(true);
2354  if (a_isgranularpesticide) g_pest->DailyQueueAddGranular(a_field, a_applicationrate/10000, a_ppp);
2355  else g_pest->DailyQueueAdd(a_field, a_applicationrate/10000, a_ppp);
2356  CalculateTreatmentCosts(treatment, a_field);
2357  return true;
2358 }

References cfg_CustomInsecticidesSurvProp, cfg_productapplicendyear, cfg_productapplicstartyear, Pesticide::DailyQueueAdd(), Pesticide::DailyQueueAddGranular(), EL_TRAMLINE_DECAYTIME, g_landscape_ptr, g_pest, LE::InsectMortality(), LE::SetLastTreatment(), LE::SetSprayedToday(), LE::SetTramlinesDecay(), Landscape::SupplyYearNumber(), trial_insecticidetreat, CfgInt::value(), and CfgFloat::value().

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

◆ Pruning()

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

◆ ReadRotation()

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

◆ RemoveField()

void Farm::RemoveField ( LE a_field)

Removes a field from a farm.

1254  {
1255  int nf = (int) m_fields.size();
1256  for ( int i = 0; i < nf; i++ ) {
1257  if ( m_fields[ i ] == a_field ) {
1258  m_fields.erase( m_fields.begin() + i );
1259  return;
1260  }
1261  }
1262  // If we reach here there is something wrong because the field is not a
1263  // member of this farm
1264  g_msg->Warn( WARN_BUG, "Farm::RemoveField(LE* a_field): ""Unknown field! ", "" );
1265  exit( 1 );
1266 }

References g_msg, MapErrorMsg::Warn(), and WARN_BUG.

◆ RemoveHunter()

void Farm::RemoveHunter ( Hunter *  a_hunter)
inline
985  {
986  for (int h = 0; h < m_HuntersList.size(); h++) {
987  if (m_HuntersList[h] == a_hunter) {
988  m_HuntersList.erase(m_HuntersList.begin() + h);
989  }
990  }
991  }

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.

1184 {
1185  FarmToDo treatment = row_cultivation;
1186  if ((0 >= a_days) && (g_weather->GetRainPeriod(g_date->Date(), 3) < 0.1))
1187  {
1188  // Too much rain, just give up and claim we did it.
1189  CalculateTreatmentCosts(treatment, a_field);
1190  return true;
1191  }
1192 
1193  if ((0 >= a_days) ||
1194  ((g_weather->GetRainPeriod(g_date->Date(), 3) < 0.1) && DoIt(DO_IT_PROB))
1195  ) {
1196  SetFunctionData(a_field, 0.25, 0.5, EL_TRAMLINE_DECAYTIME, treatment);
1197  return true;
1198  }
1199  return false;
1200 }

References Calendar::Date(), DO_IT_PROB, EL_TRAMLINE_DECAYTIME, g_date, g_weather, Weather::GetRainPeriod(), and row_cultivation.

Referenced by WinterRapeStrigling::Do(), BroadBeans::Do(), OCarrots::Do(), DK_OLegume::Do(), DE_OPeas::Do(), OMaizeSilage::Do(), DK_OLegume_Peas_CC::Do(), DE_OLegume::Do(), DK_OLegume_Beans::Do(), DK_OLegume_Beans_CC::Do(), DK_OLegume_Peas::Do(), DK_FodderBeet::Do(), DK_OLupines::Do(), DK_MaizeSilage::Do(), DK_SugarBeet::Do(), DE_OMaizeSilage::Do(), Maize::Do(), MaizeSilage::Do(), MaizeStrigling::Do(), DK_OLegume_Whole::Do(), DK_OLegume_Whole_CC::Do(), DE_OMaize::Do(), DK_OSpringBarley_CC::Do(), DK_Maize::Do(), DK_OSpringBarley::Do(), DK_OSugarBeet::Do(), DK_OFodderBeet::Do(), DE_OWinterRape::Do(), OFodderBeet::Do(), OWinterRape::Do(), DK_OSpringOats::Do(), DK_OSpringWheat::Do(), DK_OVegSeeds::Do(), Carrots::Do(), DE_OCabbages::Do(), DE_OSugarBeet::Do(), DK_OSpringOats_CC::Do(), DK_OWinterRape::Do(), DK_OMaize::Do(), DK_OMaizeSilage::Do(), DK_OCabbages::Do(), DE_OCarrots::Do(), DK_OCarrots::Do(), SugarBeet::Do(), FodderBeet::Do(), DK_VegSeeds::Do(), DK_Carrots_Spring::Do(), DK_Carrots::Do(), DK_Cabbages::Do(), DK_OMixedVeg::Do(), DK_OPotatoSeed::Do(), DK_OPotato::Do(), DK_OPotatoIndustry::Do(), SpringRape::Do(), DE_HerbsPerennial_after1year::Do(), DK_OBushFruit_Perm2::Do(), DK_OSeedGrassRye_Spring::Do(), PLBeetSpr::Do(), DE_OHerbsPerennial_after1year::Do(), DK_MixedVeg::Do(), PLBeans::Do(), DK_WinterRape::Do(), WinterRape::Do(), DE_OAsparagusEstablishedPlantation::Do(), DK_OOrchCherry::Do(), FR_Sorghum::Do(), DK_OBushFruit_Perm1::Do(), DE_AsparagusEstablishedPlantation::Do(), DK_OOrchPear::Do(), DK_OOrchardCrop_Perm::Do(), DK_OOrchApple::Do(), PLBeet::Do(), DK_OOrchOther::Do(), DK_BushFruit_Perm1::Do(), DK_BushFruit_Perm2::Do(), DE_SugarBeet::Do(), DK_OrchCherry::Do(), DK_OrchPear::Do(), DK_OrchardCrop_Perm::Do(), DK_OrchOther::Do(), DK_OrchApple::Do(), DE_OOrchard::Do(), DK_OChristmasTrees_Perm::Do(), DK_ChristmasTrees_Perm::Do(), SpringRape::RowcolOne(), and WinterRape::RowcolOne().

◆ SetFarmNumber()

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

References m_farm_num.

◆ SetFunctionData()

LE * Farm::SetFunctionData ( LE a_field,
double  a_insecteffect,
double  a_vegreduc,
int  a_tramlinetime,
FarmToDo  a_treatment 
)

carries out standard setting of data and deals with possible unsprayed margins, returns a pointer to UM or nullptr

Sets the standard data needed for most FarmFuncs. In the case that something else is needed and there is a UM then also returns a pointer to the UM LE so that further actions can be undertaken by the calling farm fuction.

a_insecteffect is a fraction by which the current population size is multiplied - so 1.0 means no change and 0.1 means reduction by 90%. a_vegezero indicates whether to remove vegetation. a_treatment is whatever is being done e.g. autumn_plough

147 {
157  LE* um = nullptr;
158  // The trace below is for debugging checks
159  #ifdef FMDEBUG
160  a_field->Trace(a_treatment);
161  #endif
162  // Record the event for this field, so other objects can find out it has happened
163  a_field->SetLastTreatment(a_treatment);
164  // 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.
165  a_field->InsectMortality(a_insecteffect);
166  // Reduce the vegetation
167  if (a_vegreduc != 1.0)
168  if (a_vegreduc == 0.0) a_field->ZeroVeg(); else a_field->ReduceVeg(a_vegreduc);
169  // if the operation opens the tramlines record this
170  if (a_tramlinetime > 0) a_field->SetTramlinesDecay(a_tramlinetime);
171  // 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.
172  int pref = a_field->GetUnsprayedMarginPolyRef();
173  if (pref != -1) {
174  // Must have an unsprayed margin so need to pass the information on to it
175  um = g_landscape_ptr->SupplyLEPointer(pref);
176  um->SetLastTreatment(a_treatment);
177  um->InsectMortality(a_insecteffect);
178  if (a_vegreduc != 1.0)
179  if (a_vegreduc == 0.0) um->ZeroVeg(); else um->ReduceVeg(a_vegreduc);
180  if (a_tramlinetime > 0) um->SetTramlinesDecay(a_tramlinetime);
181  }
182  CalculateTreatmentCosts(a_treatment, a_field);
183  return um;
184 }

References g_landscape_ptr, LE::GetUnsprayedMarginPolyRef(), LE::InsectMortality(), LE::ReduceVeg(), LE::SetLastTreatment(), LE::SetTramlinesDecay(), Landscape::SupplyLEPointer(), and LE::ZeroVeg().

◆ SetFunctionDataNoUM()

void Farm::SetFunctionDataNoUM ( LE a_field,
double  a_insecteffect,
double  a_vegreduc,
int  a_tramlinetime,
FarmToDo  a_treatment 
)

carries out standard setting of data when UMs should be ignored

Sets the standard data needed for most FarmFuncs for when any UM should be ignored a_insecteffect is a fraction by which the current population size is multiplied - so 1.0 means no change and 0.1 means reduction by 90%. a_vegezero indicates whether to remove vegetation. a_treatment is whatever is being done e.g. autumn_plough

187 {
194  // The trace below is for debugging checks
195  a_field->Trace(a_treatment);
196  // Record the event for this field, so other objects can find out it has happened
197  a_field->SetLastTreatment(a_treatment);
198  // 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.
199  a_field->InsectMortality(a_insecteffect);
200  // Reduce the vegetation
201  if (a_vegreduc != 1.0)
202  if (a_vegreduc == 0.0) a_field->ZeroVeg(); else a_field->ReduceVeg(a_vegreduc);
203  // if the operation opens the tramlines record this
204  if (a_tramlinetime > 0) a_field->SetTramlinesDecay(a_tramlinetime);
205  CalculateTreatmentCosts(a_treatment, a_field);
206 }

References LE::InsectMortality(), LE::ReduceVeg(), LE::SetLastTreatment(), LE::SetTramlinesDecay(), and LE::ZeroVeg().

◆ SetIntensity()

void Farm::SetIntensity ( double  a_intensity)
inline
964 { m_intensity = a_intensity; }

References m_intensity.

Referenced by UserDefinedFarm::UserDefinedFarm().

◆ 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.

474 {
475  FarmToDo treatment = shallow_harrow;
476  if ((0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
477  SetFunctionData(a_field, 0.7, 0.8, 0, treatment);
478  return true;
479  }
480  return false;
481 }

References DO_IT_PROB, g_weather, Weather::Raining(), and shallow_harrow.

Referenced by UKMaize::Do(), DE_OPeas::Do(), DK_OLegume::Do(), DE_OLegume::Do(), DK_OLegume_Peas_CC::Do(), DK_OLentils::Do(), DK_OLegume_Beans_CC::Do(), DK_OLegume_Beans::Do(), DK_OLegume_Peas::Do(), DK_OLupines::Do(), DK_FodderBeet::Do(), DK_OSpringBarleyCloverGrass::Do(), DK_SugarBeet::Do(), DK_OLegume_Whole::Do(), DK_OLegume_Whole_CC::Do(), DK_OLegumeCloverGrass_Whole::Do(), DK_OSpringBarley_CC::Do(), NLMaizeSpring::Do(), DK_OSpringBarley::Do(), DK_OSugarBeet::Do(), DK_OFodderBeet::Do(), PLFodderLucerne2::Do(), PTOliveGroveTradOrganic::Do(), DE_OSugarBeet::Do(), DE_OCabbages::Do(), NLMaize::Do(), UKSpringBarley::Do(), DK_WinterFodderGrass::Do(), DK_OEnergyCrop_Perm::Do(), DK_OSpringBarleySilage::Do(), DK_OCabbages::Do(), DK_SpringFodderGrass::Do(), DK_WinterCloverGrassGrazedSown::Do(), DE_OCarrots::Do(), DK_OCarrots::Do(), NLCabbageSpring::Do(), NLSpringBarleySpring::Do(), PTOliveGroveIntensive::Do(), DK_EnergyCrop_Perm::Do(), DK_Carrots_Spring::Do(), NLCabbage::Do(), DK_Carrots::Do(), DK_Cabbages::Do(), NLSpringBarley::Do(), DK_Potato::Do(), DK_OSeedGrassRye_Spring::Do(), DK_PotatoSeed::Do(), FI_OCaraway1::Do(), DE_OAsparagusEstablishedPlantation::Do(), DK_PotatoIndustry::Do(), DK_OBushFruit_Perm1::Do(), DE_AsparagusEstablishedPlantation::Do(), FI_Caraway1::Do(), DE_WinterRye::Do(), DK_BushFruit_Perm1::Do(), SE_WinterRape_Seed::Do(), SE_WinterWheat::Do(), DE_Oats::Do(), FR_SpringWheat::Do(), DE_WinterBarley::Do(), DE_Cabbage::Do(), DE_SpringRye::Do(), DE_Triticale::Do(), DE_WinterWheatLate::Do(), and DE_WinterWheat::Do().

◆ Shredding()

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

Shredding (destruction of the pruning residues with a shredders using hammer mower) applied on a_field.

  • details needs to be added (e.g., impact on biomass, influence/impacts in species code)!
1913 {
1914  FarmToDo treatment = shredding;
1915  if ((0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
1916  SetFunctionData(a_field, 1.0, 1.0, 0, treatment);
1917  return true;
1918  }
1919  return false;
1920 }

References DO_IT_PROB, g_weather, Weather::Raining(), and shredding.

Referenced by PTOliveGroveTradOrganic::Do(), PTOliveGroveSuperIntensive::Do(), PTOliveGroveTraditional::Do(), PTVineyards::Do(), DK_OChristmasTrees_Perm::Do(), and DK_ChristmasTrees_Perm::Do().

◆ SleepAllDay()

◆ Spraying_fungins()

virtual bool Farm::Spraying_fungins ( TTypesOfVegetation  )
inlinevirtual
777 { return true; };

◆ Spraying_herbicides()

virtual bool Farm::Spraying_herbicides ( TTypesOfVegetation  )
inlinevirtual
776 { return true; };

◆ 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.

460 {
461  FarmToDo treatment = spring_harrow;
462  if ( (0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
463  SetFunctionData(a_field, 0.7, 0.0, 0, spring_harrow);
464  return true;
465  }
466  return false;
467 }

References DO_IT_PROB, g_weather, Weather::Raining(), and spring_harrow.

Referenced by NorwegianOats::Do(), NorwegianSpringBarley::Do(), BroadBeans::Do(), OSBarleySilage::Do(), OFieldPeas::Do(), OFieldPeasSilage::Do(), DK_OLegume::Do(), DE_OPeas::Do(), OCarrots::Do(), OBarleyPeaCloverGrass::Do(), OMaizeSilage::Do(), DE_OLegume::Do(), FI_OPotato_North::Do(), FI_OPotato_South::Do(), FI_OPotatoIndustry_North::Do(), DK_OLegume_Peas_CC::Do(), FI_OPotatoIndustry_South::Do(), FI_OStarchPotato_North::Do(), FI_OStarchPotato_South::Do(), DK_Legume_Peas::Do(), DK_OLegume_Beans_CC::Do(), DK_OLegume_Peas::Do(), DK_OLegume_Beans::Do(), DK_OLentils::Do(), DK_OLupines::Do(), DK_MaizeSilage::Do(), DK_OSpringBarleyCloverGrass::Do(), DE_OSpringRye::Do(), DK_SpringOats::Do(), DK_SpringOats_CC::Do(), DK_Legume_Beans::Do(), FI_SugarBeet::Do(), DE_OOats::Do(), DE_OMaizeSilage::Do(), OOats::Do(), DK_OLegume_Whole::Do(), DK_OLegumeCloverGrass_Whole::Do(), DK_OLegume_Whole_CC::Do(), DE_OMaize::Do(), DK_OptimalFlowerMix1::Do(), DK_OSpringBarley_CC::Do(), Maize::Do(), MaizeSilage::Do(), MaizeStrigling::Do(), DK_OCerealLegume_Whole::Do(), DK_SpringWheat::Do(), DK_Maize::Do(), Oats::Do(), OSpringBarleyExt::Do(), SpringBarleySeed::Do(), DK_Legume_Whole::Do(), DK_OSpringBarley::Do(), DK_OCerealLegume::Do(), DK_OSugarBeet::Do(), OSpringBarley::Do(), SpringBarleyCloverGrassStrigling::Do(), FI_Potato_North::Do(), FieldPeas::Do(), FieldPeasSilage::Do(), FieldPeasStrigling::Do(), OPotatoes::Do(), DK_OFodderBeet::Do(), FI_StarchPotato_North::Do(), SpringBarleyCloverGrass::Do(), FI_PotatoIndustry_North::Do(), OFodderBeet::Do(), FI_Potato_South::Do(), FI_PotatoIndustry_South::Do(), FI_StarchPotato_South::Do(), DK_OSpringOats::Do(), DK_OSpringWheat::Do(), DE_OSugarBeet::Do(), Carrots::Do(), DE_OCabbages::Do(), DK_OVegSeeds::Do(), DK_SpringBarleyCloverGrass::Do(), DK_OSpringOats_CC::Do(), SpringBarleyPeaCloverGrassStrigling::Do(), DK_SpringBarley_CC::Do(), DK_OMaize::Do(), DK_OMaizeSilage::Do(), DE_OPotatoes::Do(), DK_SpringBarley::Do(), DK_OSpringBarleySilage::Do(), DK_OCabbages::Do(), PotatoesIndustry::Do(), SugarBeet::Do(), DKOBroadBeans_test::Do(), Potatoes::Do(), FodderBeet::Do(), NorwegianPotatoes::Do(), SpringBarleySKManagement::Do(), PLCarrots::Do(), SpringBarleySpr::Do(), SpringBarleySilage::Do(), SpringBarleyStrigling::Do(), SpringBarleyStriglingSingle::Do(), SpringBarleyStriglingCulm::Do(), SpringBarleyPTreatment::Do(), PLSpringBarleySpr::Do(), DK_OMixedVeg::Do(), SpringBarley::Do(), DK_OPotato::Do(), DK_OPotatoIndustry::Do(), DK_OPotatoSeed::Do(), PLFodderLucerne1::Do(), PTPotatoes::Do(), DE_HerbsPerennial_after1year::Do(), SpringRape::Do(), PLBeetSpr::Do(), DE_HerbsPerennial_1year::Do(), DE_OHerbsPerennial_after1year::Do(), DE_OHerbsPerennial_1year::Do(), PLBeans::Do(), PTMaize::Do(), PTMaize_Hort::Do(), FI_OSpringBarley_Malt::Do(), PTSorghum::Do(), DK_OSetAside_AnnualFlower::Do(), DK_OSetAside_PerennialFlower::Do(), FI_OFabaBean::Do(), FI_OSpringRape::Do(), FI_OSpringOats::Do(), FI_OTurnipRape::Do(), FR_SpringBarley::Do(), OSpringBarleyPigs::Do(), FI_OSpringWheat::Do(), FI_OSpringBarley_Fodder::Do(), FR_SpringOats::Do(), FR_Sorghum::Do(), DK_OSpringFodderGrass::Do(), FR_Maize_Silage::Do(), FR_Maize::Do(), PLSpringBarley::Do(), PLMaizeSilage::Do(), PLMaize::Do(), FR_WinterTriticale::Do(), DE_Legumes::Do(), DE_Peas::Do(), SE_SpringBarley::Do(), FR_Sunflower::Do(), FI_SpringBarley_Malt::Do(), PLBeet::Do(), FI_SpringWheat::Do(), FI_SprSpringBarley_Fodder::Do(), PLSpringWheat::Do(), FI_SpringBarley_Fodder::Do(), DK_BushFruit_Perm1::Do(), PLPotatoes::Do(), SE_WinterWheat::Do(), FR_SpringWheat::Do(), FR_WinterBarley::Do(), DE_GrasslandSilageAnnual::Do(), IRSpringOats::Do(), IRSpringBarley::Do(), IRSpringWheat::Do(), FR_WinterWheat::Do(), DE_SugarBeet::Do(), DE_Potatoes::Do(), and DE_PotatoesIndustry::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.

422 {
423  if ((a_days <= 0) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
424  SetFunctionData(a_field, 0.1, 0.0, 0,spring_plough);
425  return true;
426  }
427  return false;
428 }

References DO_IT_PROB, g_weather, Weather::Raining(), and spring_plough.

Referenced by UKMaize::Do(), NorwegianOats::Do(), NorwegianSpringBarley::Do(), BroadBeans::Do(), OSBarleySilage::Do(), OFieldPeasSilage::Do(), OFieldPeas::Do(), DK_OLegume::Do(), OCarrots::Do(), DE_OPeas::Do(), DK_CerealLegume::Do(), OBarleyPeaCloverGrass::Do(), OMaizeSilage::Do(), DK_CerealLegume_Whole::Do(), DK_OCatchCrop::Do(), DK_OLegume_Peas_CC::Do(), DK_SpringBarley_Green::Do(), DE_OLegume::Do(), FI_OPotato_South::Do(), FI_OPotatoIndustry_North::Do(), FI_OPotatoIndustry_South::Do(), FI_OPotato_North::Do(), FI_OStarchPotato_North::Do(), FI_OStarchPotato_South::Do(), DK_Legume_Peas::Do(), DK_OLegume_Beans_CC::Do(), DK_SpringBarleySilage::Do(), DK_OLegume_Beans::Do(), DK_OLegume_Peas::Do(), DK_OLentils::Do(), DK_CatchCrop::Do(), DK_OLupines::Do(), DK_MaizeSilage::Do(), DK_OSpringBarleyCloverGrass::Do(), DE_OSpringRye::Do(), OOats::Do(), DK_SpringOats::Do(), DK_SpringOats_CC::Do(), DE_OOats::Do(), DK_Legume_Beans::Do(), FI_SugarBeet::Do(), DE_OMaizeSilage::Do(), Maize::Do(), MaizeSilage::Do(), MaizeStrigling::Do(), DK_OCerealLegume_Whole::Do(), DK_OLegume_Whole_CC::Do(), DK_OLegume_Whole::Do(), DK_OLegumeCloverGrass_Whole::Do(), DE_OMaize::Do(), DK_OSpringBarley_CC::Do(), NLMaizeSpring::Do(), Oats::Do(), OSpringBarleyExt::Do(), DK_SpringWheat::Do(), DK_Maize::Do(), DK_OCerealLegume::Do(), DK_OSugarBeet::Do(), OSpringBarley::Do(), DK_Legume_Whole::Do(), DK_OSpringBarley::Do(), SpringBarleySeed::Do(), DK_OFodderBeet::Do(), OPotatoes::Do(), SpringBarleyCloverGrassStrigling::Do(), FI_Potato_North::Do(), FieldPeas::Do(), FieldPeasSilage::Do(), FieldPeasStrigling::Do(), FI_StarchPotato_North::Do(), OFodderBeet::Do(), SpringBarleyCloverGrass::Do(), FI_PotatoIndustry_North::Do(), DK_OSpringOats::Do(), DK_OSpringWheat::Do(), PTOliveGroveTradOrganic::Do(), UKBeet::Do(), FI_Potato_South::Do(), FI_PotatoIndustry_South::Do(), BEBeetSpring::Do(), FI_StarchPotato_South::Do(), DE_OSugarBeet::Do(), NLBeetSpring::Do(), NLMaize::Do(), DK_OVegSeeds::Do(), DK_SpringBarleyCloverGrass::Do(), Carrots::Do(), DK_OSpringOats_CC::Do(), UKSpringBarley::Do(), NLCarrotsSpring::Do(), DK_SpringBarley::Do(), DK_SpringBarley_CC::Do(), SpringBarleyPeaCloverGrassStrigling::Do(), DK_OMaize::Do(), DK_OMaizeSilage::Do(), DE_OPotatoes::Do(), DK_OSpringBarleySilage::Do(), NLBeet::Do(), DK_SpringFodderGrass::Do(), NLCarrots::Do(), NLCabbageSpring::Do(), NLSpringBarleySpring::Do(), SugarBeet::Do(), PotatoesIndustry::Do(), NorwegianPotatoes::Do(), DKOBroadBeans_test::Do(), Potatoes::Do(), FodderBeet::Do(), PTCorkOak::Do(), DK_VegSeeds::Do(), NLCabbage::Do(), SpringBarleySKManagement::Do(), SpringBarleySpr::Do(), SpringBarleySilage::Do(), SpringBarleyStriglingCulm::Do(), SpringBarleyStrigling::Do(), SpringBarleyStriglingSingle::Do(), SpringBarleyPTreatment::Do(), NLSpringBarley::Do(), PLSpringBarleySpr::Do(), DK_OMixedVeg::Do(), SpringBarley::Do(), DK_OPotato::Do(), DK_OPotatoIndustry::Do(), DK_OPotatoSeed::Do(), UKPotatoes::Do(), PTPotatoes::Do(), PTOliveGroveTraditional::Do(), PTShrubPastures::Do(), DK_OSeedGrassRye_Spring::Do(), SpringRape::Do(), PLBeetSpr::Do(), DK_MixedVeg::Do(), PTMaize_Hort::Do(), PTMaize::Do(), FI_OSpringBarley_Malt::Do(), PTSorghum::Do(), BEPotatoesSpring::Do(), FI_OCaraway1::Do(), FI_OFabaBean::Do(), DE_Maize::Do(), FI_OSpringOats::Do(), DE_MaizeSilage::Do(), FR_SpringBarley::Do(), FI_OTurnipRape::Do(), FI_OSpringWheat::Do(), FI_OSpringRape::Do(), OSpringBarleyPigs::Do(), NLPotatoesSpring::Do(), FR_SpringOats::Do(), FI_OSpringBarley_Fodder::Do(), DK_OOrchCherry::Do(), DE_SpringBarley::Do(), FI_TurnipRape::Do(), DK_OSpringFodderGrass::Do(), FR_Maize_Silage::Do(), FR_Maize::Do(), NLPotatoes::Do(), FI_FabaBean::Do(), FI_SpringRape::Do(), FI_Caraway1::Do(), SE_SpringBarley::Do(), FI_SpringBarley_Malt::Do(), FR_Sunflower::Do(), DK_OOrchPear::Do(), DK_OOrchardCrop_Perm::Do(), FI_SprSpringBarley_Fodder::Do(), DK_OOrchOther::Do(), FI_SpringWheat::Do(), DK_OOrchApple::Do(), FI_SpringOats::Do(), DE_Carrots::Do(), FI_SpringBarley_Fodder::Do(), PLPotatoes::Do(), FR_SpringWheat::Do(), DE_Cabbage::Do(), DE_Oats::Do(), DK_SeedGrassRye_Spring::Do(), DE_SpringRye::Do(), IRSpringBarley::Do(), IRSpringOats::Do(), IRSpringWheat::Do(), FR_Potatoes::Do(), DK_SeedGrassFescue_Spring::Do(), DE_Potatoes::Do(), DK_OrchPear::Do(), DK_OrchApple::Do(), DK_OrchardCrop_Perm::Do(), DK_OrchOther::Do(), and DE_PotatoesIndustry::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.

488 {
489  FarmToDo treatment = spring_roll;
490  if ( (0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
491  SetFunctionData(a_field, 1.0, 1.0, 0, treatment);
492  return true;
493  }
494  return false;
495 }

References DO_IT_PROB, g_weather, Weather::Raining(), and spring_roll.

Referenced by NorwegianOats::Do(), NorwegianSpringBarley::Do(), BroadBeans::Do(), OSBarleySilage::Do(), OFieldPeasSilage::Do(), OFieldPeas::Do(), OBarleyPeaCloverGrass::Do(), DK_Legume_Peas::Do(), DK_OLentils::Do(), OWinterRye::Do(), DK_Legume_Beans::Do(), DE_OOats::Do(), OOats::Do(), DK_SpringOats::Do(), DK_SpringOats_CC::Do(), DE_OSpringRye::Do(), DK_OptimalFlowerMix1::Do(), DK_OLegumeCloverGrass_Whole::Do(), OTriticale::Do(), DE_OWinterWheat::Do(), Oats::Do(), OSpringBarleyExt::Do(), DK_SpringWheat::Do(), DK_Legume_Whole::Do(), OSpringBarley::Do(), SpringBarleySeed::Do(), SpringBarleyCloverGrassStrigling::Do(), FieldPeas::Do(), FieldPeasSilage::Do(), FieldPeasStrigling::Do(), OWinterWheat::Do(), OWinterWheatUndersown::Do(), OWinterWheatUndersownExt::Do(), OFodderBeet::Do(), SpringBarleyCloverGrass::Do(), Triticale::Do(), DK_OSpringOats::Do(), DK_OSpringWheat::Do(), DK_OSpringOats_CC::Do(), DK_OMaizeSilage::Do(), SpringBarleyPeaCloverGrassStrigling::Do(), DK_OMaize::Do(), DK_SpringFodderGrass::Do(), DK_OSpringBarleySilage::Do(), DK_OEnergyCrop_Perm::Do(), SugarBeet::Do(), FodderBeet::Do(), DK_EnergyCrop_Perm::Do(), SpringBarleySKManagement::Do(), WinterRyeStrigling::Do(), SpringBarleySpr::Do(), SpringBarleySilage::Do(), SpringBarleyStriglingSingle::Do(), SpringBarleyPTreatment::Do(), WinterRye::Do(), SpringBarleyStriglingCulm::Do(), SpringBarleyStrigling::Do(), SpringBarley::Do(), WinterWheatStriglingSingle::Do(), WinterWheatStrigling::Do(), WinterWheatStriglingCulm::Do(), DK_OSetAside_AnnualFlower::Do(), DK_OSetAside_PerennialFlower::Do(), OSpringBarleyPigs::Do(), DE_OTriticale::Do(), DE_OWinterRye::Do(), DE_OWinterBarley::Do(), IRSpringOats::Do(), IRSpringBarley::Do(), IRSpringWheat::Do(), WinterWheat::Do(), and IRGrassland_reseed::Do().

◆ SpringSow()

bool Farm::SpringSow ( LE a_field,
double  a_user,
int  a_days,
double  a_seed_coating_amount = -1,
PlantProtectionProducts  a_ppp = ppp_foobar 
)
virtual

Carry out a sowing event in the spring on a_field.

502 {
503  if ((0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
504  LE* um = SetFunctionData(a_field, 1.0, 1.0, 0, spring_sow);
505  a_field->SetGrowthPhase(sow);
506  a_field->SetLastSownVeg(a_field->GetVegType());
507  //start the flowering period.
508  if(a_field->GetPollenNectarCurveRef()<0){
509  a_field->CalculateFlowerResourceForCropSow(a_field->GetVegType());
510  }
511  // Apply seed coating if turned on
512  if (a_seed_coating_amount > 0) {
513  g_pest->DailyQueueAddSeedCoating(a_field, a_seed_coating_amount/10000, a_ppp); // Application rate is changed from g/ha to g/m2
514  }
515  if (um != nullptr)
516  {
517  um->SetGrowthPhase(sow);
518  um->SetLastSownVeg(um->GetVegType());
519  //start the flowering period.
520  if(um->GetPollenNectarCurveRef()<0){
521  um->CalculateFlowerResourceForCropSow(um->GetVegType());
522  }
523  // Apply seed coating if turned on
524  if (a_seed_coating_amount > 0) {
525  g_pest->DailyQueueAddSeedCoating(um, a_seed_coating_amount/10000, a_ppp); // Application rate is changed from g/ha to g/m2
526  }
527  }
528  return true;
529  }
530  return false;
531 }

References LE::CalculateFlowerResourceForCropSow(), Pesticide::DailyQueueAddSeedCoating(), DO_IT_PROB, g_pest, g_weather, LE::GetPollenNectarCurveRef(), Weather::Raining(), LE::SetGrowthPhase(), LE::SetLastSownVeg(), sow, and spring_sow.

Referenced by UKMaize::Do(), NorwegianSpringBarley::Do(), NorwegianOats::Do(), BroadBeans::Do(), OSBarleySilage::Do(), OFieldPeasSilage::Do(), OFieldPeas::Do(), DE_OPeas::Do(), OCarrots::Do(), DK_OLegume::Do(), OBarleyPeaCloverGrass::Do(), OMaizeSilage::Do(), DK_CerealLegume::Do(), DK_CerealLegume_Whole::Do(), DK_SpringBarley_Green::Do(), OWinterBarleyExt::Do(), DK_OLegume_Peas_CC::Do(), FI_OPotato_North::Do(), FI_OPotato_South::Do(), FI_OPotatoIndustry_North::Do(), FI_OPotatoIndustry_South::Do(), FI_OStarchPotato_North::Do(), FI_OStarchPotato_South::Do(), DE_OLegume::Do(), OWinterBarley::Do(), DK_SpringBarleySilage::Do(), DK_OLegume_Beans::Do(), DK_OLegume_Beans_CC::Do(), DK_OLegume_Peas::Do(), DK_OLentils::Do(), DK_OSpringBarleyCloverGrass::Do(), DK_MaizeSilage::Do(), OWinterRye::Do(), DK_OLupines::Do(), DE_OMaizeSilage::Do(), DE_OOats::Do(), OOats::Do(), DE_OSpringRye::Do(), DK_OSpringBarley_CC::Do(), DK_OCerealLegume_Whole::Do(), DK_OLegume_Whole::Do(), DK_OLegume_Whole_CC::Do(), DK_OLegumeCloverGrass_Whole::Do(), DK_OptimalFlowerMix1::Do(), DE_OMaize::Do(), Maize::Do(), MaizeSilage::Do(), MaizeStrigling::Do(), NLMaizeSpring::Do(), DK_Maize::Do(), Oats::Do(), OSpringBarleyExt::Do(), DK_OSpringBarley::Do(), DK_Legume_Whole::Do(), DK_OSugarBeet::Do(), OSpringBarley::Do(), DK_OCerealLegume::Do(), SpringBarleySeed::Do(), OPotatoes::Do(), DK_OFodderBeet::Do(), SpringBarleyCloverGrassStrigling::Do(), FI_Potato_North::Do(), FieldPeas::Do(), FieldPeasSilage::Do(), FieldPeasStrigling::Do(), FI_StarchPotato_North::Do(), OFodderBeet::Do(), SpringBarleyCloverGrass::Do(), FI_PotatoIndustry_North::Do(), DK_OSpringWheat::Do(), DK_OSpringOats::Do(), UKBeet::Do(), FI_Potato_South::Do(), FI_PotatoIndustry_South::Do(), FI_StarchPotato_South::Do(), NLBeetSpring::Do(), NLMaize::Do(), Carrots::Do(), DE_OSugarBeet::Do(), DK_OSpringOats_CC::Do(), DK_WinterFodderGrass::Do(), UKSpringBarley::Do(), DE_OPotatoes::Do(), NLCarrotsSpring::Do(), SpringBarleyPeaCloverGrassStrigling::Do(), NLBeet::Do(), DK_OSpringBarleySilage::Do(), DK_OEnergyCrop_Perm::Do(), DE_OCarrots::Do(), DK_SpringFodderGrass::Do(), DK_WinterCloverGrassGrazedSown::Do(), NLCarrots::Do(), NLGrassGrazedExtensive1Spring::Do(), DK_OCarrots::Do(), NLCabbageSpring::Do(), NLSpringBarleySpring::Do(), PotatoesIndustry::Do(), SugarBeet::Do(), NorwegianPotatoes::Do(), Potatoes::Do(), FodderBeet::Do(), DK_EnergyCrop_Perm::Do(), NLGrassGrazedExtensive1::Do(), SpringBarleySKManagement::Do(), NLCabbage::Do(), DK_Carrots_Spring::Do(), SpringBarleySpr::Do(), PLCarrots::Do(), SpringBarleySilage::Do(), DK_Carrots::Do(), NLSpringBarley::Do(), SpringBarleyPTreatment::Do(), SpringBarleyStriglingCulm::Do(), SpringBarleyStriglingSingle::Do(), SpringBarleyStrigling::Do(), PLSpringBarleySpr::Do(), DK_OMixedVeg::Do(), PTCabbage::Do(), SpringBarley::Do(), PTCabbage_Hort::Do(), DK_OPotatoIndustry::Do(), PLFodderLucerne1::Do(), DK_Potato::Do(), UKPotatoes::Do(), UKTempGrass::Do(), PTPotatoes::Do(), FI_GreenFallow_1year::Do(), DE_GreenFallow_1year::Do(), DK_OSeedGrassRye_Spring::Do(), DE_OGreenFallow_1year::Do(), SpringRape::Do(), DK_CloverGrassGrazed1::Do(), PLBeetSpr::Do(), DE_HerbsPerennial_1year::Do(), NLGrassGrazed1Spring::Do(), PLBeans::Do(), FI_GreenFallow_Perm::Do(), DE_OHerbsPerennial_1year::Do(), FI_BufferZone::Do(), DE_OGrasslandSilageAnnual::Do(), PTMaize::Do(), PTMaize_Hort::Do(), FI_BufferZone_Perm::Do(), FI_NaturalGrassland::Do(), DK_OSetAside_PerennialFlower::Do(), DK_OSetAside_AnnualFlower::Do(), DK_PotatoSeed::Do(), PTSorghum::Do(), FI_OCaraway1::Do(), NLGrassGrazed1::Do(), FI_GrasslandPasturePerennial1::Do(), DK_PotatoIndustry::Do(), FR_SpringBarley::Do(), FI_GrasslandSilagePerennial1::Do(), OSpringBarleyPigs::Do(), NLPotatoesSpring::Do(), FR_SpringOats::Do(), FI_FeedingGround::Do(), DK_OOrchCherry::Do(), FI_GrasslandSilageAnnual::Do(), DK_OSpringFodderGrass::Do(), PLMaizeSilage::Do(), PLMaize::Do(), NLPotatoes::Do(), PLSpringBarley::Do(), FI_Caraway1::Do(), DE_Legumes::Do(), DE_Peas::Do(), SE_SpringBarley::Do(), FR_Sunflower::Do(), DK_OOrchPear::Do(), DK_OOrchApple::Do(), DK_OOrchOther::Do(), PLBeet::Do(), DK_CloverGrassGrazed3::Do(), DK_OOrchardCrop_Perm::Do(), PLSpringWheat::Do(), DK_CloverGrassGrazed2::Do(), DE_Carrots::Do(), PLPotatoes::Do(), DK_BushFruit_Perm1::Do(), FR_SpringWheat::Do(), DE_Cabbage::Do(), DE_Oats::Do(), DK_SeedGrassRye_Spring::Do(), DE_SpringRye::Do(), DE_GrasslandSilageAnnual::Do(), IRSpringBarley::Do(), IRSpringOats::Do(), IRSpringWheat::Do(), FR_Potatoes::Do(), DK_SeedGrassFescue_Spring::Do(), DE_SugarBeet::Do(), DK_OrchCherry::Do(), DE_Potatoes::Do(), DK_OrchPear::Do(), DK_OrchOther::Do(), DK_OrchApple::Do(), DK_OrchardCrop_Perm::Do(), DE_PotatoesIndustry::Do(), and IRGrassland_reseed::Do().

◆ SpringSowWithFerti()

bool Farm::SpringSowWithFerti ( LE a_field,
double  a_user,
int  a_days,
double  a_seed_coating_amount = -1,
PlantProtectionProducts  a_ppp = ppp_foobar 
)
virtual

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

538 {
539  if ((0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
540  LE* um = SetFunctionData(a_field, 1.0, 1.0, 0, spring_sow_with_ferti);
541  a_field->SetGrowthPhase(sow);
542  a_field->SetLastSownVeg(a_field->GetVegType());
543  //start the flowering period.
544  if(a_field->GetPollenNectarCurveRef()<0){
545  a_field->CalculateFlowerResourceForCropSow(a_field->GetVegType());
546  }
547  // Apply seed coating if turned on
548  if (a_seed_coating_amount > 0) {
549  g_pest->DailyQueueAddSeedCoating(a_field, a_seed_coating_amount/10000, a_ppp); // Application rate is changed from g/ha to g/m2
550  }
551  if (um != nullptr)
552  {
553  um->SetGrowthPhase(sow);
554  um->SetLastSownVeg(um->GetVegType());
555  //start the flowering period.
556  if(um->GetPollenNectarCurveRef()<0){
557  um->CalculateFlowerResourceForCropSow(um->GetVegType());
558  }
559  // Apply seed coating if turned on
560  if (a_seed_coating_amount > 0) {
561  g_pest->DailyQueueAddSeedCoating(um, a_seed_coating_amount/10000, a_ppp); // Application rate is changed from g/ha to g/m2
562  }
563  }
564  return true;
565  }
566  return false;
567 }

References LE::CalculateFlowerResourceForCropSow(), Pesticide::DailyQueueAddSeedCoating(), DO_IT_PROB, g_pest, g_weather, LE::GetPollenNectarCurveRef(), Weather::Raining(), LE::SetGrowthPhase(), LE::SetLastSownVeg(), sow, and spring_sow_with_ferti.

Referenced by UKMaize::Do(), DK_FodderBeet::Do(), DK_SugarBeet::Do(), FI_SugarBeet::Do(), NLMaizeSpring::Do(), DE_OCabbages::Do(), NLMaize::Do(), DK_OMaize::Do(), DK_OMaizeSilage::Do(), DK_OCabbages::Do(), DK_Cabbages::Do(), DK_OPotato::Do(), DK_OPotatoSeed::Do(), DK_MixedVeg::Do(), FI_OSpringBarley_Malt::Do(), DE_Maize::Do(), FI_OFabaBean::Do(), DE_MaizeSilage::Do(), FI_OSpringOats::Do(), FI_OSpringRape::Do(), FI_OTurnipRape::Do(), FI_OSpringWheat::Do(), FI_OSpringBarley_Fodder::Do(), FI_TurnipRape::Do(), PLMaizeSilage::Do(), FI_FabaBean::Do(), PLMaize::Do(), FI_SpringRape::Do(), SE_SpringBarley::Do(), FI_SpringBarley_Malt::Do(), FI_SprSpringBarley_Fodder::Do(), FI_SpringWheat::Do(), FI_SpringOats::Do(), and FI_SpringBarley_Fodder::Do().

◆ StrawChopping()

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

Carry out straw chopping on a_field.

1476 {
1477  FarmToDo treatment = straw_chopping;
1478  if ( (0 >= a_days) ||
1479  ((g_weather->GetRainPeriod(g_date->Date(),5)<0.1) && DoIt(DO_IT_PROB))
1480  ) {
1481  SetFunctionData(a_field, 0.4, 1.0, 0, treatment);
1482  return true;
1483  }
1484  return false;
1485 }

References Calendar::Date(), DO_IT_PROB, g_date, g_weather, Weather::GetRainPeriod(), and straw_chopping.

Referenced by UKMaize::Do(), OSeedGrass1::Do(), WinterRapeStrigling::Do(), OSeedGrass2::Do(), OFieldPeas::Do(), SeedGrass1::Do(), DK_CerealLegume::Do(), DK_CerealLegume_Whole::Do(), DK_SpringBarley_Green::Do(), OWinterBarleyExt::Do(), OWinterBarley::Do(), DK_SpringBarleySilage::Do(), SeedGrass2::Do(), OWinterRye::Do(), DK_OSpringBarleyCloverGrass::Do(), DK_OWinterRye::Do(), OOats::Do(), DE_OOats::Do(), DE_OSpringRye::Do(), DK_OWinterRye_CC::Do(), DE_OWinterWheat::Do(), OTriticale::Do(), DK_OLegumeCloverGrass_Whole::Do(), DK_OSpringBarley_CC::Do(), DK_OWinterBarley::Do(), NLMaizeSpring::Do(), Oats::Do(), DK_Maize::Do(), OSpringBarleyExt::Do(), OSpringBarley::Do(), DK_Legume_Whole::Do(), DK_OSpringBarley::Do(), FieldPeas::Do(), FieldPeasSilage::Do(), FieldPeasStrigling::Do(), DE_OWinterRape::Do(), OWinterWheat::Do(), OWinterWheatUndersown::Do(), OWinterWheatUndersownExt::Do(), DK_OSpringWheat::Do(), OWinterRape::Do(), Triticale::Do(), DK_OSpringOats::Do(), NLMaize::Do(), DK_SpringBarleyCloverGrass::Do(), DK_OSpringOats_CC::Do(), UKWinterBarley::Do(), UKSpringBarley::Do(), DK_SpringBarley::Do(), DK_SpringBarley_CC::Do(), DK_OMaize::Do(), DK_OMaizeSilage::Do(), DK_OSpringBarleySilage::Do(), NLSpringBarleySpring::Do(), SpringBarleySKManagement::Do(), DK_OGrassGrazed_Perm::Do(), SpringBarleySpr::Do(), UKWinterWheat::Do(), WinterRyeStrigling::Do(), SpringBarleyPTreatment::Do(), SpringBarleyStriglingCulm::Do(), NLSpringBarley::Do(), DK_GrassGrazed_Perm::Do(), WinterRye::Do(), SpringBarleyStrigling::Do(), SpringBarleyStriglingSingle::Do(), UKWinterRape::Do(), NLWinterWheat::Do(), PLSpringBarleySpr::Do(), SpringBarley::Do(), SpringRape::Do(), WinterWheatStrigling::Do(), WinterWheatStriglingCulm::Do(), WinterWheatStriglingSingle::Do(), FI_OSpringBarley_Malt::Do(), WinterRape::Do(), WinterBarleyStrigling::Do(), FI_OCaraway1::Do(), FR_SpringBarley::Do(), FI_OSpringOats::Do(), OSpringBarleyPigs::Do(), DE_MaizeSilage::Do(), FI_OSpringWheat::Do(), FR_SpringOats::Do(), WinterBarley::Do(), FI_OSpringBarley_Fodder::Do(), DE_SpringBarley::Do(), PLWinterRye::Do(), DK_OWinterWheat_CC::Do(), PLMaizeSilage::Do(), DK_OWinterWheat::Do(), PLMaize::Do(), PLSpringBarley::Do(), FR_WinterTriticale::Do(), FI_OWinterRye::Do(), PLWinterTriticale::Do(), FI_SpringBarley_Malt::Do(), FI_Caraway1::Do(), FI_OWinterWheat::Do(), DE_WinterRye::Do(), DE_OTriticale::Do(), DE_OWinterRye::Do(), PLWinterWheat::Do(), FI_SprSpringBarley_Fodder::Do(), PLWinterBarley::Do(), DE_OWinterBarley::Do(), FI_SpringWheat::Do(), FI_SpringOats::Do(), PLWinterWheatLate::Do(), PLSpringWheat::Do(), FI_SpringBarley_Fodder::Do(), DE_Oats::Do(), DE_WinterBarley::Do(), FR_SpringWheat::Do(), DE_SpringRye::Do(), DK_SeedGrassRye_Spring::Do(), PLWinterRape::Do(), FR_WinterBarley::Do(), FI_WinterWheat::Do(), FR_WinterWheat::Do(), DE_WinterWheat::Do(), FI_WinterRye::Do(), DE_Triticale::Do(), DE_WinterWheatLate::Do(), DE_WinterRape::Do(), DK_SeedGrassFescue_Spring::Do(), and WinterWheat::Do().

◆ StrawCovering()

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

Straw covering applied on a_field.

1739 {
1740  FarmToDo treatment = straw_covering;
1741  if ((0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
1742  SetFunctionData(a_field, 1.0, 1.0, 0, treatment);
1743  return true;
1744  }
1745  return false;
1746 }

References DO_IT_PROB, g_weather, Weather::Raining(), and straw_covering.

Referenced by DE_OCabbages::Do(), DE_OBushFruitPerm::Do(), DK_OCabbages::Do(), DE_BushFruitPerm::Do(), NLTulips::Do(), and DK_BushFruit_Perm1::Do().

◆ StrawRemoval()

◆ Strigling()

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

Carry out a mechanical weeding on a_field.

1207 {
1208  FarmToDo treatment = strigling;
1209  // Force strigling if it has not been done already!!! This happens regardless of weather as of 26/10/2005
1210  if ((0 >= a_days) || ((g_weather->GetRainPeriod(g_date->Date(), 3) < 0.1) && DoIt(DO_IT_PROB))
1211  ) {
1212  LE* um = SetFunctionData(a_field, 0.7, 0.05, EL_TRAMLINE_DECAYTIME, treatment);
1213  a_field->SetHerbicideDelay(EL_STRIGLING_DELAYTIME); // this delays regrowth of weed for a while
1214  if (um != nullptr) {
1216  }
1217  return true;
1218  }
1219  return false;
1220 }

References Calendar::Date(), DO_IT_PROB, EL_STRIGLING_DELAYTIME, EL_TRAMLINE_DECAYTIME, g_date, g_weather, Weather::GetRainPeriod(), LE::SetHerbicideDelay(), and strigling.

Referenced by WinterRapeStrigling::Do(), BroadBeans::Do(), OFieldPeas::Do(), OFieldPeasSilage::Do(), DK_OLegume::Do(), DE_OPeas::Do(), DK_OLegume_Peas_CC::Do(), DE_OLegume::Do(), OWinterBarleyExt::Do(), DK_OLegume_Beans_CC::Do(), DK_OLegume_Beans::Do(), DK_OLegume_Peas::Do(), DK_OLentils::Do(), OWinterBarley::Do(), DK_OLupines::Do(), OWinterRye::Do(), DK_OptimalFlowerMix3::Do(), DE_OSpringRye::Do(), DE_OMaizeSilage::Do(), DE_OOats::Do(), OOats::Do(), DK_OCerealLegume_Whole::Do(), DE_OMaize::Do(), DE_OWinterWheat::Do(), DK_OLegume_Whole::Do(), DK_OLegume_Whole_CC::Do(), OTriticale::Do(), OSpringBarleyExt::Do(), DK_OSugarBeet::Do(), DK_OCerealLegume::Do(), OSpringBarley::Do(), SpringBarleyCloverGrassStrigling::Do(), DK_OFodderBeet::Do(), FieldPeasStrigling::Do(), OPotatoes::Do(), OWinterWheatUndersown::Do(), OWinterWheatUndersownExt::Do(), OWinterWheat::Do(), Triticale::Do(), DK_OSpringOats::Do(), DK_OSpringWheat::Do(), DE_OCabbages::Do(), DE_OSugarBeet::Do(), DK_OVegSeeds::Do(), DK_OSpringOats_CC::Do(), DK_OMaizeSilage::Do(), DK_OMaize::Do(), DK_OCabbages::Do(), PotatoesIndustry::Do(), Potatoes::Do(), DKOBroadBeans_test::Do(), NorwegianPotatoes::Do(), SpringBarleySilage::Do(), PLCarrots::Do(), WinterRyeStrigling::Do(), PTSetAside::Do(), SpringBarleyStriglingSingle::Do(), SpringBarleyStriglingCulm::Do(), SpringBarleyStrigling::Do(), DE_OPermanentGrassLowYield::Do(), DK_Cabbages::Do(), DE_PermanentGrassLowYield::Do(), WinterRye::Do(), DK_Potato::Do(), DK_OSeedGrassRye_Spring::Do(), DK_MixedVeg::Do(), WinterWheatStriglingCulm::Do(), WinterWheatStrigling::Do(), WinterWheatStriglingSingle::Do(), DK_SetAside::Do(), DK_OSetAside_SummerMow::Do(), DK_OSetAside::Do(), DK_PotatoSeed::Do(), WinterBarleyStrigling::Do(), DK_PotatoIndustry::Do(), DK_SetAside_SummerMow::Do(), OSpringBarleyPigs::Do(), FR_Sorghum::Do(), DE_OWinterRye::Do(), DE_OTriticale::Do(), DE_OWinterBarley::Do(), DK_BushFruit_Perm1::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)

1288 {
1289  FarmToDo treatment = strigling_hill;
1290  if ((0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
1291  SetFunctionData(a_field, 0.75, 0.25, EL_TRAMLINE_DECAYTIME, treatment);
1292  return true;
1293  }
1294  return false;
1295 }

References DO_IT_PROB, EL_TRAMLINE_DECAYTIME, g_weather, Weather::Raining(), and strigling_hill.

Referenced by DE_OPotatoes::Do(), FR_Potatoes::Do(), DE_Potatoes::Do(), and DE_PotatoesIndustry::Do().

◆ StriglingSow()

bool Farm::StriglingSow ( LE a_field,
double  a_user,
int  a_days,
double  a_seed_coating_amount = -1,
PlantProtectionProducts  a_ppp = ppp_foobar 
)
virtual

Carry out a mechanical weeding followed by sowing on a_field.

1227 {
1228  FarmToDo treatment = strigling_sow;
1229  if ((0 >= a_days))// && (g_weather->GetRainPeriod(g_date->Date(),3)>0.1) )
1230  {
1231  LE* um = SetFunctionData(a_field, 0.7, 0.05, EL_TRAMLINE_DECAYTIME, treatment);
1232  a_field->SetHerbicideDelay(EL_STRIGLING_DELAYTIME); // this delays regrowth of weed for a while
1233  a_field->SetGrowthPhase(sow);
1234  a_field->SetLastSownVeg(a_field->GetVegType());
1235  //start the flowering period.
1236  if(a_field->GetPollenNectarCurveRef()<0){
1237  a_field->CalculateFlowerResourceForCropSow(a_field->GetVegType());
1238  }
1239  // Apply seed coating if turned on
1240  if (a_seed_coating_amount > 0) {
1241  g_pest->DailyQueueAddSeedCoating(a_field, a_seed_coating_amount/10000, a_ppp); // Application rate is changed from g/ha to g/m2
1242  }
1243  if (um != nullptr) {
1245  um->SetGrowthPhase(sow);
1246  um->SetLastSownVeg(a_field->GetVegType());
1247  //start the flowering period.
1248  if(um->GetPollenNectarCurveRef()<0){
1249  um->CalculateFlowerResourceForCropSow(um->GetVegType());
1250  }
1251  // Apply seed coating if turned on
1252  if (a_seed_coating_amount > 0) {
1253  g_pest->DailyQueueAddSeedCoating(um, a_seed_coating_amount/10000, a_ppp); // Application rate is changed from g/ha to g/m2
1254  }
1255  }
1256  return true;
1257  }
1258  if ((0 >= a_days) || ((g_weather->GetRainPeriod(g_date->Date(), 3) < 0.1) && DoIt(DO_IT_PROB))
1259  ) {
1260  LE* um = SetFunctionData(a_field, 0.7, 0.05, EL_TRAMLINE_DECAYTIME, treatment);
1261  a_field->SetGrowthPhase(sow);
1262  a_field->SetLastSownVeg(a_field->GetVegType());
1263  //start the flowering period.
1264  if(a_field->GetPollenNectarCurveRef()<0){
1265  a_field->CalculateFlowerResourceForCropSow(a_field->GetVegType());
1266  }
1267  a_field->SetHerbicideDelay(EL_STRIGLING_DELAYTIME); // this delays regrowth of weed for a while
1268  if (um != nullptr)
1269  {
1271  um->SetGrowthPhase(sow);
1272  um->SetLastSownVeg(a_field->GetVegType());
1273  //start the flowering period.
1274  if(um->GetPollenNectarCurveRef()<0){
1275  um->CalculateFlowerResourceForCropSow(um->GetVegType());
1276  }
1277  }
1278  return true;
1279  }
1280  return false;
1281 }

References LE::CalculateFlowerResourceForCropSow(), Pesticide::DailyQueueAddSeedCoating(), Calendar::Date(), DO_IT_PROB, EL_STRIGLING_DELAYTIME, EL_TRAMLINE_DECAYTIME, g_date, g_pest, g_weather, LE::GetPollenNectarCurveRef(), Weather::GetRainPeriod(), LE::SetGrowthPhase(), LE::SetHerbicideDelay(), LE::SetLastSownVeg(), sow, and strigling_sow.

Referenced by SpringBarleyCloverGrassStrigling::Do(), OWinterWheatUndersown::Do(), OWinterWheatUndersownExt::Do(), OWinterWheat::Do(), SpringBarleyPeaCloverGrassStrigling::Do(), DK_OSeedGrassRye_Spring::Do(), and OSpringBarleyPigs::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)

246 {
248  if ((0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
249  SetFunctionData(a_field, 0.1, 0.0, 0,stubble_cultivator_heavy);
250  return true; // completed
251  }
252  return false; // not completed
253 }

References DO_IT_PROB, g_weather, Weather::Raining(), and stubble_cultivator_heavy.

Referenced by FI_OPotato_North::Do(), FI_OPotatoIndustry_South::Do(), FI_OStarchPotato_North::Do(), FI_OStarchPotato_South::Do(), FI_OPotato_South::Do(), FI_OPotatoIndustry_North::Do(), FI_Potato_North::Do(), FI_StarchPotato_North::Do(), FI_PotatoIndustry_North::Do(), FI_StarchPotato_South::Do(), FI_Potato_South::Do(), FI_PotatoIndustry_South::Do(), NLCarrots::Do(), DK_OPotatoIndustry::Do(), DK_OPotatoSeed::Do(), DK_OPotato::Do(), PLFodderLucerne1::Do(), DK_Potato::Do(), FI_OSpringBarley_Malt::Do(), DK_PotatoSeed::Do(), FI_OFabaBean::Do(), DK_PotatoIndustry::Do(), FI_OSpringOats::Do(), FI_OSpringRape::Do(), FI_OSpringWheat::Do(), FR_SpringBarley::Do(), FI_OTurnipRape::Do(), FI_OSpringBarley_Fodder::Do(), FR_SpringOats::Do(), PLWinterRye::Do(), FI_TurnipRape::Do(), FI_FabaBean::Do(), PLMaize::Do(), PLMaizeSilage::Do(), FI_SpringRape::Do(), NLTulips::Do(), FI_OWinterRye::Do(), FI_SpringBarley_Malt::Do(), SE_SpringBarley::Do(), PLWinterTriticale::Do(), FI_OWinterWheat::Do(), FI_SprSpringBarley_Fodder::Do(), FI_SpringWheat::Do(), PLWinterWheat::Do(), PLBeet::Do(), PLWinterBarley::Do(), FI_SpringOats::Do(), DE_Carrots::Do(), PLWinterWheatLate::Do(), SE_WinterRape_Seed::Do(), FI_SpringBarley_Fodder::Do(), SE_WinterWheat::Do(), FR_SpringWheat::Do(), PLWinterRape::Do(), FI_WinterWheat::Do(), DE_GrasslandSilageAnnual::Do(), FI_WinterRye::Do(), FR_WinterWheat::Do(), DE_WinterRape::Do(), and DE_SugarBeet::Do().

◆ StubbleHarrowing()

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

Carry out stubble harrowing on a_field.

1524 {
1525  FarmToDo treatment = stubble_harrowing;
1526  if ( (0 >= a_days) ||
1527  ((g_weather->GetRainPeriod(g_date->Date(),3)<0.1) && DoIt(DO_IT_PROB))
1528  ) {
1529  SetFunctionData(a_field, 0.25, 0.0, 0, treatment);
1530  return true;
1531  }
1532  return false;
1533 }

References Calendar::Date(), DO_IT_PROB, g_date, g_weather, Weather::GetRainPeriod(), and stubble_harrowing.

Referenced by UKMaize::Do(), WinterRapeStrigling::Do(), OSeedGrass2::Do(), NLCatchCropPea::Do(), BECatchPeaCrop::Do(), DK_OCatchCrop::Do(), OMaizeSilage::Do(), OWinterBarleyExt::Do(), OWinterBarley::Do(), SeedGrass2::Do(), DK_CatchCrop::Do(), DE_OMaizeSilage::Do(), DE_OWinterWheat::Do(), OTriticale::Do(), Maize::Do(), MaizeSilage::Do(), DE_OMaize::Do(), MaizeStrigling::Do(), DE_OWinterRape::Do(), OWinterWheat::Do(), OWinterWheatUndersown::Do(), OWinterWheatUndersownExt::Do(), OWinterRape::Do(), BEMaize::Do(), Triticale::Do(), NLMaize::Do(), BEBeet::Do(), NLBeet::Do(), BEWinterBarley::Do(), BEWinterBarleyCC::Do(), BEWinterWheatCC::Do(), BEWinterWheat::Do(), DK_WinterRye::Do(), DK_WinterRye_CC::Do(), SpringBarleySKManagement::Do(), PLCarrots::Do(), SpringBarleySpr::Do(), UKWinterWheat::Do(), WinterRyeStrigling::Do(), SpringBarleyPTreatment::Do(), SpringBarleyStrigling::Do(), SpringBarleyStriglingCulm::Do(), SpringBarleyStriglingSingle::Do(), UKWinterRape::Do(), WinterRye::Do(), NLSpringBarley::Do(), PTBeans::Do(), PTTurnipGrazed::Do(), NLWinterWheat::Do(), DK_OPotato::Do(), DK_OPotatoIndustry::Do(), DK_OPotatoSeed::Do(), PTOtherDryBeans::Do(), SpringBarley::Do(), PLFodderLucerne1::Do(), UKPotatoes::Do(), DK_Potato::Do(), PTOats::Do(), SpringRape::Do(), PLBeans::Do(), WinterWheatStriglingSingle::Do(), WinterWheatStrigling::Do(), WinterWheatStriglingCulm::Do(), PTWinterBarley::Do(), PTWinterRye::Do(), PTWinterWheat::Do(), PTFodderMix::Do(), PTTriticale::Do(), WinterRape::Do(), PTGrassGrazed::Do(), DK_PotatoSeed::Do(), WinterBarleyStrigling::Do(), PTYellowLupin::Do(), PTSorghum::Do(), DE_Maize::Do(), DK_PotatoIndustry::Do(), DE_MaizeSilage::Do(), PTRyegrass::Do(), WinterBarley::Do(), PLWinterRye::Do(), BEPotatoes::Do(), FR_Sorghum::Do(), FR_Maize::Do(), FR_Maize_Silage::Do(), PLMaizeSilage::Do(), PLMaize::Do(), PLSpringBarley::Do(), NLPotatoes::Do(), FR_WinterTriticale::Do(), PLWinterTriticale::Do(), FR_Sunflower::Do(), DK_OOrchPear::Do(), DE_OTriticale::Do(), DE_OWinterRye::Do(), DE_OWinterBarley::Do(), DK_OOrchardCrop_Perm::Do(), PLBeet::Do(), PLWinterBarley::Do(), DK_OOrchApple::Do(), PLWinterWheat::Do(), DK_OOrchOther::Do(), PLSpringWheat::Do(), PLWinterWheatLate::Do(), PLPotatoes::Do(), DE_Oats::Do(), DE_SpringRye::Do(), PLWinterRape::Do(), DE_GrasslandSilageAnnual::Do(), IRWinterBarley::Do(), IRSpringOats::Do(), IRSpringBarley::Do(), IRWinterOats::Do(), IRSpringWheat::Do(), IRWinterWheat::Do(), FR_Potatoes::Do(), FR_WinterRape::Do(), DE_WinterRape::Do(), WinterWheat::Do(), DE_SugarBeet::Do(), DE_Potatoes::Do(), DE_PotatoesIndustry::Do(), DK_OChristmasTrees_Perm::Do(), and DK_ChristmasTrees_Perm::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)

233 {
234  if ((0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
235  SetFunctionData(a_field, 0.1, 0.0, 0,stubble_plough); // the third parameter of 0.0 creates a call to ZeroVeg
236  return true; // completed
237  }
238  return false; // not completed
239 }

References DO_IT_PROB, g_weather, Weather::Raining(), and stubble_plough.

Referenced by UKBeans::Do(), PLCarrots::Do(), UKWinterRape::Do(), PLFodderLucerne1::Do(), PLBeans::Do(), FR_SpringBarley::Do(), FR_SpringOats::Do(), PLWinterRye::Do(), FR_Sorghum::Do(), FR_Maize_Silage::Do(), FR_Maize::Do(), PLMaize::Do(), PLMaizeSilage::Do(), PLSpringBarley::Do(), FR_WinterTriticale::Do(), FR_Sunflower::Do(), PLWinterTriticale::Do(), PLBeet::Do(), PLWinterBarley::Do(), PLWinterWheat::Do(), PLWinterWheatLate::Do(), PLSpringWheat::Do(), PLPotatoes::Do(), FR_SpringWheat::Do(), PLWinterRape::Do(), DE_GrasslandSilageAnnual::Do(), IRSpringBarley::Do(), IRSpringOats::Do(), IRSpringWheat::Do(), FR_Potatoes::Do(), FR_WinterRape::Do(), DE_Potatoes::Do(), and DE_PotatoesIndustry::Do().

◆ Suckering()

bool Farm::Suckering ( LE a_field,
double  a_user,
int  a_days 
)
virtual
571 {
572  if ((0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
573  a_field->Trace(suckering);
574  a_field->SetLastTreatment(suckering);
575  int pref = a_field->GetUnsprayedMarginPolyRef();
576  if (pref != -1) {
577  // Must have an unsprayed margin so need to pass the information on to it
578  LE* um = g_landscape_ptr->SupplyLEPointer(pref);
580  }
581  return true;
582 
583  }
584  return false;
585 }

References DO_IT_PROB, g_landscape_ptr, g_weather, LE::GetUnsprayedMarginPolyRef(), green_harvest, Weather::Raining(), LE::SetLastTreatment(), suckering, and Landscape::SupplyLEPointer().

Referenced by PTOliveGroveTradOrganic::Do(), and PTOliveGroveTraditional::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)

1351 {
1352  FarmToDo treatment = swathing;
1353  if ( (0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
1354  SetFunctionData(a_field, 0.5, 1.0, 0, treatment);
1355  return true;
1356  }
1357  return false;
1358 }

References DO_IT_PROB, g_weather, Weather::Raining(), and swathing.

Referenced by OSeedGrass1::Do(), WinterRapeStrigling::Do(), OSeedGrass2::Do(), SeedGrass1::Do(), DK_CerealLegume_Whole::Do(), DK_CerealLegume::Do(), DK_SpringBarley_Green::Do(), DK_SpringBarleySilage::Do(), SeedGrass2::Do(), DK_OLentils::Do(), DK_OSpringBarleyCloverGrass::Do(), DK_OLupines::Do(), DK_OptimalFlowerMix3::Do(), DK_OLegume_Whole::Do(), DK_OSpringBarley_CC::Do(), DK_OLegume_Whole_CC::Do(), DK_OLegumeCloverGrass_Whole::Do(), DK_Legume_Whole::Do(), DK_OSpringBarley::Do(), OPotatoes::Do(), DK_OSpringOats::Do(), DK_OSpringWheat::Do(), OWinterRape::Do(), DK_OVegSeeds::Do(), DK_WinterFodderGrass::Do(), DE_OBushFruitPerm::Do(), DK_OSpringOats_CC::Do(), DK_OWinterRape::Do(), DE_OPotatoes::Do(), DK_SpringFodderGrass::Do(), DK_OSpringBarleySilage::Do(), DK_WinterCloverGrassGrazedSown::Do(), DK_VegSeeds::Do(), PTSetAside::Do(), SpringRape::Do(), DK_OSeedGrassRye_Spring::Do(), DK_CloverGrassGrazed1::Do(), DK_WinterRape::Do(), DK_SetAside::Do(), DK_OSetAside_SummerMow::Do(), WinterRape::Do(), DK_OSetAside::Do(), DE_BushFruitPerm::Do(), DK_SetAside_SummerMow::Do(), DK_CloverGrassGrazed3::Do(), DK_CloverGrassGrazed2::Do(), DK_SeedGrassRye_Spring::Do(), FR_Potatoes::Do(), and DK_SeedGrassFescue_Spring::Do().

◆ Water()

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

Carry out a watering on a_field.

1331 {
1332  FarmToDo treatment = water;
1333 
1334  /* Turn on this code to avoid watering on heavy soils
1335  int soiltype = a_field->GetSoilType();
1336  if ( soiltype < 1 || soiltype > 4 )
1337  return true;
1338 */
1339  if ( (0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
1340  SetFunctionData(a_field, 1.0, 1.0, EL_TRAMLINE_DECAYTIME, treatment);
1341  return true;
1342  }
1343  return false;
1344 }

References DO_IT_PROB, EL_TRAMLINE_DECAYTIME, g_weather, Weather::Raining(), and water.

Referenced by OSeedGrass1::Do(), OSeedGrass2::Do(), BroadBeans::Do(), OSBarleySilage::Do(), OFieldPeas::Do(), OFieldPeasSilage::Do(), DK_OLegume::Do(), SeedGrass1::Do(), OCarrots::Do(), DK_CerealLegume::Do(), DK_CerealLegume_Whole::Do(), OBarleyPeaCloverGrass::Do(), OMaizeSilage::Do(), DK_OLegume_Peas_CC::Do(), DK_SpringBarley_Green::Do(), SeedGrass2::Do(), DK_OLegume_Beans::Do(), DK_OLegume_Beans_CC::Do(), DK_OLegume_Peas::Do(), DK_OLentils::Do(), DK_SpringBarleySilage::Do(), DK_OSpringBarleyCloverGrass::Do(), DK_OLupines::Do(), DK_MaizeSilage::Do(), DE_OMaizeSilage::Do(), DK_OWinterRye::Do(), DK_OCerealLegume_Whole::Do(), OTriticale::Do(), DK_OSpringBarley_CC::Do(), DE_OMaize::Do(), DK_OWinterRye_CC::Do(), DK_OLegume_Whole::Do(), DK_OLegumeCloverGrass_Whole::Do(), DK_OLegume_Whole_CC::Do(), Maize::Do(), MaizeSilage::Do(), MaizeStrigling::Do(), DK_OWinterBarley::Do(), DK_Maize::Do(), DK_OSpringBarley::Do(), SpringBarleySeed::Do(), DK_OSugarBeet::Do(), DK_OCerealLegume::Do(), SpringBarleyCloverGrassStrigling::Do(), DK_OFodderBeet::Do(), FieldPeas::Do(), FieldPeasStrigling::Do(), FieldPeasSilage::Do(), OPotatoes::Do(), SpringBarleyCloverGrass::Do(), OFodderBeet::Do(), DK_OSpringOats::Do(), DK_OSpringWheat::Do(), Triticale::Do(), Carrots::Do(), DK_OVegSeeds::Do(), DE_OSugarBeet::Do(), DK_SpringBarleyCloverGrass::Do(), DE_OCabbages::Do(), DK_OSpringOats_CC::Do(), DE_OBushFruitPerm::Do(), DK_WinterFodderGrass::Do(), DK_OWinterRape::Do(), SpringBarleyPeaCloverGrassStrigling::Do(), DE_OPotatoes::Do(), DK_SpringBarley::Do(), DK_SpringBarley_CC::Do(), DK_OMaize::Do(), DK_OMaizeSilage::Do(), DK_OSpringBarleySilage::Do(), DK_SpringFodderGrass::Do(), DK_WinterCloverGrassGrazedSown::Do(), NLGrassGrazedExtensive2::Do(), DK_OCabbages::Do(), NLPermanentGrassGrazedExtensive::Do(), DE_OCarrots::Do(), NLGrassGrazedExtensive1Spring::Do(), NLGrassGrazedExtensiveLast::Do(), DK_OCarrots::Do(), PotatoesIndustry::Do(), NLCabbageSpring::Do(), SugarBeet::Do(), Potatoes::Do(), PTOliveGroveIntensive::Do(), NorwegianPotatoes::Do(), DKOBroadBeans_test::Do(), FodderBeet::Do(), DK_VegSeeds::Do(), DK_Carrots_Spring::Do(), SpringBarleySKManagement::Do(), NLCabbage::Do(), NLGrassGrazedExtensive1::Do(), DK_Carrots::Do(), WinterRyeStrigling::Do(), DK_OGrassGrazed_Perm::Do(), SpringBarleySpr::Do(), SpringBarleySilage::Do(), SpringBarleyStrigling::Do(), SpringBarleyPTreatment::Do(), SpringBarleyStriglingCulm::Do(), SpringBarleyStriglingSingle::Do(), WinterRye::Do(), DK_GrassGrazed_Perm::Do(), DK_Cabbages::Do(), PTOliveGroveSuperIntensive::Do(), DK_OMixedVeg::Do(), SpringBarley::Do(), DK_OPotato::Do(), DK_OPotatoIndustry::Do(), DK_OPotatoSeed::Do(), DK_Potato::Do(), UKPermanentGrass::Do(), UKTempGrass::Do(), DK_OBushFruit_Perm2::Do(), DK_CloverGrassGrazed1::Do(), PLBeetSpr::Do(), DK_MixedVeg::Do(), NLGrassGrazed2::Do(), NLPermanentGrassGrazed::Do(), WinterWheatStriglingCulm::Do(), WinterWheatStriglingSingle::Do(), NLGrassGrazedLast::Do(), NLGrassGrazed1Spring::Do(), WinterWheatStrigling::Do(), DK_PotatoSeed::Do(), WinterBarleyStrigling::Do(), NLGrassGrazed1::Do(), DE_BushFruitPerm::Do(), DK_PotatoIndustry::Do(), WinterBarley::Do(), DK_OOrchCherry::Do(), DK_OSpringFodderGrass::Do(), DK_OBushFruit_Perm1::Do(), DK_OCloverGrassGrazed3::Do(), DK_OWinterWheat_CC::Do(), DK_OCloverGrassGrazed1::Do(), DK_OCloverGrassGrazed2::Do(), DK_OWinterWheat::Do(), NLTulips::Do(), DK_OOrchPear::Do(), DK_OWinterFodderGrass::Do(), DK_CloverGrassGrazed3::Do(), DK_OWinterCloverGrassGrazedSown::Do(), PLBeet::Do(), DK_OOrchApple::Do(), DK_OOrchardCrop_Perm::Do(), DK_OOrchOther::Do(), DK_CloverGrassGrazed2::Do(), DK_BushFruit_Perm1::Do(), DE_Cabbage::Do(), DK_BushFruit_Perm2::Do(), FR_Grassland::Do(), WinterWheat::Do(), DE_SugarBeet::Do(), DK_OrchCherry::Do(), DK_OrchPear::Do(), DK_OrchOther::Do(), DK_OrchardCrop_Perm::Do(), DK_OrchApple::Do(), ITOrchard::Do(), and ITOOrchard::Do().

◆ WinterHarrow()

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

Carry out a harrow event in the winter on a_field.

1540 {
1541  FarmToDo treatment = autumn_harrow;
1542  if ((0 >= a_days) || (!g_weather->Raining() && DoIt(DO_IT_PROB))) {
1543  a_field->Trace(treatment);
1544  a_field->SetLastTreatment(treatment);
1545  // Apply 90% mortality to the insects
1546  a_field->InsectMortality(0.1);
1547  // Reduce the vegetation to zero
1548  a_field->ZeroVeg();
1549  int pref = a_field->GetUnsprayedMarginPolyRef();
1550  if (pref != -1) {
1551  // Must have an unsprayed margin so need to pass the information on to it
1552  LE* um = g_landscape_ptr->SupplyLEPointer(pref);
1553  um->SetLastTreatment(treatment);
1554  um->InsectMortality(0.1);
1555  um->ZeroVeg();
1556  }
1557  CalculateTreatmentCosts(treatment, a_field);
1558  return true;
1559  }
1560  return false;
1561 }

References autumn_harrow, DO_IT_PROB, g_landscape_ptr, g_weather, LE::GetUnsprayedMarginPolyRef(), LE::InsectMortality(), Weather::Raining(), LE::SetLastTreatment(), Landscape::SupplyLEPointer(), and LE::ZeroVeg().

Referenced by PTCabbage::Do(), and PTCabbage_Hort::Do().

◆ WinterPlough()

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

Member Data Documentation

◆ 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(), and GetCentroids().

◆ 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(), and GetCentroids().

◆ m_farm_num

int Farm::m_farm_num
protected

Referenced by GetFarmNumber(), and SetFarmNumber().

◆ m_farmtype

◆ m_FarmType

TTypesOfFarm Farm::m_FarmType
protected

The farms farm type - see TTypesOfFarm enum for types - note the use of UserDefined farms.

Referenced by GetFarmType().

◆ m_fields

vector< LE* > Farm::m_fields
protected

◆ m_HuntersList

HunterList Farm::m_HuntersList
protected

A list of hunters allocated to this farm.

Referenced by AddHunter(), and RemoveHunter().

◆ m_intensity

double Farm::m_intensity
protected

indicates the farm intensity - 1 = normal, otherwise linear scale

Referenced by GetIntensity(), and SetIntensity().

◆ m_OurFarmer

Farmer* Farm::m_OurFarmer
protected

◆ m_OurManager

FarmManager* Farm::m_OurManager
protected

Pointer to the FarmManager.

Referenced by CalculateTreatmentCosts(), GetFarmManager(), and Harvested().

◆ m_PermCrops

vector<PermCropData> Farm::m_PermCrops
protected

◆ m_queue

LowPriority< FarmEvent* > Farm::m_queue
protected

◆ m_rotation

◆ m_rotation_sync_index

int Farm::m_rotation_sync_index
protected

◆ m_rotfilename

◆ m_stockfarmer

bool Farm::m_stockfarmer
protected

Referenced by AgroChemIndustryCerealFarm1::AgroChemIndustryCerealFarm1(), AgroChemIndustryCerealFarm2::AgroChemIndustryCerealFarm2(), AgroChemIndustryCerealFarm3::AgroChemIndustryCerealFarm3(), ConventionalCattle::ConventionalCattle(), ConventionalPig::ConventionalPig(), ConventionalPlant::ConventionalPlant(), ConvMarginalJord::ConvMarginalJord(), IsStockFarmer(), 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().


The documentation for this class was generated from the following files:
tole_SolarPanel
Definition: LandscapeFarmingEnums.h:151
g_farm_fixed_rotation_enable
CfgBool g_farm_fixed_rotation_enable("FARM_FIXED_ROTATION_ENABLE", CFG_CUSTOM, false)
harvest1
Definition: Plants.h:55
Pesticide::DailyQueueAddGranular
void DailyQueueAddGranular(LE *a_element_sprayed, double a_amount, PlantProtectionProducts a_ppp)
Adds new granular application event to the daily queue.
Definition: Pesticide.cpp:363
g_landscape_ptr
Landscape * g_landscape_ptr
Definition: Landscape.cpp:352
tov_DKOChristmasTrees_Perm
Definition: LandscapeFarmingEnums.h:447
LE::GetMinX
int GetMinX(void)
Definition: Elements.h:399
FarmEvent::m_forcespring
bool m_forcespring
Definition: Farm.h:392
toc_OSetAside
Definition: LandscapeFarmingEnums.h:863
fiber_removal
Definition: Treatment.h:129
fp_rsm
Definition: Treatment.h:64
polylist
vector< unsigned > polylist
Definition: Farm.h:332
Landscape::SupplyLEPointer
LE * SupplyLEPointer(int a_polyref)
Returns a pointer to the object referred to by the polygon number.
Definition: Landscape.h:1722
org_insecticide
Definition: Treatment.h:84
cfg_pest_max_wind
CfgFloat cfg_pest_max_wind("PEST_MAX_WIND", CFG_CUSTOM, 4.5)
Maximum allowed average wind speed for applying pesticides.
fa_sk
Definition: Treatment.h:71
tov_DKGrazingPigs_Perm
Definition: LandscapeFarmingEnums.h:452
row_cultivation
Definition: Treatment.h:88
fa_pk
Definition: Treatment.h:68
tole_OtherPermCrop
Definition: LandscapeFarmingEnums.h:177
LowPriority::Bottom
LowPriPair< ELEMTYPE > Bottom(void)
Definition: Lowqueue.h:134
toc_OrchardCrop
Definition: LandscapeFarmingEnums.h:855
FarmManager::GetLandscape
Landscape * GetLandscape(void)
Definition: Farm.h:1473
fp_npk
Definition: Treatment.h:52
strigling
Definition: Treatment.h:89
g_rand_uni_fnc
double g_rand_uni_fnc()
Definition: ALMaSS_Random.cpp:56
harvest
Definition: Treatment.h:94
WARN_MSG
Definition: MapErrorMsg.h:38
toc_OCloverGrassGrazed1
Definition: LandscapeFarmingEnums.h:826
fa_nk
Definition: Treatment.h:142
tov_NLPermanentGrassGrazedExtensive
Definition: LandscapeFarmingEnums.h:272
Farm::m_HuntersList
HunterList m_HuntersList
A list of hunters allocated to this farm.
Definition: Farm.h:1005
sow
Definition: Plants.h:53
LE::CalculateFlowerResourceForCropSow
virtual void CalculateFlowerResourceForCropSow(TTypesOfVegetation a_new_veg)
Definition: Elements.cpp:1199
g_farm_enable_crop_rotation
CfgBool g_farm_enable_crop_rotation("FARM_ENABLE_CROP_ROTATION", CFG_CUSTOM, true)
LE::SetLastSownVeg
void SetLastSownVeg(TTypesOfVegetation a_tov)
Records the last vegetation type to be sown.
Definition: Elements.h:357
insecticide_treat
Definition: Treatment.h:83
LE_SIG_NO_HERBICIDE
#define LE_SIG_NO_HERBICIDE
Definition: Elements.h:46
straw_chopping
Definition: Treatment.h:99
LE::GetArea
double GetArea(void)
Definition: Elements.h:257
toc_PermanentGrassLowYield
Definition: LandscapeFarmingEnums.h:887
CompPcts
bool CompPcts(tpct i, tpct j)
Used for sorting a farmers field size vector.
Definition: Farm.cpp:649
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:810
Farm::GetFirstCropIndex
virtual int GetFirstCropIndex(TTypesOfLandscapeElement a_type)
Gets the first crop for the farm.
Definition: Farm.cpp:1136
fa_greenmanure
Definition: Treatment.h:76
Pesticide::ReducePlantPesticide
void ReducePlantPesticide(int a_minx, int a_maxx, int a_miny, int a_maxy, int a_map_index, float a_reduc, bool a_remove_from_surface=false)
Reduce the amount in plant pesticide maps. Everything is removed for surface if boolean is true (used...
Definition: Pesticide.cpp:399
stubble_plough
Definition: Treatment.h:35
toc_OYoungForestCrop
Definition: LandscapeFarmingEnums.h:885
growth_regulator
Definition: Treatment.h:81
Farm::m_FarmType
TTypesOfFarm m_FarmType
The farms farm type - see TTypesOfFarm enum for types - note the use of UserDefined farms.
Definition: Farm.h:1027
Farm::m_intensity
double m_intensity
indicates the farm intensity - 1 = normal, otherwise linear scale
Definition: Farm.h:1010
FarmManager::GetCropTypeFromPlan
TTypesOfCrops GetCropTypeFromPlan(TTypesOfVegetation a_tov)
Definition: Farm.h:1649
deep_ploughing
Definition: Treatment.h:43
hilling_up
Definition: Treatment.h:91
FarmEvent
A struct to hold the information required to trigger a farm event.
Definition: Farm.h:372
green_harvest
Definition: Treatment.h:127
tov_BEOrchardCrop
Definition: LandscapeFarmingEnums.h:298
flower_cutting
Definition: Treatment.h:121
Farm::DoIt
bool DoIt(double a_probability)
Return chance out of 0 to 100.
Definition: Farm.cpp:856
toc_OAsparagusEstablishedPlantation
Definition: LandscapeFarmingEnums.h:818
toc_OCloverGrassSilage1
Definition: LandscapeFarmingEnums.h:829
LE::ResetDigestibility
virtual void ResetDigestibility()
sets growth record to zero in descendent classes
Definition: Elements.h:454
tole_FarmBufferZone
Definition: LandscapeFarmingEnums.h:170
Farm::GetFirstDate
int GetFirstDate(TTypesOfVegetation a_tov)
Gets the start date for a crop type.
Definition: Farm.cpp:2152
LE::GetMaxX
int GetMaxX(void)
Definition: Elements.h:397
toc_OFarmForest
Definition: LandscapeFarmingEnums.h:830
spring_plough
Definition: Treatment.h:44
fp_sk
Definition: Treatment.h:56
pruning
Definition: Treatment.h:125
Farm::m_fields
vector< LE * > m_fields
Definition: Farm.h:1000
LE::AddManagementActionDone
void AddManagementActionDone(FarmManagementCategory a_action)
Record management action throught a crop management action.
Definition: Elements.h:252
MapErrorMsg::WarnAddInfo
void WarnAddInfo(MapErrorState a_level, std::string a_add1, std::string a_add2)
Definition: MapErrorMsg.cpp:160
LowPriority::Push
void Push(ELEMTYPE a_element, long a_priority)
Definition: Lowqueue.h:119
Farm::GetNextCropIndex
virtual int GetNextCropIndex(int a_rot_index)
Returns the next crop in the rotation.
Definition: Farm.cpp:1178
tov_DKOEnergyCrop_Perm
Definition: LandscapeFarmingEnums.h:449
Pesticide::DailyQueueAddSeedCoating
void DailyQueueAddSeedCoating(LE *a_element_sprayed, double a_amount, PlantProtectionProducts a_ppp)
Adds new seed coating event to the daily queue.
Definition: Pesticide.cpp:353
FarmFuncsCostBenefits::RiskAvoidance
double RiskAvoidance
Definition: Farm.h:346
g_farmmanager
FarmManager * g_farmmanager
Definition: Farm.cpp:638
Farm::DoIt_prob
bool DoIt_prob(double a_probability)
Return chance out of 0 to 1.
Definition: Farm.cpp:864
fp_manure
Definition: Treatment.h:61
herbicide_treat
Definition: Treatment.h:80
tpct
Used for storing farmers field size vectors.
Definition: Farm.h:363
fp_ammoniumsulphate
Definition: Treatment.h:60
g_date
class Calendar * g_date
Definition: Calendar.cpp:37
straw_covering
Definition: Treatment.h:123
FarmManager::GetSpilledMaize
double GetSpilledMaize()
Returns the average amount of spilled maize in KJ/m2 this year.
Definition: Farm.cpp:5662
l_farm_herbicide_kills
static CfgBool l_farm_herbicide_kills("FARM_PESTICIDE_KILLS", CFG_CUSTOM, true)
LE_SIG_NO_INSECTICIDE
#define LE_SIG_NO_INSECTICIDE
Definition: Elements.h:42
tov_PTOliveGroveTradOrganic
Definition: LandscapeFarmingEnums.h:334
fp_boron
Definition: Treatment.h:131
LE::SetTramlinesDecay
void SetTramlinesDecay(int a_decaytime_days)
Definition: Elements.h:374
tole_PermPastureTussockyWet
Definition: LandscapeFarmingEnums.h:122
fp_cu
Definition: Treatment.h:138
LE::GetInsectPop
virtual double GetInsectPop(void)
Definition: Elements.h:166
DO_IT_PROB_LONG
#define DO_IT_PROB_LONG
Definition: FarmFuncs.cpp:61
bulb_harvest
Definition: Treatment.h:122
preseeding_cultivator
Definition: Treatment.h:39
tov_DKOGrassLowYield_Perm
Definition: LandscapeFarmingEnums.h:455
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:920
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, FarmManagementCategory a_fmc, bool a_forcespring, bool a_forcespringOK)
Adds an event to the event queue for a farm.
Definition: Farm.cpp:845
cfg_OliveGroveTradPct
CfgFloat cfg_OliveGroveTradPct("OLIVEGROVETRADPCT", CFG_CUSTOM, 0)
LE::ReduceVeg_Extended
virtual void ReduceVeg_Extended(double)
Definition: Elements.h:192
tov_ITGrassland
Definition: LandscapeFarmingEnums.h:606
FarmFuncsCostBenefits::ManagementCategory
FarmManagementCategory ManagementCategory
Definition: Farm.h:348
tole_OOrchard
Definition: LandscapeFarmingEnums.h:153
fp_npks
Definition: Treatment.h:51
CfgFloat::value
double value() const
Definition: Configurator.h:142
tole_WalnutPlantation
Definition: LandscapeFarmingEnums.h:169
cfg_farm_cattle_reduce_height
CfgArray_Double cfg_farm_cattle_reduce_height("FARM_CATTLE_REDUCE_HEIGHT", CFG_CUSTOM, 4, vector< double > {0.2, 0.3, 1.0, 8.0})
burn_top
Definition: Treatment.h:143
tov_DEOAsparagusEstablishedPlantation
Definition: LandscapeFarmingEnums.h:512
Farm::CalculateTreatmentCosts
void CalculateTreatmentCosts(FarmToDo a_treatment, LE *a_field)
Definition: Farm.cpp:6352
FarmToDo
FarmToDo
Definition: Treatment.h:31
FarmManager::TranslateVegCodes
TTypesOfVegetation TranslateVegCodes(std::string &str)
Converts strings to tov_
Definition: Farm.cpp:2180
tole_OChristmasTrees
Definition: LandscapeFarmingEnums.h:157
fp_nk
Definition: Treatment.h:133
EL_TRAMLINE_DECAYTIME
#define EL_TRAMLINE_DECAYTIME
Definition: Elements.h:56
burn_straw_stubble
Definition: Treatment.h:104
toc_YoungForestCrop
Definition: LandscapeFarmingEnums.h:924
org_herbicide
Definition: Treatment.h:85
toc_PermanentGrassTussocky
Definition: LandscapeFarmingEnums.h:888
tov_ITOOrchard
Definition: LandscapeFarmingEnums.h:608
cfg_biocide_reduction_val
CfgFloat cfg_biocide_reduction_val("REDUCE_BIOCIDE_EFFECT", CFG_CUSTOM, 0.0)
Farm::m_farmtype
TTypesOfFarm m_farmtype
Definition: Farm.h:1003
tov_DKFarmYoungForest_Perm
Definition: LandscapeFarmingEnums.h:456
LE::SetInsectPop
virtual void SetInsectPop(double)
Definition: Elements.h:167
Weather::Raining
bool Raining(void)
Definition: Weather.h:520
tole_OEnergyCrop
Definition: LandscapeFarmingEnums.h:159
fa_cu
Definition: Treatment.h:140
LE::GetMinY
int GetMinY(void)
Definition: Elements.h:400
tov_DKFarmForest_Perm
Definition: LandscapeFarmingEnums.h:450
autumn_roll
Definition: Treatment.h:38
strigling_hill
Definition: Treatment.h:117
tov_DKOGrassGrazed_Perm
Definition: LandscapeFarmingEnums.h:454
heavy_cultivator_aggregate
Definition: Treatment.h:120
Pesticide::DailyQueueAdd
void DailyQueueAdd(LE *a_element_sprayed, double a_amount, PlantProtectionProducts a_ppp, int a_drifttype=0)
Adds new pesticide spray event to the daily queue.
Definition: Pesticide.cpp:343
Farm::m_OurFarmer
Farmer * m_OurFarmer
Definition: Farm.h:998
fp_manganesesulphate
Definition: Treatment.h:59
Farm::GetForceSpringOK
int GetForceSpringOK(TTypesOfVegetation a_tov)
Gets the start date for a crop type.
Definition: Farm.cpp:2168
tov_FIGreenFallow_Perm
Definition: LandscapeFarmingEnums.h:572
LE::GetVegBiomass
virtual double GetVegBiomass(void)
Definition: Elements.h:164
tov_DKPlantNursery_Perm
Definition: LandscapeFarmingEnums.h:458
janfirst
Definition: Plants.h:52
cfg_productapplicendyear
CfgInt cfg_productapplicendyear
tov_FRGrassland_Perm
Definition: LandscapeFarmingEnums.h:589
hay_turning
Definition: Treatment.h:100
toc_GrazingPigs
Definition: LandscapeFarmingEnums.h:811
Weather::GetWind
double GetWind(long a_date)
Definition: Weather.h:508
cfg_UseSocioEconomicFarm
CfgBool cfg_UseSocioEconomicFarm("USE_SOCIO_ECONOMIC_FARMS", CFG_CUSTOM, false)
Used to socio-economic calculations for farms.
tov_DKGrassTussocky_Perm
Definition: LandscapeFarmingEnums.h:435
LE::SetVegHeight
virtual void SetVegHeight(double)
Definition: Elements.h:177
straw_removal
Definition: Treatment.h:124
tole_ChristmasTrees
Definition: LandscapeFarmingEnums.h:156
l_farm_insecticide_kills
static CfgBool l_farm_insecticide_kills("FARM_INSECTICIDE_KILLS", CFG_CUSTOM, true)
LE::TogglePigGrazing
virtual void TogglePigGrazing(void)
Definition: Elements.h:172
fa_n
Definition: Treatment.h:139
shredding
Definition: Treatment.h:126
toc_Horticulture
Definition: LandscapeFarmingEnums.h:812
tole_PermanentSetaside
Definition: LandscapeFarmingEnums.h:68
LowPriPair
Used in event handling.
Definition: Lowqueue.h:83
FarmManager::GetCropMgtPlans
vector< Crop * > * GetCropMgtPlans(void)
Definition: Farm.h:1640
l_el_o_cut_total
CfgFloat l_el_o_cut_total
pheromone
Definition: Treatment.h:149
LE::SetVegGrowthScalerRand
virtual void SetVegGrowthScalerRand()
Definition: Elements.h:156
tov_OrchardCrop
Definition: LandscapeFarmingEnums.h:227
fp_n
Definition: Treatment.h:132
tov_UKPermanentGrass
Definition: LandscapeFarmingEnums.h:281
l_el_o_cut_height
CfgFloat l_el_o_cut_height
manual_weeding
Definition: Treatment.h:148
CfgBool::value
bool value() const
Definition: Configurator.h:164
Farm::InvIntPartition
int InvIntPartition(vector< tpct > *items, int target)
Finds all possible sums of the integers in the items array.
Definition: Farm.cpp:3826
fa_npk
Definition: Treatment.h:67
FarmManager::GetSpilledGrain
double GetSpilledGrain()
Returns the average amount of spilled grain in KJ/m2 this year.
Definition: Farm.cpp:5631
tov_DEOBushFruitPerm
Definition: LandscapeFarmingEnums.h:521
tole_OAsparagusPerm
Definition: LandscapeFarmingEnums.h:178
winter_plough
Definition: Treatment.h:42
fp_calcium
Definition: Treatment.h:65
Farm::m_stockfarmer
bool m_stockfarmer
Definition: Farm.h:1006
LE::ToggleIrrigation
virtual void ToggleIrrigation(void)
Definition: Elements.h:173
spring_harrow
Definition: Treatment.h:45
cut_to_silage
Definition: Treatment.h:98
tov_PTVineyards
Definition: LandscapeFarmingEnums.h:320
tole_AlmondPlantation
Definition: LandscapeFarmingEnums.h:168
tov_NLPermanentGrassGrazed
Definition: LandscapeFarmingEnums.h:261
LE::SetSprayedToday
void SetSprayedToday(bool a_didit)
Definition: Elements.h:367
TTypesOfLandscapeElement
TTypesOfLandscapeElement
Values that represent the types of landscape polygon that are represented in ALMaSS.
Definition: LandscapeFarmingEnums.h:57
g_farm_fixed_crop_enable
CfgBool g_farm_fixed_crop_enable("FARM_FIXED_CROP_ENABLE", CFG_CUSTOM, false)
fa_sludge
Definition: Treatment.h:77
pigs_out
Definition: Treatment.h:96
toc_SetAside
Definition: LandscapeFarmingEnums.h:899
fungicide
Definition: LandscapeFarmingEnums.h:1050
tov_NLOrchardCrop
Definition: LandscapeFarmingEnums.h:271
Weather::GetTemp
double GetTemp(long a_date)
Get the temperature on a particular date.
Definition: Weather.h:476
tole_OliveGrove
Definition: LandscapeFarmingEnums.h:149
tof_Foobar
Definition: LandscapeFarmingEnums.h:697
fp_p
Definition: Treatment.h:54
Farm::GetFarmNumber
int GetFarmNumber(void)
Definition: Farm.h:775
suckering
Definition: Treatment.h:130
LE::SetRotIndex
void SetRotIndex(int a_index)
Definition: Elements.h:371
LE::GrazeVegetationHeight
virtual void GrazeVegetationHeight(double a_reduc)
Definition: Elements.h:295
cut_to_hay
Definition: Treatment.h:97
fa_boron
Definition: Treatment.h:141
tov_PTOliveGroveTraditional
Definition: LandscapeFarmingEnums.h:333
EL_STRIGLING_DELAYTIME
#define EL_STRIGLING_DELAYTIME
Definition: Elements.h:60
Calendar::Date
long Date(void)
Definition: Calendar.h:57
cfg_OliveGroveIntensivePct
CfgFloat cfg_OliveGroveIntensivePct("OLIVEGROVEINTENSIVEPCT", CFG_CUSTOM, 1.00)
Used to define the type of management in olive gorves. By default all are managed intensively....
Farm::Harvested
virtual void Harvested(TTypesOfCrops a_toc, double a_yield)
Records harvest results.
Definition: Farm.cpp:6038
fa_k
Definition: Treatment.h:70
APoint
A simple class defining an x,y coordinate set.
Definition: ALMaSS_Setup.h:52
spring_roll
Definition: Treatment.h:46
tov_DEPermanentGrassLowYield
Definition: LandscapeFarmingEnums.h:500
LE::ForceGrowthInitialiseForFirstYearCrop
virtual void ForceGrowthInitialiseForFirstYearCrop(void)
Definition: Elements.h:187
tov_PTOliveGroveSuperIntensive
Definition: LandscapeFarmingEnums.h:336
tole_Vineyard
Definition: LandscapeFarmingEnums.h:148
FarmManager::GetUseSocioEconomicFarmers
bool GetUseSocioEconomicFarmers()
Get the flag for use of socio-economic farmers.
Definition: Farm.h:1671
LE::GetPollenNectarCurveRef
int GetPollenNectarCurveRef(void)
Returns the pollen nectart curve number.
Definition: Elements.h:519
tov_DKOFarmYoungForest_Perm
Definition: LandscapeFarmingEnums.h:457
tole_OFarmYoungForest
Definition: LandscapeFarmingEnums.h:167
tov_DKGrassLowYield_Perm
Definition: LandscapeFarmingEnums.h:461
LE::SetMownDecay
void SetMownDecay(int a_decaytime_days)
Definition: Elements.h:378
LE::ReduceVeg
virtual void ReduceVeg(double)
Definition: Elements.h:191
fmc_Others
Definition: LandscapeFarmingEnums.h:1003
Farm::m_rotation
vector< TTypesOfVegetation > m_rotation
Definition: Farm.h:1001
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:1023
cfg_OliveGroveSuperIntensivePct
CfgFloat cfg_OliveGroveSuperIntensivePct("OLIVEGROVESUPERINTENSIVEPCT", CFG_CUSTOM, 0)
toc_OOrchardCrop
Definition: LandscapeFarmingEnums.h:845
tole_PermPastureLowYield
Definition: LandscapeFarmingEnums.h:66
fp_nc
Definition: Treatment.h:135
LE::RecalculateBugsNStuff
virtual void RecalculateBugsNStuff(void)
Definition: Elements.h:143
fungicide_treat
Definition: Treatment.h:82
FarmFuncsCostBenefits::LabourCost
double LabourCost
Definition: Farm.h:344
fp_sludge
Definition: Treatment.h:63
tov_PermanentSetAside
Definition: LandscapeFarmingEnums.h:211
fp_greenmanure
Definition: Treatment.h:62
shallow_harrow
Definition: Treatment.h:119
fa_slurry
Definition: Treatment.h:72
tole_NaturalFarmGrass
Definition: LandscapeFarmingEnums.h:171
LowPriority::Empty
bool Empty(void)
Definition: Lowqueue.h:129
LowPriPair::m_pri
long m_pri
Definition: Lowqueue.h:89
cattle_out_low
Definition: Treatment.h:112
harvest_bushfruit
Definition: Treatment.h:137
preseeding_cultivator_sow
Definition: Treatment.h:40
tole_OFarmForest
Definition: LandscapeFarmingEnums.h:161
fp_pk
Definition: Treatment.h:53
tov_DEOOrchard
Definition: LandscapeFarmingEnums.h:519
MapErrorMsg::Warn
void Warn(MapErrorState a_level, std::string a_msg1, std::string a_msg2)
Definition: MapErrorMsg.cpp:69
fa_pks
Definition: Treatment.h:145
FarmManager::GetFarmerList
FarmerList * GetFarmerList()
Gets the farmer list pointer (used by social networks and farmers)
Definition: Farm.h:1654
tov_PlantNursery
Definition: LandscapeFarmingEnums.h:228
LE::GetCattleGrazing
int GetCattleGrazing(void)
Definition: Elements.h:232
LE::GetRotIndex
int GetRotIndex(void)
Definition: Elements.h:373
org_fungicide
Definition: Treatment.h:86
tov_DKGrassGrazed_Perm
Definition: LandscapeFarmingEnums.h:460
cattle_out
Definition: Treatment.h:95
harvestshoots
Definition: Treatment.h:147
FarmEvent::m_event
TTypesOfVegetation m_event
Definition: Farm.h:389
stubble_cultivator_heavy
Definition: Treatment.h:36
cfg_productapplicstartyear
CfgInt cfg_productapplicstartyear
tov_DKBushFruit_Perm1
Definition: LandscapeFarmingEnums.h:442
tov_DEPermanentGrassGrazed
Definition: LandscapeFarmingEnums.h:499
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:1025
tole_FarmYoungForest
Definition: LandscapeFarmingEnums.h:166
Farm::GetArea
int GetArea(void)
Returns the area of arable fields owned by that farm.
Definition: Farm.cpp:1082
APoint::m_x
int m_x
Definition: ALMaSS_Setup.h:55
biocide
Definition: Treatment.h:116
tole_GreenFallow
Definition: LandscapeFarmingEnums.h:172
FarmFuncsCostBenefits::EconomicCost
double EconomicCost
Definition: Farm.h:345
swathing
Definition: Treatment.h:93
tov_DKOBushFruit_Perm1
Definition: LandscapeFarmingEnums.h:444
tole_PermPastureTussocky
Definition: LandscapeFarmingEnums.h:67
tpct::pct
int pct
Definition: Farm.h:365
Landscape::CheckForPesticideRecord
void CheckForPesticideRecord(LE *a_field, TTypesOfPesticideCategory a_pcide)
Check if needed and record pesticide application.
Definition: Landscape.cpp:1623
Landscape::SupplyYearNumber
int SupplyYearNumber(void)
Passes a request on to the associated Calendar class function, returns m_simulationyear
Definition: Landscape.h:2287
FarmEvent::m_field
LE * m_field
Definition: Farm.h:391
tole_OBushFruit
Definition: LandscapeFarmingEnums.h:155
tov_PermanentGrassTussocky
Definition: LandscapeFarmingEnums.h:211
toc_PermanentSetAside
Definition: LandscapeFarmingEnums.h:889
CfgInt::value
int value() const
Definition: Configurator.h:116
tov_DEOPermanentGrassLowYield
Definition: LandscapeFarmingEnums.h:501
tov_FIFeedingGround
Definition: LandscapeFarmingEnums.h:561
herbicide
Definition: LandscapeFarmingEnums.h:1050
tole_EnergyCrop
Definition: LandscapeFarmingEnums.h:158
toc_OBushFruit
Definition: LandscapeFarmingEnums.h:823
fa_manure
Definition: Treatment.h:75
LE::InsectMortality
virtual void InsectMortality(double)
Definition: Elements.h:169
CfgArray_Double::value
std::vector< double > value() const
Definition: Configurator.h:219
toc_Tulips
Definition: LandscapeFarmingEnums.h:913
spring_sow
Definition: Treatment.h:47
Landscape::SupplyCountryCode
std::string SupplyCountryCode()
Returns m_countryCode, e.g. "DK" for Denmark.
Definition: Landscape.h:582
LE::ToggleCattleGrazing
virtual void ToggleCattleGrazing(void)
Definition: Elements.h:171
LE_SIG_NO_GROWTH_REG
#define LE_SIG_NO_GROWTH_REG
Definition: Elements.h:44
cut_weeds
Definition: Treatment.h:106
FarmEvent::m_todo
int m_todo
Definition: Farm.h:388
tov_Undefined
Definition: LandscapeFarmingEnums.h:610
LE_TypeClass::TranslateVegTypes
TTypesOfVegetation TranslateVegTypes(int VegReference)
Definition: Elements.cpp:3724
tov_DKChristmasTrees_Perm
Definition: LandscapeFarmingEnums.h:446
l_farm_cattle_veg_reduce2
static CfgFloat l_farm_cattle_veg_reduce2("FARM_CATTLE_VEG_REDUCE_LOW", CFG_CUSTOM, 0.50)
LE::SetVegType
virtual void SetVegType(TTypesOfVegetation)
Definition: Elements.h:175
LE::ReduceWeedBiomass
virtual void ReduceWeedBiomass(double)
Definition: Elements.h:170
toc_OliveGrove
Definition: LandscapeFarmingEnums.h:837
fp_pks
Definition: Treatment.h:146
TTypesOfCrops
TTypesOfCrops
Definition: LandscapeFarmingEnums.h:781
fp_ns
Definition: Treatment.h:134
LE::SetStubble
void SetStubble(bool a_flag)
Sets the in stubble flag.
Definition: Elements.h:462
LE::PollenNectarReset
virtual void PollenNectarReset()
Definition: Elements.h:512
bed_forming
Definition: Treatment.h:118
LE
Definition: Elements.h:86
product_treat
Definition: Treatment.h:113
tole_YoungForest
Definition: LandscapeFarmingEnums.h:77
g_weather
class Weather * g_weather
Definition: Weather.cpp:49
EL_HERBICIDE_DELAYTIME
#define EL_HERBICIDE_DELAYTIME
Definition: Elements.h:59
LE::SetBirdMaize
void SetBirdMaize(double a_forage)
Definition: Elements.h:276
g_msg
MapErrorMsg * g_msg
Definition: MapErrorMsg.cpp:41
Farm::m_queue
LowPriority< FarmEvent * > m_queue
Definition: Farm.h:999
LowPriPair::m_element
ELEMTYPE m_element
Definition: Lowqueue.h:88
g_farm_fixed_rotation_farms_async
CfgBool g_farm_fixed_rotation_farms_async("FARM_FIXED_ROTATION_FARMS_ASYNC", CFG_CUSTOM, false)
LE::SetLastTreatment
void SetLastTreatment(int a_treatment)
Definition: Elements.cpp:1048
tole_Orchard
Definition: LandscapeFarmingEnums.h:93
autumn_sow
Definition: Treatment.h:41
LE::GrazeVegetation
virtual void GrazeVegetation(double, bool)
Definition: Elements.h:293
TTypesOfVegetation
TTypesOfVegetation
Values that represent the types of vegetation that are represented in ALMaSS.
Definition: LandscapeFarmingEnums.h:192
tov_DKOrchardCrop_Perm
Definition: LandscapeFarmingEnums.h:459
FarmFuncsCostBenefits
Definition: Farm.h:343
Farm::m_OurManager
FarmManager * m_OurManager
Pointer to the FarmManager.
Definition: Farm.h:997
tov_DEOPermanentGrassGrazed
Definition: LandscapeFarmingEnums.h:489
autumn_harrow
Definition: Treatment.h:37
FarmFuncsCostBenefits::EnvImpact
double EnvImpact
Definition: Farm.h:347
tov_DKOFarmForest_Perm
Definition: LandscapeFarmingEnums.h:451
toc_Vineyards
Definition: LandscapeFarmingEnums.h:916
fa_calcium
Definition: Treatment.h:79
Farm::m_farm_num
int m_farm_num
Definition: Farm.h:1007
Farm::SetFunctionData
LE * SetFunctionData(LE *, double, double, int, FarmToDo)
carries out standard setting of data and deals with possible unsprayed margins, returns a pointer to ...
Definition: FarmFuncs.cpp:146
Farm::HandleEvents
virtual void HandleEvents(void)
If there are events to carry out do this, and perhaps start a new crop.
Definition: Farm.cpp:938
tole_AsparagusPerm
Definition: LandscapeFarmingEnums.h:175
tov_DEOrchard
Definition: LandscapeFarmingEnums.h:518
tov_DKEnergyCrop_Perm
Definition: LandscapeFarmingEnums.h:448
tov_DKOOrchardCrop_Perm
Definition: LandscapeFarmingEnums.h:441
fa_ammoniumsulphate
Definition: Treatment.h:74
g_farm_fixed_crop_type
CfgInt g_farm_fixed_crop_type("FARM_FIXED_CROP_TYPE", CFG_CUSTOM, 22)
tole_FarmForest
Definition: LandscapeFarmingEnums.h:160
toc_BushFruit
Definition: LandscapeFarmingEnums.h:786
tole_Field
Definition: LandscapeFarmingEnums.h:65
LE::m_tried_to_do
int m_tried_to_do
Definition: Elements.h:91
autumn_sow_with_ferti
Definition: Treatment.h:136
LE::SetBirdSeed
void SetBirdSeed(double a_forage)
Definition: Elements.h:264
LE::SetVegStore
void SetVegStore(int a_veg)
Definition: Elements.h:138
trial_insecticidetreat
Definition: Treatment.h:108
harvest2
Definition: Plants.h:56
fa_p
Definition: Treatment.h:69
mow
Definition: Treatment.h:105
g_landscape_ptr
Landscape * g_landscape_ptr
Definition: Landscape.cpp:352
tole_MushroomPerm
Definition: LandscapeFarmingEnums.h:176
LE::SetGrowthPhase
virtual void SetGrowthPhase(int)
Definition: Elements.h:185
toc_OPermanentGrassGrazed
Definition: LandscapeFarmingEnums.h:849
l_el_o_cut_green
CfgFloat l_el_o_cut_green
tole_BushFruit
Definition: LandscapeFarmingEnums.h:154
tole_OPermPasturePigs
Definition: LandscapeFarmingEnums.h:163
tov_YoungForest
Definition: LandscapeFarmingEnums.h:222
fa_rsm
Definition: Treatment.h:78
LE::GetUnsprayedMarginPolyRef
int GetUnsprayedMarginPolyRef(void)
Definition: Elements.h:383
LowPriority::Pop
void Pop()
Definition: Lowqueue.h:124
toc_PermanentGrassGrazed
Definition: LandscapeFarmingEnums.h:886
FarmEvent::m_run
long m_run
Definition: Farm.h:387
toc_OGrazingPigs
Definition: LandscapeFarmingEnums.h:836
g_random_fnc
int g_random_fnc(const int a_range)
Definition: ALMaSS_Random.cpp:74
tole_FlowersPerm
Definition: LandscapeFarmingEnums.h:174
fa_npks
Definition: Treatment.h:66
water
Definition: Treatment.h:92
FarmManager::Get_FarmFuncsCB
FarmFuncsCostBenefits Get_FarmFuncsCB(FarmToDo a_action)
Get a specific FarmFunction Cost Benefit.
Definition: Farm.h:1662
stubble_harrowing
Definition: Treatment.h:102
testpesticide
Definition: LandscapeFarmingEnums.h:1050
Calendar::DayInYear
int DayInYear(void)
Definition: Calendar.h:58
LE::ZeroVeg
virtual void ZeroVeg(void)
Definition: Elements.h:190
LE::SetHerbicideDelay
void SetHerbicideDelay(int a_decaytime_days)
Definition: Elements.h:376
insecticide
Definition: LandscapeFarmingEnums.h:1050
cfg_CustomInsecticidesSurvProp
static CfgFloat cfg_CustomInsecticidesSurvProp("CUSTOMINSECTIVIDESURVPROP", CFG_CUSTOM, 0.5, 0, 1.0)
fp_liquidNH3
Definition: Treatment.h:57
tov_FIBufferZone_Perm
Definition: LandscapeFarmingEnums.h:573
molluscicide
Definition: Treatment.h:87
hay_bailing
Definition: Treatment.h:101
l_farm_pig_veg_reduce
static CfgFloat l_farm_pig_veg_reduce("FARM_PIG_VEG_REDUCE", CFG_CUSTOM, 0.98)
tole_PlantNursery
Definition: LandscapeFarmingEnums.h:117
fa_manganesesulphate
Definition: Treatment.h:73
g_letype
class LE_TypeClass * g_letype
Definition: Elements.cpp:806
fp_k
Definition: Treatment.h:55
LE_SIG_NO_FUNGICIDE
#define LE_SIG_NO_FUNGICIDE
Definition: Elements.h:41
LE::Insecticide
virtual void Insecticide(double)
Definition: Elements.h:168
tov_ITOrchard
Definition: LandscapeFarmingEnums.h:607
tpct::index
int index
Definition: Farm.h:364
PROG_START
#define PROG_START
Definition: Farm.h:69
LE::SetPollenNectarType
void SetPollenNectarType(TTypesOfVegetation a_new_veg)
sets the pollen and nectar information based on tov
Definition: Elements.cpp:1181
tov_NLTulips
Definition: LandscapeFarmingEnums.h:258
tole_WoodyEnergyCrop
Definition: LandscapeFarmingEnums.h:116
toc_CloverGrassGrazed1
Definition: LandscapeFarmingEnums.h:792
LE_SIG_NO_MOLLUSC
#define LE_SIG_NO_MOLLUSC
Definition: Elements.h:45
DO_IT_PROB
#define DO_IT_PROB
Definition: FarmFuncs.cpp:60
autumn_plough
Definition: Treatment.h:34
toc_AsparagusEstablishedPlantation
Definition: LandscapeFarmingEnums.h:782
Farm::CheckRotationManagementLoop
void CheckRotationManagementLoop(FarmEvent *ev)
Definition: Farm.cpp:895
LE::GetMaxY
int GetMaxY(void)
Definition: Elements.h:398
Farm::m_rotfilename
string m_rotfilename
Definition: Farm.h:759
tole_RiceField
Definition: LandscapeFarmingEnums.h:150
count
Definition: SubPopulation.h:48
tov_FINaturalGrassland_Perm
Definition: LandscapeFarmingEnums.h:571
l_farm_cattle_veg_reduce
static CfgFloat l_farm_cattle_veg_reduce("FARM_CATTLE_VEG_REDUCE", CFG_CUSTOM, 1.5)
fp_slurry
Definition: Treatment.h:58
tole_OPermPasture
Definition: LandscapeFarmingEnums.h:164
fiber_covering
Definition: Treatment.h:128
tole_OPermPastureLowYield
Definition: LandscapeFarmingEnums.h:165
WARN_BUG
Definition: MapErrorMsg.h:34
tole_PermPasturePigs
Definition: LandscapeFarmingEnums.h:162
tov_DKOGrazingPigs_Perm
Definition: LandscapeFarmingEnums.h:453
toc_OPermanentGrassLowYield
Definition: LandscapeFarmingEnums.h:850
APoint::m_y
int m_y
Definition: ALMaSS_Setup.h:56
g_pest
class Pesticide * g_pest
Definition: Pesticide.cpp:219
toc_FarmForest
Definition: LandscapeFarmingEnums.h:798
tov_PTPermanentGrassGrazed
Definition: LandscapeFarmingEnums.h:308
Farm::m_rotation_sync_index
int m_rotation_sync_index
Definition: Farm.h:1008
tole_FarmFeedingGround
Definition: LandscapeFarmingEnums.h:173
FarmManager::GetIncome
double GetIncome(TTypesOfCrops a_toc)
Get tov-based profit per unit area per unit biomass.
Definition: Farm.cpp:6117
spring_sow_with_ferti
Definition: Treatment.h:115
LE::SetVegParameters
virtual void SetVegParameters(double, double, double, double)
Definition: Elements.h:181
Weather::GetRainPeriod
double GetRainPeriod(long a_date, unsigned int a_period)
Definition: Weather.cpp:688
tole_PermPasture
Definition: LandscapeFarmingEnums.h:69
tov_DEAsparagusEstablishedPlantation
Definition: LandscapeFarmingEnums.h:511
tov_PTOliveGroveIntensive
Definition: LandscapeFarmingEnums.h:335
sleep_all_day
Definition: Treatment.h:33
LE::GetMapIndex
int GetMapIndex(void)
Definition: Elements.h:239
strigling_sow
Definition: Treatment.h:107
FarmManager::AddToManagementStats
void AddToManagementStats(FarmEvent *a_ev)
Adds the event information to the management stats.