![]() |
ALMaSS
1.2 (after EcoStack, March 2024)
The Animal, Landscape and Man Simulation System
|
Farmfuncs.cpp This file contains the source for implementing the farm events
More...
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()) |
Variables | |
Landscape * | g_landscape_ptr |
CfgArray_Double | cfg_pest_product_amounts |
Amount of pesticide applied in grams of active substance per hectare for each of the 10 pesticides. More... | |
CfgInt | l_pest_productapplic_startdate |
CfgInt | l_pest_productapplic_enddate |
CfgInt | l_pest_productapplic_period |
CfgBool | cfg_OptimiseBedriftsmodelCrops |
If set to true, the original farm optimisation model's crop set is used in the farmer decision making model In this mode the optimisation is carried out only once; it is used for the comparioson of the optimisaiton results with the original model. More... | |
CfgInt | cfg_productapplicstartyear |
CfgInt | cfg_productapplicendyear |
CfgBool | cfg_UseSocioEconomicFarm |
Used to socio-economic calculations for farms. More... | |
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, 0.50) |
CfgInt | cfg_farm_cattle_grass_low ("FARM_CATTLE_GRASS_LOW", CFG_CUSTOM, 4) |
CfgInt | cfg_farm_cattle_grass_high ("FARM_CATTLE_GRASS_HIGH", CFG_CUSTOM, 15) |
CfgInt | cfg_farm_cattle_grazing_lvl_rot ("FARM_CATTLE_GRAZING_LVL_ROT", CFG_CUSTOM, 4) |
CfgInt | cfg_farm_cattle_grazing_lvl_pasture ("FARM_CATTLE_GRAZING_LVL_PASTURE", CFG_CUSTOM, 3) |
CfgInt | cfg_farm_cattle_grazing_lvl_lowyield ("FARM_CATTLE_GRAZING_LVL_LOWYIELD", CFG_CUSTOM, 2) |
CfgInt | cfg_farm_cattle_grazing_lvl_tussocky ("FARM_CATTLE_GRAZING_LVL_TUSSOCKY", CFG_CUSTOM, 1) |
CfgArray_Double | cfg_farm_cattle_reduce_height ("FARM_CATTLE_REDUCE_HEIGHT", CFG_CUSTOM, 4, vector< double > {0.2, 0.3, 1.0, 8.0}) |
static CfgFloat | l_farm_pig_veg_reduce ("FARM_PIG_VEG_REDUCE", CFG_CUSTOM, 0.98) |
static CfgFloat | cfg_CustomInsecticidesSurvProp ("CUSTOMINSECTIVIDESURVPROP", 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) |
CfgFloat | cfg_pest_max_wind ("PEST_MAX_WIND", CFG_CUSTOM, 4.5) |
Maximum allowed average wind speed for applying pesticides. More... | |
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... | |
CfgInt | cfg_ORCH_InsecticideDay ("PEST_ORCHINSECTONEDAY", CFG_CUSTOM, 15) |
Provided to allow configuration control of the first insecticide spray in orchard crops - this changes the day in the month. More... | |
CfgInt | cfg_ORCH_InsecticideMonth ("PEST_ORCHINSECTONEMONTH", CFG_CUSTOM, 4) |
Provided to allow configuration control of the first insecticide spray in orchard crops - this changes the month. More... | |
CfgFloat | cfg_biocide_reduction_val ("REDUCE_BIOCIDE_EFFECT", CFG_CUSTOM, 0.0) |
CfgFloat | l_el_o_cut_height |
CfgFloat | l_el_o_cut_green |
CfgFloat | l_el_o_cut_total |
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
#define DO_IT_PROB (l_farm_event_do_it_prob.value()) |
#define DO_IT_PROB_LONG (l_farm_event_do_it_prob_long.value()) |
#define UNREFERENCED_PARAMETER | ( | P | ) | (P) |
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.
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.
CfgFloat cfg_biocide_reduction_val("REDUCE_BIOCIDE_EFFECT", CFG_CUSTOM, 0.0) |
Referenced by Farm::BiocideTreat(), Oedothorax_Egg::OnFarmEvent(), Erigone_Egg::OnFarmEvent(), Erigone_Juvenile::OnFarmEvent(), Oedothorax_Juvenile::OnFarmEvent(), Erigone_Female::OnFarmEvent(), Oedothorax_Female::OnFarmEvent(), Bembidion_Population_Manager::OnFarmEvent(), PoecilusCupreus_Population_Manager::OnFarmEvent(), Ladybird_Population_Manager::OnFarmEvent(), and Osmia_Female::OnFarmEvent().
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.
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.
|
static |
Referenced by Farm::ProductApplication(), and Farm::ProductApplication_DateLimited().
CfgInt cfg_farm_cattle_grass_high("FARM_CATTLE_GRASS_HIGH", CFG_CUSTOM, 15) |
Referenced by DK_GrassTussocky_Perm::Do(), DK_OGrassLowYield_Perm::Do(), DK_GrassLowYield_Perm::Do(), DK_WinterFodderGrass::Do(), DK_WinterCloverGrassGrazedSown::Do(), DK_SpringFodderGrass::Do(), DK_OGrassGrazed_Perm::Do(), DK_GrassGrazed_Perm::Do(), DK_CloverGrassGrazed1::Do(), DK_OSpringFodderGrass::Do(), DK_OCloverGrassGrazed3::Do(), DK_OCloverGrassGrazed2::Do(), DK_OCloverGrassGrazed1::Do(), DK_OWinterFodderGrass::Do(), DK_CloverGrassGrazed3::Do(), DK_OWinterCloverGrassGrazedSown::Do(), and DK_CloverGrassGrazed2::Do().
CfgInt cfg_farm_cattle_grass_low("FARM_CATTLE_GRASS_LOW", CFG_CUSTOM, 4) |
Referenced by DK_GrassTussocky_Perm::Do(), DK_OGrassLowYield_Perm::Do(), DK_GrassLowYield_Perm::Do(), DK_WinterFodderGrass::Do(), DK_WinterCloverGrassGrazedSown::Do(), DK_SpringFodderGrass::Do(), DK_OGrassGrazed_Perm::Do(), DK_GrassGrazed_Perm::Do(), DK_CloverGrassGrazed1::Do(), DK_OSpringFodderGrass::Do(), DK_OCloverGrassGrazed3::Do(), DK_OCloverGrassGrazed2::Do(), DK_OCloverGrassGrazed1::Do(), DK_OWinterFodderGrass::Do(), DK_CloverGrassGrazed3::Do(), DK_OWinterCloverGrassGrazedSown::Do(), DK_CloverGrassGrazed2::Do(), and VegElement::GrazeVegetationHeight().
CfgInt cfg_farm_cattle_grazing_lvl_lowyield("FARM_CATTLE_GRAZING_LVL_LOWYIELD", CFG_CUSTOM, 2) |
Referenced by Landscape::NewElement(), and VegElement::SetCropType().
CfgInt cfg_farm_cattle_grazing_lvl_pasture("FARM_CATTLE_GRAZING_LVL_PASTURE", CFG_CUSTOM, 3) |
Referenced by Landscape::NewElement(), and VegElement::SetCropType().
CfgInt cfg_farm_cattle_grazing_lvl_rot("FARM_CATTLE_GRAZING_LVL_ROT", CFG_CUSTOM, 4) |
Referenced by VegElement::SetCropType().
CfgInt cfg_farm_cattle_grazing_lvl_tussocky("FARM_CATTLE_GRAZING_LVL_TUSSOCKY", CFG_CUSTOM, 1) |
Referenced by Landscape::NewElement(), and VegElement::SetCropType().
CfgArray_Double cfg_farm_cattle_reduce_height("FARM_CATTLE_REDUCE_HEIGHT", CFG_CUSTOM, 4, vector< double > {0.2, 0.3, 1.0, 8.0}) |
Referenced by Farm::CattleIsOut(), and Farm::CattleOut().
CfgBool cfg_OptimiseBedriftsmodelCrops |
If set to true, the original farm optimisation model's crop set is used in the farmer decision making model In this mode the optimisation is carried out only once; it is used for the comparioson of the optimisaiton results with the original model.
CfgInt cfg_ORCH_InsecticideDay("PEST_ORCHINSECTONEDAY", CFG_CUSTOM, 15) |
Provided to allow configuration control of the first insecticide spray in orchard crops - this changes the day in the month.
CfgInt cfg_ORCH_InsecticideMonth("PEST_ORCHINSECTONEMONTH", CFG_CUSTOM, 4) |
Provided to allow configuration control of the first insecticide spray in orchard crops - this changes the month.
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.
Referenced by WinterRape::Do().
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.
Referenced by WinterRape::Do().
CfgFloat cfg_pest_max_wind("PEST_MAX_WIND", CFG_CUSTOM, 4.5) |
Maximum allowed average wind speed for applying pesticides.
Referenced by Farm::BiocideTreat(), Farm::FungicideTreat(), Farm::GrowthRegulator(), Farm::HerbicideTreat(), Farm::InsecticideTreat(), Farm::Molluscicide(), and Farm::ProductApplication().
CfgArray_Double cfg_pest_product_amounts |
Amount of pesticide applied in grams of active substance per hectare for each of the 10 pesticides.
Referenced by Osmia_Population_Manager::Osmia_Population_Manager().
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.
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.
CfgInt cfg_productapplicendyear |
Referenced by Farm::ProductApplication_DateLimited().
CfgInt cfg_productapplicstartyear |
Referenced by Farm::ProductApplication_DateLimited().
CfgInt cfg_SB_InsecticideDay |
Provided to allow configuration control of the first insecticide spray in spring barley crops - this changes the day in the month.
Referenced by SpringBarleyCloverGrass::Do(), SpringBarleySilage::Do(), and SpringBarley::Do().
CfgInt cfg_SB_InsecticideMonth |
Provided to allow configuration control of the first insecticide spray in spring barley crops - this changes the month.
Referenced by SpringBarleyCloverGrass::Do(), SpringBarleySilage::Do(), and SpringBarley::Do().
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.
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.
CfgBool cfg_UseSocioEconomicFarm |
Used to socio-economic calculations for farms.
Referenced by Farm::CalculateTreatmentCosts(), FarmManager::FarmManager(), and Farm::HandleEvents().
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.
Referenced by TestCrop::Do(), and PLWinterWheat::Do().
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.
Referenced by TestCrop::Do(), and PLWinterWheat::Do().
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.
Referenced by WinterWheat::Do().
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.
Referenced by WinterWheat::Do().
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.
Referenced by PLWinterWheat::Do().
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.
Referenced by PLWinterWheat::Do().
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.
Referenced by PLWinterWheat::Do().
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.
Referenced by TestCrop::Do(), and PLWinterWheat::Do().
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.
Referenced by TestCrop::Do(), and PLWinterWheat::Do().
Landscape* g_landscape_ptr |
Referenced by Farm::CattleIsOut(), Farm::CattleIsOutLow(), Farm::CattleIsOutLow2(), Farm::CattleOut(), Farm::CattleOutLowGrazing(), Farm::FungicideTreat(), Farm::HerbicideTreat(), Farm::InsecticideTreat(), Farm::Irrigation(), Farm::Molluscicide(), Farm::Mowing(), Farm::PigsAreOut(), Farm::PigsAreOutForced(), Farm::PigsOut(), Farm::ProductApplication(), Farm::ProductApplication_DateLimited(), Farm::SetFunctionData(), Farm::Suckering(), and Farm::WinterHarrow().
CfgFloat l_el_o_cut_green |
Referenced by Farm::CutOrch(), Orchard::Cutting(), and MownGrassStrip::Cutting().
CfgFloat l_el_o_cut_height |
Referenced by Farm::CutOrch(), Orchard::Cutting(), and MownGrassStrip::Cutting().
CfgFloat l_el_o_cut_total |
Referenced by Farm::CutOrch(), Orchard::Cutting(), and MownGrassStrip::Cutting().
|
static |
Referenced by Farm::CattleIsOut(), and Farm::CattleOut().
|
static |
Referenced by Farm::CattleIsOutLow(), Farm::CattleIsOutLow2(), and Farm::CattleOutLowGrazing().
|
static |
|
static |
|
static |
Referenced by Farm::HerbicideTreat().
|
static |
Referenced by Farm::BiocideTreat(), Farm::InsecticideTreat(), and Farm::ProductApplication().
|
static |
Referenced by Farm::PigsAreOutForced(), and Farm::PigsOut().
CfgInt l_pest_productapplic_enddate |
CfgInt l_pest_productapplic_period |
CfgInt l_pest_productapplic_startdate |