ALMaSS Skylark ODDox  1.1
The skylark model description following ODdox protocol
farmfuncs.cpp File Reference

Farmfuncs.cpp This file contains the source for implementing the farm events
More...

#include "ls.h"

Macros

#define UNREFERENCED_PARAMETER(P)   (P)
 
#define DO_IT_PROB   (l_farm_event_do_it_prob.value())
 
#define DO_IT_PROB_LONG   (l_farm_event_do_it_prob_long.value())
 

Functions

static CfgInt l_farm_event_do_it_prob ("FARM_EVENT_DO_IT_PROB", CFG_PRIVATE, 50)
 
static CfgInt l_farm_event_do_it_prob_long ("FARM_EVENT_DO_IT_PROB_LONG", CFG_PRIVATE, 5)
 
static CfgFloat l_farm_cattle_veg_reduce ("FARM_CATTLE_VEG_REDUCE", CFG_CUSTOM, 1.5)
 
static CfgFloat l_farm_cattle_veg_reduce2 ("FARM_CATTLE_VEG_REDUCE_LOW", CFG_CUSTOM, 1.00)
 
static CfgFloat l_farm_pig_veg_reduce ("FARM_PIG_VEG_REDUCE", CFG_CUSTOM, 0.98)
 
static CfgFloat cfg_CustomInsecticideKillProp ("CUSTOMINSECTIVIDEKILLPROP", CFG_CUSTOM, 0.5, 0, 1.0)
 
static CfgBool l_farm_insecticide_kills ("FARM_INSECTICIDE_KILLS", CFG_CUSTOM, true)
 
static CfgBool l_farm_herbicide_kills ("FARM_PESTICIDE_KILLS", CFG_CUSTOM, true)
 
CfgInt cfg_WW_InsecticideDay ("PEST_WWINSECTONEDAY", CFG_CUSTOM, 1)
 Provided to allow configuration control of the first insecticide spray in winter wheat - this changes the day in the month. More...
 
CfgInt cfg_WW_InsecticideMonth ("PEST_WWINSECTONEMONTH", CFG_CUSTOM, 5)
 Provided to allow configuration control of the first insecticide spray in winter wheat - this changes the month. More...
 
CfgFloat cfg_WW_conv_tillage_prop1 ("TILLAGE_WWCONVONEPROP", CFG_CUSTOM, 1.0)
 Provided to allow configuration control of the proportion of farmers doing first conventional tillage in winter wheat - this changes between 0 and 1. More...
 
CfgFloat cfg_WW_conv_tillage_prop2 ("TILLAGE_WWCONVTWOPROP", CFG_CUSTOM, 1.0)
 Provided to allow configuration control of the proportion of farmers doing second conventional tillage in winter wheat - this changes between 0 and 1. More...
 
CfgFloat cfg_WW_NINV_tillage_prop1 ("TILLAGE_WWNINVONEPROP", CFG_CUSTOM, 1.0)
 Provided to allow configuration control of the proportion of farmers doing first non-inversion tillage in winter wheat - this changes between 0 and 1. More...
 
CfgFloat cfg_WW_NINV_tillage_prop2 ("TILLAGE_WWNINVTWOPROP", CFG_CUSTOM, 1.0)
 Provided to allow configuration control of the proportion of farmers doing second non-inversion tillage in winter wheat - this changes between 0 and 1. More...
 
CfgFloat cfg_WW_isecticide_prop1 ("PEST_WWINSECTONEPROP", CFG_CUSTOM, 1.0)
 Provided to allow configuration control of the proportion of farmers doing first insecticide spray in winter wheat - this changes between 0 and 1. More...
 
CfgFloat cfg_WW_isecticide_prop2 ("PEST_WWINSECTTWOPROP", CFG_CUSTOM, 1.0)
 Provided to allow configuration control of the proportion of farmers doing second insecticide spray in winter wheat - this changes between 0 and 1. More...
 
CfgFloat cfg_WW_isecticide_prop3 ("PEST_WWINSECTTHREEPROP", CFG_CUSTOM, 1.0)
 Provided to allow configuration control of the proportion of farmers doing third insecticide spray in winter wheat - this changes between 0 and 1. More...
 
CfgInt cfg_SB_InsecticideDay ("PEST_SBINSECTONEDAY", CFG_CUSTOM, 15)
 Provided to allow configuration control of the first insecticide spray in spring barley crops - this changes the day in the month. More...
 
CfgInt cfg_SB_InsecticideMonth ("PEST_SBINSECTONEMONTH", CFG_CUSTOM, 5)
 Provided to allow configuration control of the first insecticide spray in spring barley crops - this changes the month. More...
 
CfgInt cfg_OSR_InsecticideDay ("PEST_OSRINSECTONEDAY", CFG_CUSTOM, 30)
 Provided to allow configuration control of the first insecticide spray in OSR - this changes the day in the month. More...
 
CfgInt cfg_OSR_InsecticideMonth ("PEST_OSRINSECTONEMONTH", CFG_CUSTOM, 4)
 Provided to allow configuration control of the first insecticide spray in OSR - this changes the month. More...
 
CfgInt cfg_CAB_InsecticideDay ("PEST_CABINSECTONEDAY", CFG_CUSTOM, 15)
 Provided to allow configuration control of the first insecticide spray in cabbage crops - this changes the day in the month. More...
 
CfgInt cfg_CAB_InsecticideMonth ("PEST_CABINSECTONEMONTH", CFG_CUSTOM, 5)
 Provided to allow configuration control of the first insecticide spray in cabbage crops - this changes the month. More...
 
CfgInt cfg_TU_InsecticideDay ("PEST_TUINSECTONEDAY", CFG_CUSTOM, 15)
 Provided to allow configuration control of the first insecticide spray in tulip crops - this changes the day in the month. More...
 
CfgInt cfg_TU_InsecticideMonth ("PEST_TUINSECTONEMONTH", CFG_CUSTOM, 5)
 Provided to allow configuration control of the first insecticide spray in tulip crops - this changes the month. More...
 
CfgInt cfg_POT_InsecticideDay ("PEST_POTINSECTONEDAY", CFG_CUSTOM, 15)
 Provided to allow configuration control of the first insecticide spray in potatoes crops - this changes the day in the month. More...
 
CfgInt cfg_POT_InsecticideMonth ("PEST_POTINSECTONEMONTH", CFG_CUSTOM, 5)
 Provided to allow configuration control of the first insecticide spray in potatoes crops - this changes the month. More...
 
CfgInt cfg_BE_InsecticideDay ("PEST_BEINSECTONEDAY", CFG_CUSTOM, 15)
 Provided to allow configuration control of the first insecticide spray in beet crops - this changes the day in the month. More...
 
CfgInt cfg_BE_InsecticideMonth ("PEST_BEINSECTONEMONTH", CFG_CUSTOM, 5)
 Provided to allow configuration control of the first insecticide spray in beet crops - this changes the month. More...
 

Variables

Landscapeg_landscape_p
 
CfgFloat cfg_pest_product_1_amount
 
CfgInt l_pest_productapplic_startdate
 
CfgInt l_pest_productapplic_enddate
 
CfgInt l_pest_productapplic_period
 
CfgBool cfg_OptimiseBedriftsmodelCrops
 
CfgInt cfg_productapplicstartyear
 
CfgInt cfg_productapplicendyear
 
CfgFloat l_el_o_cut_height
 
CfgFloat l_el_o_cut_green
 
CfgFloat l_el_o_cut_total
 

Detailed Description

Farmfuncs.cpp This file contains the source for implementing the farm events

by Frank Nikolaisen & Chris J. Topping
Initial version of June 2003, but under continual change.
All rights reserved.

Doxygen formatted comments in July 2008

Macro Definition Documentation

◆ DO_IT_PROB

#define DO_IT_PROB   (l_farm_event_do_it_prob.value())

◆ DO_IT_PROB_LONG

#define DO_IT_PROB_LONG   (l_farm_event_do_it_prob_long.value())

◆ UNREFERENCED_PARAMETER

#define UNREFERENCED_PARAMETER (   P)    (P)

Function Documentation

◆ cfg_BE_InsecticideDay()

CfgInt cfg_BE_InsecticideDay ( "PEST_BEINSECTONEDAY"  ,
CFG_CUSTOM  ,
15   
)

Provided to allow configuration control of the first insecticide spray in beet crops - this changes the day in the month.

◆ cfg_BE_InsecticideMonth()

CfgInt cfg_BE_InsecticideMonth ( "PEST_BEINSECTONEMONTH"  ,
CFG_CUSTOM  ,
 
)

Provided to allow configuration control of the first insecticide spray in beet crops - this changes the month.

◆ cfg_CAB_InsecticideDay()

CfgInt cfg_CAB_InsecticideDay ( "PEST_CABINSECTONEDAY"  ,
CFG_CUSTOM  ,
15   
)

Provided to allow configuration control of the first insecticide spray in cabbage crops - this changes the day in the month.

◆ cfg_CAB_InsecticideMonth()

CfgInt cfg_CAB_InsecticideMonth ( "PEST_CABINSECTONEMONTH"  ,
CFG_CUSTOM  ,
 
)

Provided to allow configuration control of the first insecticide spray in cabbage crops - this changes the month.

◆ cfg_CustomInsecticideKillProp()

static CfgFloat cfg_CustomInsecticideKillProp ( "CUSTOMINSECTIVIDEKILLPROP"  ,
CFG_CUSTOM  ,
0.  5,
,
1.  0 
)
static

◆ cfg_OSR_InsecticideDay()

CfgInt cfg_OSR_InsecticideDay ( "PEST_OSRINSECTONEDAY"  ,
CFG_CUSTOM  ,
30   
)

Provided to allow configuration control of the first insecticide spray in OSR - this changes the day in the month.

◆ cfg_OSR_InsecticideMonth()

CfgInt cfg_OSR_InsecticideMonth ( "PEST_OSRINSECTONEMONTH"  ,
CFG_CUSTOM  ,
 
)

Provided to allow configuration control of the first insecticide spray in OSR - this changes the month.

◆ cfg_POT_InsecticideDay()

CfgInt cfg_POT_InsecticideDay ( "PEST_POTINSECTONEDAY"  ,
CFG_CUSTOM  ,
15   
)

Provided to allow configuration control of the first insecticide spray in potatoes crops - this changes the day in the month.

◆ cfg_POT_InsecticideMonth()

CfgInt cfg_POT_InsecticideMonth ( "PEST_POTINSECTONEMONTH"  ,
CFG_CUSTOM  ,
 
)

Provided to allow configuration control of the first insecticide spray in potatoes crops - this changes the month.

◆ cfg_SB_InsecticideDay()

CfgInt cfg_SB_InsecticideDay ( "PEST_SBINSECTONEDAY"  ,
CFG_CUSTOM  ,
15   
)

Provided to allow configuration control of the first insecticide spray in spring barley crops - this changes the day in the month.

◆ cfg_SB_InsecticideMonth()

CfgInt cfg_SB_InsecticideMonth ( "PEST_SBINSECTONEMONTH"  ,
CFG_CUSTOM  ,
 
)

Provided to allow configuration control of the first insecticide spray in spring barley crops - this changes the month.

◆ cfg_TU_InsecticideDay()

CfgInt cfg_TU_InsecticideDay ( "PEST_TUINSECTONEDAY"  ,
CFG_CUSTOM  ,
15   
)

Provided to allow configuration control of the first insecticide spray in tulip crops - this changes the day in the month.

◆ cfg_TU_InsecticideMonth()

CfgInt cfg_TU_InsecticideMonth ( "PEST_TUINSECTONEMONTH"  ,
CFG_CUSTOM  ,
 
)

Provided to allow configuration control of the first insecticide spray in tulip crops - this changes the month.

◆ cfg_WW_conv_tillage_prop1()

CfgFloat cfg_WW_conv_tillage_prop1 ( "TILLAGE_WWCONVONEPROP"  ,
CFG_CUSTOM  ,
1.  0 
)

Provided to allow configuration control of the proportion of farmers doing first conventional tillage in winter wheat - this changes between 0 and 1.

◆ cfg_WW_conv_tillage_prop2()

CfgFloat cfg_WW_conv_tillage_prop2 ( "TILLAGE_WWCONVTWOPROP"  ,
CFG_CUSTOM  ,
1.  0 
)

Provided to allow configuration control of the proportion of farmers doing second conventional tillage in winter wheat - this changes between 0 and 1.

◆ cfg_WW_InsecticideDay()

CfgInt cfg_WW_InsecticideDay ( "PEST_WWINSECTONEDAY"  ,
CFG_CUSTOM  ,
 
)

Provided to allow configuration control of the first insecticide spray in winter wheat - this changes the day in the month.

◆ cfg_WW_InsecticideMonth()

CfgInt cfg_WW_InsecticideMonth ( "PEST_WWINSECTONEMONTH"  ,
CFG_CUSTOM  ,
 
)

Provided to allow configuration control of the first insecticide spray in winter wheat - this changes the month.

◆ cfg_WW_isecticide_prop1()

CfgFloat cfg_WW_isecticide_prop1 ( "PEST_WWINSECTONEPROP"  ,
CFG_CUSTOM  ,
1.  0 
)

Provided to allow configuration control of the proportion of farmers doing first insecticide spray in winter wheat - this changes between 0 and 1.

◆ cfg_WW_isecticide_prop2()

CfgFloat cfg_WW_isecticide_prop2 ( "PEST_WWINSECTTWOPROP"  ,
CFG_CUSTOM  ,
1.  0 
)

Provided to allow configuration control of the proportion of farmers doing second insecticide spray in winter wheat - this changes between 0 and 1.

◆ cfg_WW_isecticide_prop3()

CfgFloat cfg_WW_isecticide_prop3 ( "PEST_WWINSECTTHREEPROP"  ,
CFG_CUSTOM  ,
1.  0 
)

Provided to allow configuration control of the proportion of farmers doing third insecticide spray in winter wheat - this changes between 0 and 1.

◆ cfg_WW_NINV_tillage_prop1()

CfgFloat cfg_WW_NINV_tillage_prop1 ( "TILLAGE_WWNINVONEPROP"  ,
CFG_CUSTOM  ,
1.  0 
)

Provided to allow configuration control of the proportion of farmers doing first non-inversion tillage in winter wheat - this changes between 0 and 1.

◆ cfg_WW_NINV_tillage_prop2()

CfgFloat cfg_WW_NINV_tillage_prop2 ( "TILLAGE_WWNINVTWOPROP"  ,
CFG_CUSTOM  ,
1.  0 
)

Provided to allow configuration control of the proportion of farmers doing second non-inversion tillage in winter wheat - this changes between 0 and 1.

◆ l_farm_cattle_veg_reduce()

static CfgFloat l_farm_cattle_veg_reduce ( "FARM_CATTLE_VEG_REDUCE"  ,
CFG_CUSTOM  ,
1.  5 
)
static

◆ l_farm_cattle_veg_reduce2()

static CfgFloat l_farm_cattle_veg_reduce2 ( "FARM_CATTLE_VEG_REDUCE_LOW"  ,
CFG_CUSTOM  ,
1.  00 
)
static

◆ l_farm_event_do_it_prob()

static CfgInt l_farm_event_do_it_prob ( "FARM_EVENT_DO_IT_PROB"  ,
CFG_PRIVATE  ,
50   
)
static

◆ l_farm_event_do_it_prob_long()

static CfgInt l_farm_event_do_it_prob_long ( "FARM_EVENT_DO_IT_PROB_LONG"  ,
CFG_PRIVATE  ,
 
)
static

◆ l_farm_herbicide_kills()

static CfgBool l_farm_herbicide_kills ( "FARM_PESTICIDE_KILLS"  ,
CFG_CUSTOM  ,
true   
)
static

◆ l_farm_insecticide_kills()

static CfgBool l_farm_insecticide_kills ( "FARM_INSECTICIDE_KILLS"  ,
CFG_CUSTOM  ,
true   
)
static

◆ l_farm_pig_veg_reduce()

static CfgFloat l_farm_pig_veg_reduce ( "FARM_PIG_VEG_REDUCE"  ,
CFG_CUSTOM  ,
0.  98 
)
static

Variable Documentation

◆ cfg_OptimiseBedriftsmodelCrops

◆ cfg_pest_product_1_amount

CfgFloat cfg_pest_product_1_amount

◆ cfg_productapplicendyear

CfgInt cfg_productapplicendyear

◆ cfg_productapplicstartyear

CfgInt cfg_productapplicstartyear

◆ g_landscape_p

Landscape* g_landscape_p

Referenced by Farm::AutumnHarrow(), Farm::AutumnPlough(), Farm::AutumnRoll(), Farm::AutumnSow(), Farm::BedForming(), Farm::Biocide(), Farm::BulbHarvest(), Farm::BurnStrawStubble(), Farm::CattleIsOut(), Farm::CattleIsOutLow(), Farm::CattleOut(), Farm::CattleOutLowGrazing(), Farm::CutOrch(), Farm::CutToHay(), Farm::CutToSilage(), Farm::CutWeeds(), Farm::DeepPlough(), Farm::FA_AmmoniumSulphate(), Farm::FA_Calcium(), Farm::FA_GreenManure(), Farm::FA_ManganeseSulphate(), Farm::FA_Manure(), Farm::FA_NPK(), Farm::FA_NPKS(), Farm::FA_PK(), Farm::FA_RSM(), Farm::FA_Sludge(), Farm::FA_Slurry(), Farm::FlowerCutting(), Farm::FP_AmmoniumSulphate(), Farm::FP_Calcium(), Farm::FP_GreenManure(), Farm::FP_LiquidNH3(), Farm::FP_ManganeseSulphate(), Farm::FP_Manure(), Farm::FP_NPK(), Farm::FP_NPKS(), Farm::FP_PK(), Farm::FP_RSM(), Farm::FP_Sludge(), Farm::FP_Slurry(), Farm::FungicideTreat(), OptimisingFarm::FungicideTreat(), Farm::Harvest(), OptimisingFarm::Harvest(), Farm::HarvestLong(), Farm::HayBailing(), Farm::HayTurning(), Farm::HeavyCultivatorAggregate(), Farm::HerbicideTreat(), OptimisingFarm::HerbicideTreat(), Farm::HillingUp(), Farm::InsecticideTreat(), OptimisingFarm::InsecticideTreat(), Farm::Molluscicide(), Farm::PigsAreOut(), Farm::PigsAreOutForced(), Farm::PigsOut(), Farm::PreseedingCultivator(), Farm::PreseedingCultivatorSow(), Farm::ProductApplication(), Farm::ProductApplication_DateLimited(), Farm::RowCultivation(), Farm::ShallowHarrow(), Farm::SleepAllDay(), Farm::SpringHarrow(), Farm::SpringPlough(), Farm::SpringRoll(), Farm::SpringSow(), Farm::SpringSowWithFerti(), Farm::StrawChopping(), Farm::StrawCovering(), Farm::StrawRemoval(), Farm::Strigling(), Farm::StriglingHill(), Farm::StriglingSow(), Farm::StubbleCultivatorHeavy(), Farm::StubbleHarrowing(), Farm::StubblePlough(), Farm::Swathing(), Farm::Water(), and Farm::WinterPlough().

◆ l_el_o_cut_green

CfgFloat l_el_o_cut_green

Referenced by Farm::CutOrch().

◆ l_el_o_cut_height

CfgFloat l_el_o_cut_height

Referenced by Farm::CutOrch().

◆ l_el_o_cut_total

CfgFloat l_el_o_cut_total

Referenced by Farm::CutOrch().

◆ l_pest_productapplic_enddate

CfgInt l_pest_productapplic_enddate

◆ l_pest_productapplic_period

CfgInt l_pest_productapplic_period

◆ l_pest_productapplic_startdate

CfgInt l_pest_productapplic_startdate