ALMaSS Rabbit ODdox  1.1
The rabbit model description following ODdox protocol
farm.cpp File Reference

Farm.cpp This file contains the source for the Farm class and OptimisingFarm
More...

#include <string.h>
#include <algorithm>
#include <vector>
#include <iostream>
#include <fstream>
#include "../BatchALMaSS/BoostRandomGenerators.h"
#include "../ALMaSSDefines.h"
#include <math.h>
#include <time.h>
#include <random>
#include "../BatchALMaSS/ALMaSS_Setup.h"
#include "../Landscape/ls.h"
#include "../Landscape/cropprogs/BroadBeans.h"
#include "../Landscape/cropprogs/Carrots.h"
#include "../Landscape/cropprogs/CloverGrassGrazed1.h"
#include "../Landscape/cropprogs/CloverGrassGrazed2.h"
#include "../Landscape/cropprogs/FieldPeas.h"
#include "../Landscape/cropprogs/FieldPeasSilage.h"
#include "../Landscape/cropprogs/Fodderbeet.h"
#include "../Landscape/cropprogs/Sugarbeet.h"
#include "../Landscape/cropprogs/FodderGrass.h"
#include "../Landscape/cropprogs/Maize.h"
#include "../Landscape/cropprogs/MaizeSilage.h"
#include "../Landscape/cropprogs/OFodderbeet.h"
#include "../Landscape/cropprogs/OMaizeSilage.h"
#include "../Landscape/cropprogs/OBarleyPeaCloverGrass.h"
#include "../Landscape/cropprogs/OSBarleySilage.h"
#include "../Landscape/cropprogs/OCarrots.h"
#include "../Landscape/cropprogs/OCloverGrassGrazed1.h"
#include "../Landscape/cropprogs/OCloverGrassGrazed2.h"
#include "../Landscape/cropprogs/OCloverGrassSilage1.h"
#include "../Landscape/cropprogs/OFirstYearDanger.h"
#include "../Landscape/cropprogs/OGrazingPigs.h"
#include "../Landscape/cropprogs/OPermanentGrassGrazed.h"
#include "../Landscape/cropprogs/OSeedGrass1.h"
#include "../Landscape/cropprogs/OSeedGrass2.h"
#include "../Landscape/cropprogs/OSpringBarleyPigs.h"
#include "../Landscape/cropprogs/OFieldPeas.h"
#include "../Landscape/cropprogs/OFieldPeasSilage.h"
#include "../Landscape/cropprogs/OrchardCrop.h"
#include "../Landscape/cropprogs/OOats.h"
#include "../Landscape/cropprogs/Oats.h"
#include "../Landscape/cropprogs/OPotatoes.h"
#include "../Landscape/cropprogs/OSpringBarley.h"
#include "../Landscape/cropprogs/OSpringBarleyExt.h"
#include "../Landscape/cropprogs/OWinterBarley.h"
#include "../Landscape/cropprogs/OWinterBarleyExt.h"
#include "../Landscape/cropprogs/OWinterRape.h"
#include "../Landscape/cropprogs/OWinterRye.h"
#include "../Landscape/cropprogs/OWinterWheat.h"
#include "../Landscape/cropprogs/OWinterWheatUndersown.h"
#include "../Landscape/cropprogs/OWinterWheatUndersownExt.h"
#include "../Landscape/cropprogs/PermanentGrassGrazed.h"
#include "../Landscape/cropprogs/PermanentGrassLowYield.h"
#include "../Landscape/cropprogs/PermanentGrassTussocky.h"
#include "../Landscape/cropprogs/PermanentSetAside.h"
#include "../Landscape/cropprogs/Potatoes.h"
#include "../Landscape/cropprogs/PotatoesIndustry.h"
#include "../Landscape/cropprogs/seedgrass1.h"
#include "../Landscape/cropprogs/seedgrass2.h"
#include "../Landscape/cropprogs/setaside.h"
#include "../Landscape/cropprogs/SpringBarley.h"
#include "../Landscape/cropprogs/SpringBarleySpr.h"
#include "../Landscape/cropprogs/SpringBarleyPTreatment.h"
#include "../Landscape/cropprogs/SpringBarleySKManagement.h"
#include "../Landscape/cropprogs/SpringBarleyCloverGrass.h"
#include "../Landscape/cropprogs/SpringBarleySeed.h"
#include "../Landscape/cropprogs/SpringBarleySilage.h"
#include "../Landscape/cropprogs/SpringRape.h"
#include "../Landscape/cropprogs/Triticale.h"
#include "../Landscape/cropprogs/OTriticale.h"
#include "../Landscape/cropprogs/WinterBarley.h"
#include "../Landscape/cropprogs/winterrape.h"
#include "../Landscape/cropprogs/WinterRye.h"
#include "../Landscape/cropprogs/WinterWheat.h"
#include "../Landscape/cropprogs/WWheatPControl.h"
#include "../Landscape/cropprogs/WWheatPTreatment.h"
#include "../Landscape/cropprogs/WWheatPToxicControl.h"
#include "../Landscape/cropprogs/AgroChemIndustryCereal.h"
#include "../Landscape/cropprogs/WinterWheatStrigling.h"
#include "../Landscape/cropprogs/WinterWheatStriglingCulm.h"
#include "../Landscape/cropprogs/WinterWheatStriglingSingle.h"
#include "../Landscape/cropprogs/SpringBarleyCloverGrassStrigling.h"
#include "../Landscape/cropprogs/SpringBarleyStrigling.h"
#include "../Landscape/cropprogs/SpringBarleyStriglingCulm.h"
#include "../Landscape/cropprogs/SpringBarleyStriglingSingle.h"
#include "../Landscape/cropprogs/MaizeStrigling.h"
#include "../Landscape/cropprogs/winterrapestrigling.h"
#include "../Landscape/cropprogs/WinterRyeStrigling.h"
#include "../Landscape/cropprogs/WinterBarleyStrigling.h"
#include "../Landscape/cropprogs/FieldPeasStrigling.h"
#include "../Landscape/cropprogs/SpringBarleyPeaCloverGrassStrigling.h"
#include "../Landscape/cropprogs/YoungForest.h"
#include "../Landscape/cropprogs/NorwegianPotatoes.h"
#include "../Landscape/cropprogs/NorwegianOats.h"
#include "../Landscape/cropprogs/NorwegianSpringBarley.h"
#include "../Landscape/cropprogs/PLWinterWheat.h"
#include "../Landscape/cropprogs/PLWinterRape.h"
#include "../Landscape/cropprogs/PLWinterBarley.h"
#include "../Landscape/cropprogs/PLWinterTriticale.h"
#include "../Landscape/cropprogs/PLWinterRye.h"
#include "../Landscape/cropprogs/PLSpringWheat.h"
#include "../Landscape/cropprogs/PLSpringBarley.h"
#include "../Landscape/cropprogs/PLMaize.h"
#include "../Landscape/cropprogs/PLMaizeSilage.h"
#include "../Landscape/cropprogs/PLPotatoes.h"
#include "../Landscape/cropprogs/PLBeet.h"
#include "../Landscape/cropprogs/PLFodderLucerne1.h"
#include "../Landscape/cropprogs/PLFodderLucerne2.h"
#include "../Landscape/cropprogs/PLCarrots.h"
#include "../Landscape/cropprogs/PLSpringBarleySpr.h"
#include "../Landscape/cropprogs/PLWinterWheatLate.h"
#include "../Landscape/cropprogs/PLBeetSpr.h"
#include "../Landscape/cropprogs/PLBeans.h"
#include "../Landscape/cropprogs/NLBeet.h"
#include "../Landscape/cropprogs/NLCarrots.h"
#include "../Landscape/cropprogs/NLMaize.h"
#include "../Landscape/cropprogs/NLPotatoes.h"
#include "../Landscape/cropprogs/NLSpringBarley.h"
#include "../Landscape/cropprogs/NLWinterWheat.h"
#include "../Landscape/cropprogs/NLCabbage.h"
#include "../Landscape/cropprogs/NLTulips.h"
#include "../Landscape/cropprogs/NLGrassGrazed1.h"
#include "../Landscape/cropprogs/NLGrassGrazed1Spring.h"
#include "../Landscape/cropprogs/NLGrassGrazed2.h"
#include "../Landscape/cropprogs/NLGrassGrazedLast.h"
#include "../Landscape/cropprogs/NLPermanentGrassGrazed.h"
#include "../Landscape/cropprogs/NLBeetSpring.h"
#include "../Landscape/cropprogs/NLCarrotsSpring.h"
#include "../Landscape/cropprogs/NLMaizeSpring.h"
#include "../Landscape/cropprogs/NLPotatoesSpring.h"
#include "../Landscape/cropprogs/NLSpringBarleySpring.h"
#include "../Landscape/cropprogs/NLCabbageSpring.h"
#include "../Landscape/cropprogs/NLCatchPeaCrop.h"
#include "../Landscape/cropprogs/DummyCropPestTesting.h"
#include "../Landscape/map_cfg.h"

Go to the source code of this file.

Macros

#define _CRT_SECURE_NO_DEPRECATE
 
#define _CRTDBG_MAP_ALLOC
 
#define _CRT_SECURE_NO_DEPRECATE
 

Functions

bool CompPcts (tpct i, tpct j)
 Used for sorting a farmers field size vector. More...
 

Variables

boost::variate_generator< base_generator_type &, boost::uniform_real<> > g_rand_uni
 
Landscapeg_landscape_p
 
CfgBool cfg_organic_extensive ("FARM_ORGANIC_EXTENSIVE", CFG_CUSTOM, false)
 
static CfgBool l_map_read_farmfile ("MAP_READ_FARMFILE", CFG_PRIVATE, true)
 
static CfgStr l_map_farmref_file ("MAP_FARMREF_FILE", CFG_CUSTOM, "farmrefs.txt")
 
static CfgStr l_emaize_price_file ("EMAIZE_PRICE_FILE", CFG_CUSTOM, "EM_price.txt")
 
CfgBool cfg_OptimisingFarms ("OPTIMISING_FARMS", CFG_CUSTOM, false)
 If set to true, the farmer decision making model is active. More...
 
CfgBool cfg_OptimiseBedriftsmodelCrops ("OPTIMISE_BEDRIFTSMODEL_CROPS", CFG_CUSTOM, false)
 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...
 
CfgBool cfg_DumpFarmAreas ("DUMP_FARM_AREAS", CFG_CUSTOM, false)
 If set to true, an output file with farm areas is produced. More...
 
CfgBool cfg_UseBedriftsmodelFarmAreas ("USE_BEDRIFTSMODEL_FARM_AREAS", CFG_CUSTOM, false)
 If set to true, the farm areas from the original farm optimisation model are used in the optimisation. If set to false, the farm areas based on a map from 2005 are used. More...
 
CfgBool cfg_OnlyDeliberation ("ONLY_DELIBERATION", CFG_CUSTOM, true)
 If set to yes, the only decision mode/startegy the farmers can use is deliberation (i.e. simplified optimisation). More...
 
CfgFloat cfg_Neighbor_dist ("NEIGHBOR_DIST", CFG_CUSTOM, 1.5)
 A parameter setting the maximum distance from a farm to another farm that can be considred a neighbour [km]. More...
 
CfgFloat cfg_Min_certainty ("MIN_CERTAINTY", CFG_CUSTOM, 0)
 A parameter setting the minimum certainty level. More...
 
CfgFloat cfg_Min_need_satisfaction1 ("MIN_NEED_SATISFACTION_ONE", CFG_CUSTOM, 100)
 A parameter setting the minimum satisfaction level for profit. More...
 
CfgFloat cfg_Min_need_satisfaction2 ("MIN_NEED_SATISFACTION_TWO", CFG_CUSTOM, 100)
 A parameter setting the minimum satisfaction level for yield. More...
 
CfgFloat cfg_Profit_max_proportion ("PROFIT_MAX_PROPORTION", CFG_CUSTOM, 100)
 A parameter setting the proportion of farmers of a type profit maximiser. More...
 
CfgFloat cfg_Yield_max_proportion ("YIELD_MAX_PROPORTION", CFG_CUSTOM, 0)
 A parameter setting the proportion of farmers of a type yield maximiser. More...
 
CfgFloat cfg_Environmentalist_proportion ("ENVIRONMENTALIST_PROPORTION", CFG_CUSTOM, 0)
 A parameter setting the proportion of farmers of a type environmentalist. More...
 
CfgFloat cfg_Yield_max_pest_prob_multiplier ("YIELD_MAX_PEST_PROB_MULITPLIER", CFG_CUSTOM, 1.5)
 A parameter of the yield maximizer farmer type: it increases the chance of necessity of carrying out a pesticide spraying event (i.e. the probability of a pest attack). Used to represent the yield maximiser's higher tendency to spray pesticide to protect crops even at the expense of a profit. More...
 
CfgFloat cfg_Env_pest_multiplier ("ENV_PEST_MULTIPLIER", CFG_CUSTOM, 1.25)
 A parameter of the environmentalist farmer type: increases the chance that environmentalist does not find using pesticides profitable. Used to represent environmentalist's reluctance to use pesticides. More...
 
CfgFloat cfg_Env_fert_multiplier ("ENV_FERT_MULTIPLIER", CFG_CUSTOM, 0.8)
 A parameter of the environmentalist farmer type: reduces environmentalist's use of fertiliser. Used to represent environmentalist's tendency to minimise the usage of fertlizers. More...
 
CfgBool cfg_Sensitivity_analysis ("SENSITIVITY_ANALYSIS", CFG_CUSTOM, false)
 
CfgBool cfg_Areas_Based_on_Distribution ("AREAS_BASED_ON_DISTRIBUTION", CFG_CUSTOM, false)
 If set to true, crops are assigned area based on their gross margin proportion in the total GM for all crops with non-negative GM. More...
 
CfgBool cfg_MaizeEnergy ("MAIZE_ENERGY", CFG_CUSTOM, false)
 If set to true, the energy maize crop is included in the simulation. More...
 
CfgFloat cfg_AnimalsThreshold ("ANIMALS_THRESHOLD", CFG_CUSTOM, 0)
 This parameter specifies the proportion of average number of animals on a farm for previous 3 years, below which a farmer decides not to grow energy maize anymore. More...
 
CfgFloat cfg_PriceChangeThreshold ("PRICE_CHANGE_THRESHOLD", CFG_CUSTOM, 0.2)
 This parameter specifies the relative difference in energy maize price which causes a farmer to deliberate. More...
 
CfgInt cfg_LifeStage ("LIFE_STAGE", CFG_CUSTOM, 0)
 This parameter specifies the life stage of a species whose numbers farmers use during their decision making. More...
 
CfgInt cfg_Animals_number_test_day ("ANIMALS_NUMBER_TEST_DAY", CFG_CUSTOM, 152)
 This parameter specifies the day at which farmers observe the number of animals residing at their farm. More...
 
CfgFloat cfg_Price_FU ("PRICE_FU", CFG_CUSTOM, 1.157)
 Price of a fodder unit. [DKK/FU]. More...
 
CfgFloat cfg_Price_Nt ("PRICE_NT", CFG_CUSTOM, 1.93)
 Price of fertilizer. [DKK/kg]. More...
 
CfgFloat cfg_Price_SBarley ("PRICE_SBARLEY", CFG_CUSTOM, 83)
 
CfgFloat cfg_Price_Oats ("PRICE_OATS", CFG_CUSTOM, 75)
 
CfgFloat cfg_Price_WBarley ("PRICE_WBARLEY", CFG_CUSTOM, 93)
 
CfgFloat cfg_Price_WWheat ("PRICE_WWHEAT", CFG_CUSTOM, 94)
 
CfgFloat cfg_Price_Triticale ("PRICE_TRITICALE", CFG_CUSTOM, 80)
 
CfgFloat cfg_Price_WRape ("PRICE_WRAPE", CFG_CUSTOM, 163)
 
CfgFloat cfg_Price_SRape ("PRICE_SRAPE", CFG_CUSTOM, 163)
 
CfgFloat cfg_Min_fodder_prod_pig ("MIN_FODDER_PROD_PIG", CFG_CUSTOM, 20)
 A parameter setting the minimum proportion of fodder demand that has to be supplied from own fodder production on pig farms. More...
 
CfgFloat cfg_Min_fodder_prod_cattle ("MIN_FODDER_PROD_CATTLE", CFG_CUSTOM, 35)
 A parameter setting the minimum proportion of fodder demand that has to be supplied from own fodder production on cattle farms. Not in use. More...
 
CfgFloat cfg_ClosestFarmProbParam1 ("CLOSESTFARMPROBPARAMONE", CFG_CUSTOM, 0.005)
 A fitting parameter for the probability of hunter acceptance of a farm wiht distance from home - slope. More...
 
CfgFloat cfg_FarmSizeProbParam1 ("FARMSIZEPROBPARAMONE", CFG_CUSTOM, 1.5)
 A fitting parameter for the probability of hunter acceptance of a farm that is smaller. More...
 
CfgFloat cfg_ClosestFarmProbParam2 ("CLOSESTFARMPROBPARAMTWO", CFG_CUSTOM, 1.0)
 A fitting parameter for the probability of hunter acceptance of a farm with distance from home - scaler. More...
 
FarmManagerg_farmmanager
 
CfgFloat cfg_RoostDistProbParam1 ("ROOSTDISTPROBPARAMONE", CFG_CUSTOM, 1.5)
 A fitting parameter for the probability of hunter acceptance of a farm with distance from roost. More...
 
CfgInt cfg_grain_distribution ("GOOSE_GRAIN_DISTRIBUTION", CFG_CUSTOM, 0, 0, 2)
 A switch to fix the grain distribution to a specific year or make a random pick between years. Used for the goose model. 0, = random, 1 = 2013, 2 = 2014. More...
 

Detailed Description

Farm.cpp This file contains the source for the Farm class and OptimisingFarm

by Frank Nikolaisen & Chris J. Topping
Version of June 2003
All rights reserved.

Doxygen formatted comments in July 2008

Definition in file farm.cpp.

Macro Definition Documentation

◆ _CRT_SECURE_NO_DEPRECATE [1/2]

#define _CRT_SECURE_NO_DEPRECATE

Definition at line 59 of file farm.cpp.

◆ _CRT_SECURE_NO_DEPRECATE [2/2]

#define _CRT_SECURE_NO_DEPRECATE

Definition at line 59 of file farm.cpp.

◆ _CRTDBG_MAP_ALLOC

#define _CRTDBG_MAP_ALLOC

Definition at line 55 of file farm.cpp.

Function Documentation

◆ CompPcts()

bool CompPcts ( tpct  i,
tpct  j 
)

Used for sorting a farmers field size vector.

Definition at line 294 of file farm.cpp.

294 { return (i.pct<j.pct); }

References tpct::pct.

Referenced by Farm::AssignPermanentCrop().

Variable Documentation

◆ cfg_Animals_number_test_day

CfgInt cfg_Animals_number_test_day("ANIMALS_NUMBER_TEST_DAY", CFG_CUSTOM, 152)

This parameter specifies the day at which farmers observe the number of animals residing at their farm.

Referenced by FarmManager::FarmManagement().

◆ cfg_AnimalsThreshold

CfgFloat cfg_AnimalsThreshold("ANIMALS_THRESHOLD", CFG_CUSTOM, 0)

This parameter specifies the proportion of average number of animals on a farm for previous 3 years, below which a farmer decides not to grow energy maize anymore.

Referenced by OptimisingFarm::ActualProfit(), and FarmManager::FarmManagement().

◆ cfg_Areas_Based_on_Distribution

CfgBool cfg_Areas_Based_on_Distribution("AREAS_BASED_ON_DISTRIBUTION", CFG_CUSTOM, false)

If set to true, crops are assigned area based on their gross margin proportion in the total GM for all crops with non-negative GM.

Referenced by OptimisingFarm::checkRestrictions(), OptimisingPigFarm::checkRestrictions(), OptimisingFarm::determineAreas(), OptimisingFarm::FarmLevelCalculation(), OptimisingFarm::Match_crop_to_field(), and FarmManager::ReadCropsData_perFarm_and_Soil_and_Size_almass().

◆ cfg_ClosestFarmProbParam1

CfgFloat cfg_ClosestFarmProbParam1("CLOSESTFARMPROBPARAMONE", CFG_CUSTOM, 0.005)

A fitting parameter for the probability of hunter acceptance of a farm wiht distance from home - slope.

Referenced by FarmManager::FindClosestFarmOpennessProb(), FarmManager::FindClosestFarmOpennessProbNearRoostIsBest(), and FarmManager::FindClosestFarmOpennessProbSmallIsBest().

◆ cfg_ClosestFarmProbParam2

CfgFloat cfg_ClosestFarmProbParam2("CLOSESTFARMPROBPARAMTWO", CFG_CUSTOM, 1.0)

A fitting parameter for the probability of hunter acceptance of a farm with distance from home - scaler.

Referenced by FarmManager::FindClosestFarmOpennessProb(), FarmManager::FindClosestFarmOpennessProbNearRoostIsBest(), and FarmManager::FindClosestFarmOpennessProbSmallIsBest().

◆ cfg_DumpFarmAreas

CfgBool cfg_DumpFarmAreas("DUMP_FARM_AREAS", CFG_CUSTOM, false)

If set to true, an output file with farm areas is produced.

Referenced by Landscape::Landscape().

◆ cfg_Env_fert_multiplier

CfgFloat cfg_Env_fert_multiplier("ENV_FERT_MULTIPLIER", CFG_CUSTOM, 0.8)

A parameter of the environmentalist farmer type: reduces environmentalist's use of fertiliser. Used to represent environmentalist's tendency to minimise the usage of fertlizers.

Referenced by OptimisingFarm::findFertilizer().

◆ cfg_Env_pest_multiplier

CfgFloat cfg_Env_pest_multiplier("ENV_PEST_MULTIPLIER", CFG_CUSTOM, 1.25)

A parameter of the environmentalist farmer type: increases the chance that environmentalist does not find using pesticides profitable. Used to represent environmentalist's reluctance to use pesticides.

Referenced by OptimisingFarm::findBIs().

◆ cfg_Environmentalist_proportion

CfgFloat cfg_Environmentalist_proportion("ENVIRONMENTALIST_PROPORTION", CFG_CUSTOM, 0)

A parameter setting the proportion of farmers of a type environmentalist.

Referenced by FarmManager::DistributeFarmerTypes().

◆ cfg_FarmSizeProbParam1

CfgFloat cfg_FarmSizeProbParam1("FARMSIZEPROBPARAMONE", CFG_CUSTOM, 1.5)

A fitting parameter for the probability of hunter acceptance of a farm that is smaller.

Referenced by FarmManager::FindClosestFarmOpennessProbSmallIsBest().

◆ cfg_grain_distribution

CfgInt cfg_grain_distribution("GOOSE_GRAIN_DISTRIBUTION", CFG_CUSTOM, 0, 0, 2)

A switch to fix the grain distribution to a specific year or make a random pick between years. Used for the goose model. 0, = random, 1 = 2013, 2 = 2014.

Referenced by FarmManager::GetSpilledGrain().

◆ cfg_LifeStage

CfgInt cfg_LifeStage("LIFE_STAGE", CFG_CUSTOM, 0)

This parameter specifies the life stage of a species whose numbers farmers use during their decision making.

Referenced by FarmManager::FarmManagement().

◆ cfg_MaizeEnergy

CfgBool cfg_MaizeEnergy("MAIZE_ENERGY", CFG_CUSTOM, false)

If set to true, the energy maize crop is included in the simulation.

Referenced by OptimisingFarm::ActualProfit(), FarmManager::FarmManager(), and Landscape::Tick().

◆ cfg_Min_certainty

CfgFloat cfg_Min_certainty("MIN_CERTAINTY", CFG_CUSTOM, 0)

A parameter setting the minimum certainty level.

Referenced by OptimisingFarm::ChooseDecisionMode().

◆ cfg_Min_fodder_prod_cattle

CfgFloat cfg_Min_fodder_prod_cattle("MIN_FODDER_PROD_CATTLE", CFG_CUSTOM, 35)

A parameter setting the minimum proportion of fodder demand that has to be supplied from own fodder production on cattle farms. Not in use.

Referenced by AnimalFarm::correctFodderDemand().

◆ cfg_Min_fodder_prod_pig

CfgFloat cfg_Min_fodder_prod_pig("MIN_FODDER_PROD_PIG", CFG_CUSTOM, 20)

A parameter setting the minimum proportion of fodder demand that has to be supplied from own fodder production on pig farms.

Referenced by AnimalFarm::correctFodderDemand().

◆ cfg_Min_need_satisfaction1

CfgFloat cfg_Min_need_satisfaction1("MIN_NEED_SATISFACTION_ONE", CFG_CUSTOM, 100)

A parameter setting the minimum satisfaction level for profit.

Referenced by OptimisingFarm::ActualProfit().

◆ cfg_Min_need_satisfaction2

CfgFloat cfg_Min_need_satisfaction2("MIN_NEED_SATISFACTION_TWO", CFG_CUSTOM, 100)

A parameter setting the minimum satisfaction level for yield.

Referenced by OptimisingFarm::ActualProfit().

◆ cfg_Neighbor_dist

CfgFloat cfg_Neighbor_dist("NEIGHBOR_DIST", CFG_CUSTOM, 1.5)

A parameter setting the maximum distance from a farm to another farm that can be considred a neighbour [km].

Referenced by FarmManager::FindNeighbours().

◆ cfg_OnlyDeliberation

CfgBool cfg_OnlyDeliberation("ONLY_DELIBERATION", CFG_CUSTOM, true)

If set to yes, the only decision mode/startegy the farmers can use is deliberation (i.e. simplified optimisation).

Referenced by OptimisingFarm::ActualProfit(), and OptimisingFarm::ChooseDecisionMode().

◆ cfg_OptimiseBedriftsmodelCrops

CfgBool cfg_OptimiseBedriftsmodelCrops("OPTIMISE_BEDRIFTSMODEL_CROPS", CFG_CUSTOM, false)

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.

Referenced by OptimisingFarm::checkRestrictions(), OptimisingPigFarm::checkRestrictions(), OptimisingCattleFarm::checkRestrictions(), AnimalFarm::checkWinterCrops(), NonAnimalFarm::checkWinterCrops(), AnimalFarm::checkWinterRotation1(), NonAnimalFarm::checkWinterRotation1(), Crop::ChooseNextCrop(), AnimalFarm::correctFodderDemand(), AnimalFarm::createFodderCrops(), OptimisingFarm::createVariableCrops(), FarmManager::CropDistribution(), DataForOptimisation::DataForOptimisation(), AnimalFarm::decreaseCrops(), OptimisingFarm::determineAreas(), AnimalFarm::determineFodderAreas(), AnimalFarm::determineMinFodder(), FarmManager::FarmManager(), OptimisingFarm::findBIs(), OptimisingFarm::findFertilizer(), OptimisingFarm::findGrossMargin(), OptimisingFarm::findMWeedControl(), OptimisingFarm::findResponse(), OptimisingFarm::findYieldLoss(), OptimisingFarm::fixBI(), OptimisingFarm::FungicideTreat(), OptimisingFarm::HandleEvents(), OptimisingFarm::Harvest(), OptimisingFarm::HerbicideTreat(), AnimalFarm::increaseCrops(), OptimisingFarm::Init(), OptimisingFarm::Initialize(), OptimisingFarm::InsecticideTreat(), Landscape::Landscape(), OptimisingFarm::Make_rotations(), FarmManager::OptimisationOutput(), OptimisingFarm::optimizeCrops(), FarmManager::PrintOutput(), OptimisingCattleFarm::setCattleCropsAtMin(), OptimisingFarm::Spraying_fungins(), OptimisingFarm::Spraying_herbicides(), and Landscape::Tick().

◆ cfg_OptimisingFarms

CfgBool cfg_OptimisingFarms("OPTIMISING_FARMS", CFG_CUSTOM, false)

◆ cfg_organic_extensive

CfgBool cfg_organic_extensive("FARM_ORGANIC_EXTENSIVE", CFG_CUSTOM, false)

◆ cfg_Price_FU

CfgFloat cfg_Price_FU("PRICE_FU", CFG_CUSTOM, 1.157)

Price of a fodder unit. [DKK/FU].

Referenced by OptimisingFarm::OptimiseFarm(), and OptimisingFarm::optimizeCrops().

◆ cfg_Price_Nt

CfgFloat cfg_Price_Nt("PRICE_NT", CFG_CUSTOM, 1.93)

◆ cfg_Price_Oats

CfgFloat cfg_Price_Oats("PRICE_OATS", CFG_CUSTOM, 75)

◆ cfg_Price_SBarley

CfgFloat cfg_Price_SBarley("PRICE_SBARLEY", CFG_CUSTOM, 83)

◆ cfg_Price_SRape

CfgFloat cfg_Price_SRape("PRICE_SRAPE", CFG_CUSTOM, 163)

◆ cfg_Price_Triticale

CfgFloat cfg_Price_Triticale("PRICE_TRITICALE", CFG_CUSTOM, 80)

◆ cfg_Price_WBarley

CfgFloat cfg_Price_WBarley("PRICE_WBARLEY", CFG_CUSTOM, 93)

◆ cfg_Price_WRape

CfgFloat cfg_Price_WRape("PRICE_WRAPE", CFG_CUSTOM, 163)

◆ cfg_Price_WWheat

CfgFloat cfg_Price_WWheat("PRICE_WWHEAT", CFG_CUSTOM, 94)

◆ cfg_PriceChangeThreshold

CfgFloat cfg_PriceChangeThreshold("PRICE_CHANGE_THRESHOLD", CFG_CUSTOM, 0.2)

This parameter specifies the relative difference in energy maize price which causes a farmer to deliberate.

Referenced by OptimisingFarm::ActualProfit().

◆ cfg_Profit_max_proportion

CfgFloat cfg_Profit_max_proportion("PROFIT_MAX_PROPORTION", CFG_CUSTOM, 100)

A parameter setting the proportion of farmers of a type profit maximiser.

Referenced by FarmManager::DistributeFarmerTypes().

◆ cfg_RoostDistProbParam1

CfgFloat cfg_RoostDistProbParam1("ROOSTDISTPROBPARAMONE", CFG_CUSTOM, 1.5)

A fitting parameter for the probability of hunter acceptance of a farm with distance from roost.

Referenced by FarmManager::FindClosestFarmOpennessProbNearRoostIsBest().

◆ cfg_Sensitivity_analysis

CfgBool cfg_Sensitivity_analysis("SENSITIVITY_ANALYSIS", CFG_CUSTOM, false)

◆ cfg_UseBedriftsmodelFarmAreas

CfgBool cfg_UseBedriftsmodelFarmAreas("USE_BEDRIFTSMODEL_FARM_AREAS", CFG_CUSTOM, false)

If set to true, the farm areas from the original farm optimisation model are used in the optimisation. If set to false, the farm areas based on a map from 2005 are used.

Referenced by OptimisingFarm::assignFixed(), OptimisingFarm::findFodderDemand(), OptimisingFarm::findTotalArea(), and OptimisingFarm::findTotalNanim().

◆ cfg_Yield_max_pest_prob_multiplier

CfgFloat cfg_Yield_max_pest_prob_multiplier("YIELD_MAX_PEST_PROB_MULITPLIER", CFG_CUSTOM, 1.5)

A parameter of the yield maximizer farmer type: it increases the chance of necessity of carrying out a pesticide spraying event (i.e. the probability of a pest attack). Used to represent the yield maximiser's higher tendency to spray pesticide to protect crops even at the expense of a profit.

Referenced by OptimisingFarm::Prob_multiplier().

◆ cfg_Yield_max_proportion

CfgFloat cfg_Yield_max_proportion("YIELD_MAX_PROPORTION", CFG_CUSTOM, 0)

A parameter setting the proportion of farmers of a type yield maximiser.

Referenced by FarmManager::DistributeFarmerTypes().

◆ g_farmmanager

FarmManager* g_farmmanager

◆ g_landscape_p

Landscape* g_landscape_p

Definition at line 258 of file Landscape.cpp.

Referenced by FarmManager::FarmManagement().

◆ g_rand_uni

◆ l_emaize_price_file

CfgStr l_emaize_price_file("EMAIZE_PRICE_FILE", CFG_CUSTOM, "EM_price.txt")
static

◆ l_map_farmref_file

CfgStr l_map_farmref_file("MAP_FARMREF_FILE", CFG_CUSTOM, "farmrefs.txt")
static

◆ l_map_read_farmfile

CfgBool l_map_read_farmfile("MAP_READ_FARMFILE", CFG_PRIVATE, true)
static
tpct::pct
int pct
Definition: farm.h:456