Goose Management Model ODdox
1.02
|
A farm that carries out crop, pesticide and fertilizer planning using simplified optimisation or other decision startegies. More...
#include <farm.h>
Classes | |
struct | CropSort |
Struct used for sorting crops. More... | |
struct | MakeRotation |
Struct used only in Bedriftsmodel crop type mode for creating m_rotation vector. Bool member used for marking the element of a vector as already assigned a TTypesOfVegetation crop type. More... | |
struct | reverseSort |
Struct redefining operator < - used for sorting crops. More... | |
Public Member Functions | |
void | ActualProfit () |
Function that determines actual crop yields and profit in a given year. More... | |
void | ChooseDecisionMode () |
Function determines which decision mode to use. The choice depends on the values of need satisfaction and uncertainty. More... | |
OptimisingFarm * | Find_neighbour_to_imitate () |
Picks randomly a farmer to imitate/compare with. It chooses among neighbouring farmers with similar farms. More... | |
double | Get_actual_aggregated_yield () |
double | Get_actual_profit () |
int | Get_almass_no (void) |
CropOptimised * | Get_crop (int i) |
int | Get_cropsSize (void) |
int | Get_decision_mode_counters (int index) |
int | Get_farmRealID (void) |
TTypesOfFarmSize | Get_farmSize (void) |
TTypesOfOptFarms | Get_farmType (void) |
TTypeOfFarmerGoal | Get_main_goal () |
OptimisingFarm * | Get_Neighbour (int i) |
int | Get_NeighboursSize (void) |
vector< AlmassCrop > | Get_rotational_crops () |
vector< AlmassCrop > | Get_rotational_crops_visible () |
int | Get_soilSubType (void) |
TTypesOfSoils | Get_soilType (void) |
int | GetFarmCentroidX () |
int | GetFarmCentroidY () |
bool | Harvest (LE *a_field, double a_user, int a_days) |
OptimisingFarm's virtual version of Farm::Harvest(). Saves information on biomass of a crop at harvest. More... | |
void | Init (ofstream *ap_output_file) |
Function carrying out the initial calculations at a farm level (including the initial optimisation). More... | |
void | Match_crop_to_field (LE *a_field) |
Finds a crop to be grown on a given field next year. More... | |
OptimisingFarm (FarmManager *a_myfarmmanager, int a_No) | |
The constructor. More... | |
virtual double | Prob_multiplier () |
Used when determining whether there should be a spraying event (i.e. pesticides application) or not. For yield maximizer it increases the chance of spraying event to account for his 'just in case' spraying. More... | |
void | Save_last_years_crops () |
It saves the OptimisingFarm::m_rotational_crops in a vector m_rotational_crops_visible which is accessible for other farmers if they decide to copy it in the following year. More... | |
void | Set_animals_no (int a_number) |
void | Set_Crop (CropOptimised *p_crop) |
void | Set_Livestock (Livestock *p_lvs) |
void | Set_main_goal (TTypeOfFarmerGoal a_goal) |
void | Set_Neighbour (OptimisingFarm *farm) |
virtual bool | Spraying_fungins (TTypesOfVegetation a_tov_type) |
Returns true if a farmer decided to treat a given crop with fung- and insecticides. More... | |
virtual bool | Spraying_herbicides (TTypesOfVegetation a_tov_type) |
Returns true if a farmer decided to treat a given crop with herbicides. More... | |
virtual | ~OptimisingFarm () |
Public Member Functions inherited from Farm | |
void | AddField (LE *a_newfield) |
Adds a field to a farm. More... | |
void | AddHunter (Hunter *a_hunter) |
void | AddNewEvent (TTypesOfVegetation a_event, long a_date, LE *a_field, int a_todo, long a_num, bool a_lock, int a_start, bool a_first_year, TTypesOfVegetation a_crop) |
Adds an event to the event queue for a farm. More... | |
void | Assign_rotation (vector< TTypesOfVegetation >a_new_rotation) |
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 | AutumnPlough (LE *a_field, double a_user, int a_days) |
Carry out a ploughing 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 | AutumnSow (LE *a_field, double a_user, int a_days) |
Carry out a sowing event in the autumn on a_field. More... | |
virtual bool | BedForming (LE *a_field, double a_user, int a_days) |
Do bed forming up on a_field, probably of carrots. More... | |
virtual bool | Biocide (LE *a_field, double a_user, int a_days) |
Biocide 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 | BurnStrawStubble (LE *a_field, double a_user, int a_days) |
Burn stubble on a_field. More... | |
virtual bool | CattleIsOut (LE *a_field, double a_user, int a_days, int a_max) |
Generate a 'cattle_out' event for every day the cattle are on a_field. More... | |
virtual bool | CattleIsOutLow (LE *a_field, double a_user, int a_days, int a_max) |
Generate a 'cattle_out_low' event for every day the cattle are on a_field. More... | |
virtual bool | CattleOut (LE *a_field, double a_user, int a_days) |
Start a grazing event on a_field today. More... | |
virtual bool | CattleOutLowGrazing (LE *a_field, double a_user, int a_days) |
Start a extensive grazing event on a_field today. More... | |
void | Centroids () |
Finds farm's centroids - x and y. 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 | CutToHay (LE *a_field, double a_user, int a_days) |
Carry out hay cutting 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 | CutWeeds (LE *a_field, double a_user, int a_days) |
Carry out weed topping 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... | |
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... | |
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_Calcium (LE *a_field, double a_user, int a_days) |
Calcium applied on a_field owned by a 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_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_Manure (LE *a_field, double a_user, int a_days) |
Spread manure on a_field owned by an 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_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_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_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_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_Slurry (LE *a_field, double a_user, int a_days) |
Spready slurry on a_field owned by an stock farmer. More... | |
Farm (FarmManager *a_manager) | |
Farm constructor - creates an instance of each possible crop type. More... | |
virtual bool | FlowerCutting (LE *a_field, double a_user, int a_days) |
Flower cutting applied on a_field. 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_Calcium (LE *a_field, double a_user, int a_days) |
Calcium applied 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_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_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_Manure (LE *a_field, double a_user, int a_days) |
Spread manure 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_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_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_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_Sludge (LE *a_field, double a_user, int a_days) |
Spread sewege on 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... | |
int | GetArea (void) |
Returns the area of arable fields owned by that farm. More... | |
double | GetAreaDouble (void) |
Returns the area of arable fields owned by that farm. More... | |
int | GetAreaOpenFields (int a_openness) |
Returns the area of the fields above an openness of a_openness. More... | |
APoint | GetCentroids () |
TTypesOfVegetation | GetCrop (int a_index) |
int | GetFarmNumber (void) |
int | GetIntensity (void) |
int | GetMaxOpenness () |
Returns the maximum openness score of the fields. More... | |
TTypesOfVegetation | GetNextCrop (int a_index) |
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... | |
TTypesOfVegetation | GetPreviousCrop (int a_index) |
int | GetTotalArea (void) |
Returns the area of all fields owned by that farm. More... | |
TTypesOfFarm | GetType (void) |
APoint | GetValidCoords () |
Returns the valid coordinates of the first field owned by a farm. More... | |
virtual bool | GrowthRegulator (LE *a_field, double a_user, int a_days) |
Apply growth regulator to a_field. More... | |
virtual bool | HarvestLong (LE *a_field, double a_user, int a_days) |
Carry out a harvest on a_field. More... | |
virtual bool | HayBailing (LE *a_field, double a_user, int a_days) |
Carry out hay bailing 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 | 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 | HillingUp (LE *a_field, double a_user, int a_days) |
Do hilling up on a_field, probably of potatoes. More... | |
bool | IsStockFarmer (void) |
polylist * | ListOpenFields (int a_openness) |
Returns a list of fields with openness above a_openness. More... | |
virtual void | MakeStockFarmer (void) |
virtual void | Management (void) |
Starts the main management loop for the farm and performs some error checking. More... | |
virtual bool | Molluscicide (LE *a_field, double a_user, int a_days) |
Apply molluscidie to 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 | 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 | PreseedingCultivator (LE *a_field, double a_user, int a_days) |
Carry out preseeding cultivation on a_field (tilling set including cultivator and string roller to compact soil) More... | |
virtual bool | PreseedingCultivatorSow (LE *a_field, double a_user, int a_days) |
Carry out preseeding cultivation together with sow on a_field (tilling and sowing set including cultivator and string roller to compact soil) More... | |
virtual bool | ProductApplication (LE *a_field, double a_user, int a_days, double a_applicationrate, PlantProtectionProducts a_ppp) |
Apply test pesticide to a_field. More... | |
virtual bool | ProductApplication_DateLimited (LE *a_field, double, int, double a_applicationrate, PlantProtectionProducts a_ppp) |
Special pesticide trial functionality. More... | |
void | RemoveField (LE *a_field) |
Removes a field from a farm. More... | |
void | RemoveHunter (Hunter *a_hunter) |
virtual bool | RowCultivation (LE *a_field, double a_user, int a_days) |
Carry out a harrowing between crop rows on a_field. More... | |
void | SetFarmNumber (int a_farm_num) |
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 | SleepAllDay (LE *a_field, double a_user, int a_days) |
Nothing to to today 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 | SpringPlough (LE *a_field, double a_user, int a_days) |
Carry out a ploughing event in the spring on a_field. More... | |
virtual bool | SpringRoll (LE *a_field, double a_user, int a_days) |
Carry out a roll event in the spring on a_field. More... | |
virtual bool | SpringSow (LE *a_field, double a_user, int a_days) |
Carry out a sowing event in the spring on a_field. More... | |
virtual bool | SpringSowWithFerti (LE *a_field, double a_user, int a_days) |
Carry out a sowing event with start fertilizer in the spring on a_field. More... | |
virtual bool | StrawChopping (LE *a_field, double a_user, int a_days) |
Carry out straw chopping 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 | Strigling (LE *a_field, double a_user, int a_days) |
Carry out a mechanical weeding 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 | StriglingSow (LE *a_field, double a_user, int a_days) |
Carry out a mechanical weeding followed by sowing on a_field. 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 | StubbleHarrowing (LE *a_field, double a_user, int a_days) |
Carry out stubble harrowing on a_field. More... | |
virtual bool | StubblePlough (LE *a_field, double a_user, int a_days) |
Carry out a stubble ploughing event on a_field. This is similar to normal plough but shallow (normally 6-8cm, is special cases up to 12-15cm). Done as a part of after-harvest treatments (instead of stubble cultivation) More... | |
virtual bool | 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 | Water (LE *a_field, double a_user, int a_days) |
Carry out a watering 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 | ~Farm (void) |
Farm destructor - deletes all crop instances and empties event queues. More... | |
Protected Member Functions | |
void | assignFixed () |
Adds areas of fixed crops to the variable m_assigned. For each fixed crop it saves its area under variable CropOptimised::m_areaPercent. More... | |
void | Check_if_area_100 () |
Checks if the sum of crops' areaPercent is 100%. More... | |
void | Check_SG_and_CGG () |
Modifies areas of SeedGrass1 and SeedGrass2, CloverGrassGrazed1 and CloverGrassGrazed2 to be even. Used only in ALMaSS crops mode (in Bedriftsmodel (original farm optimization model) crops mode this is taken care of in Translate_crops_to_almass()). More... | |
virtual void | checkRestrictions () |
Checks if the restrictions are fulfilled and corrects crops' areas if necessary. More... | |
virtual void | checkWinterCrops () |
Checks if the restriction on a max. share of winter crops is fulfilled. More... | |
virtual void | checkWinterRotation1 () |
Checks if the restriction on a winter rotation is fulfilled. More... | |
virtual void | createCropsLists (int a_foobar) |
Creates lists of crops. More... | |
void | createVariableCrops (int a_foobar) |
Creates a list of pointers to all variable crops included in the optimisation and a list of pointers to fixed crops. More... | |
double | crop_parameter (int index, string par_name) |
Reads in crop parameters that do NOT vary with any farm level parameters. More... | |
virtual void | decreaseCrops (vector< CropSort >cropsToDecrease, double &howMuchToDecrease) |
Decreases area of a crops by a specified number. More... | |
virtual void | determineAreas (int a_foobar) |
Determines areas of variable crops. More... | |
void | determineAreas_ha (vector< CropOptimised * >crops) |
Determines areas of crops in ha. More... | |
void | FarmLevelCalculation () |
Calls functions determining farm level values before the initial optimisation. More... | |
void | findBIs (CropOptimised *a_crop, double benefit) |
Determines the optimal Treatment frequency indices (behandling index, BI in Danish) (CropOptimised::m_BIHerb, CropOptimised::m_BIFi, CropOptimised::m_BI) for a given crop at a farm. More... | |
CropOptimised * | findCropByName (string crop_name) |
Returns a pointer to a crop whose name is specified as the argument (bedriftsmodel, i.e. original farm optimization model, crops mode). More... | |
CropOptimised * | findCropByName_almass (string crop_name) |
Returns a pointer to almass crop whose name is specified as the argument (ALMaSS crops mode). More... | |
CropOptimised * | findCropByName_almass (TTypesOfVegetation a_tov_type) |
Returns a pointer to almass crop whose tov type is specified as the argument. More... | |
void | findFertilizer (CropOptimised *a_crop, int a_foobar, double benefit) |
Determines the optimal amounts of: total fertilizer (CropOptimised::m_n) and purchased fertilizer (CropOptimised::m_nt) for a given crop at a farm. More... | |
virtual void | findFodderDemand () |
Determines farm's total demand for fodder (m_totalFUdemand). More... | |
void | findGrossMargin (CropOptimised *a_crop, int a_foobar, double benefit) |
Determines the gross margin (CropOptimised::m_GM) for a given crop at a farm. More... | |
void | findMWeedControl (CropOptimised *a_crop) |
Determines the optimal mechanical weed control means (CropOptimised::m_grooming, CropOptimised::m_hoeing, CropOptimised::m_weeding) for a given crop at a farm. More... | |
void | findNanim () |
Determines amount of animal fertilizer per ha (m_Nanim) at a farm. More... | |
void | findResponse (CropOptimised *a_crop, int a_foobar) |
Determines the response (CropOptimised::m_resp) of a crop at a farm. More... | |
void | findTotalArea () |
Determines m_totalArea of a farm. More... | |
void | findTotalNanim () |
Determines total animal fertilizer (m_totalNanim) available at a farm. More... | |
void | findYieldLoss (CropOptimised *a_crop) |
Determines the yield losses (CropOptimised::m_lossHerb, CropOptimised::m_lossFi, CropOptimised::m_totalLoss) for a given crop at a farm. More... | |
void | fixBI () |
Sets values of Treatment frequency indices (BI) for crops with fixed amount of pesticides (CropOptimised::m_BIHerb for FodderBeet and both CropOptimised::m_BIHerb and CropOptimised::m_BIFi for PotatoesIndustry and Potatoes). More... | |
virtual bool | FungicideTreat (LE *a_field, double, int a_days) |
Carries out fungicide application. Saves information on each application for a given crop. More... | |
virtual void | HandleEvents (void) |
If there are events to carry out do this, and perhaps start a new crop. More... | |
virtual bool | HerbicideTreat (LE *a_field, double, int a_days) |
Carries out herbicide application. Saves information on each application for a given crop. More... | |
virtual void | increaseCrops (vector< CropSort >cropsToIncrease, double &howMuchToIncrease) |
Increases area of crops by a specified number. More... | |
void | Initialize (FarmManager *a_pfm) |
Assigns to each farm its farm type, farm size, farm's real ID number, and soil type. It creates livestock and crops. More... | |
virtual void | InitiateManagement (void) |
Kicks off the farm's management. More... | |
virtual bool | InsecticideTreat (LE *a_field, double, int a_days) |
Carries out insecticide application. Saves information on each application for a given crop. More... | |
void | Make_almass_crops_vector () |
Creates a vector storing crops with positive area. Used in ALMaSS crop mode. More... | |
void | Make_rotational_crops () |
Creates a vector m_rotational_crops using the results of optimisation. More... | |
void | Make_rotations () |
Creates m_rotation. Not used in ALMaSS crop mode. More... | |
void | OptimiseFarm (int a_foobar) |
Carries out the whole farm optimisation. More... | |
void | optimizeCrops (int a_foobar) |
Carries out crop optimisation at a farm. More... | |
virtual void | preventCashCrops () |
Prevents small cattle farms from growing cash crops and maize silage. More... | |
void | Print_FarmVariables (ofstream *ap_output_file) |
Prints farm-level variables to a text file (one file for all farms). More... | |
void | Print_rotations (ofstream *ap_output_file) |
Prints the content of a farm's m_rotation. Not used in ALMaSS crop mode. More... | |
void | randomizeCropList (vector< CropSort > &listToRandomize, string key) |
Swaps randomly elements of the list holding same values of the key (according to which the list was previosuly sorted). More... | |
void | setRotationCropsAtMax () |
Increases area of winter rotation crops to their max. allowed area. More... | |
void | sortCrops (vector< CropSort > &cropsToSort, string sortingKey) |
Sorts structs of type CropSort. More... | |
void | sumMinAreas () |
Adds minimum required areas of variable crops to the variable m_assigned. More... | |
double | total (TTypesOfCropVariables variable_name) |
Function for determining total values per farm after initial optimisation. More... | |
void | Translate_crops_to_almass () |
Translates crops from Bedriftsmodel (original farm optimization model) to Almass crops. Used in Bedriftsmodel crop mode. More... | |
Protected Member Functions inherited from Farm | |
void | AssignPermanentCrop (TTypesOfVegetation tov, int pct) |
Used to assign a permanent crop to an otherwise rotational field polygon. More... | |
void | CheckRotationManagementLoop (FarmEvent *ev) |
virtual int | GetFirstCropIndex (TTypesOfLandscapeElement a_type) |
Gets the first crop for the farm. More... | |
int | GetFirstDate (TTypesOfVegetation a_tov) |
Gets the start date for a crop type. More... | |
virtual int | GetNextCropIndex (int a_rot_index) |
Returns the next crop in the rotation. More... | |
int | GetNextCropStartDate (LE *a_field, TTypesOfVegetation &a_curr_veg) |
Returns the start date of the next crop in the rotation. More... | |
int | InvIntPartition (vector< tpct > *items, int target) |
Finds all possible sums of the integers in the items array. More... | |
bool | LeSwitch (FarmEvent *ev) |
Call do function for any crop with an outstanding event. Signal if the crop has terminated. More... | |
void | ReadRotation (std::string fname) |
Reads a rotation file into the rotation. More... | |
Protected Attributes | |
int | animals_no |
Holds the number of animals in a farm at a particular day in a year (depends on a species). More... | |
bool | force_deliberation |
If set to true, a farm must use deliberation as a decision strategy. More... | |
double | m_actual_aggregated_yield |
Actual aggregated yield at a farm in a given year. More... | |
double | m_actual_costs |
Actual costs at a farm in a given year. More... | |
double | m_actual_income |
An actual income at a farm in a given year. More... | |
double | m_actual_profit |
An actual profit realised at a farm in a given year. More... | |
int | m_almass_no |
Farm's almass number. More... | |
vector< double > | m_animals_numbers |
Vector for storing numbers of animals at a farm in previous years (3). More... | |
double | m_area_rot |
Area assigned to rotational crops. [ha]. More... | |
double | m_area_scaling_factor |
Factor used to scale areas of fixed crops and livestock numbers. Used to adjust these values to the farm's area used in ALMaSS crops mode. More... | |
double | m_assigned |
Variable holding a value of area already reserved for certain crops at a farm. [0-100%]. More... | |
double | m_certainty_level |
Farmer's certainty level. More... | |
vector< CropOptimised * > | m_crops |
Vector of pointers to all crops. More... | |
vector< AlmassCrop > | m_crops_almass |
Vector of structs with almass type crops with positive areas in % (result of optimisation). More... | |
vector< int > | m_decision_mode_counters |
Vector with counters for each decision mode. 0 - imitation, 1 - social comparison, 2 - repeat, 3 - deliberation. More... | |
double | m_exp_aggregated_yield |
Expected aggregated yield at a farm in a given year. More... | |
double | m_exp_costs |
Expected costs at a farm in a given year. More... | |
double | m_exp_income |
An expected farm's income at a farm in a given year. More... | |
double | m_exp_profit |
An expected farm's profit for a given year. More... | |
int | m_farmRealID |
Farm's real ID number. More... | |
TTypesOfFarmSize | m_farmSize |
Scale of the farm - business (size above 10 ha) or private (size below 10 ha). More... | |
TTypesOfOptFarms | m_farmType |
Farm's type (cattle, pig, plant, other). More... | |
vector< CropOptimised * > | m_fixedCrops |
Vector of pointers to fixed crops. More... | |
vector< CropOptimised * > | m_grownVariableCrops |
Vector of pointers to variable crops that are grown on area larger than areaMin (after determineAreas function was called). More... | |
vector< Livestock * > | m_livestock |
Vector of pointers to animals belonging to a farm. More... | |
TTypeOfFarmerGoal | m_main_goal |
Farmer's main goal (determined by a farmer's type) . More... | |
double | m_Nanim |
Amount of animal fertilizer available at a farm per hectar. [kg/ha]. More... | |
double | m_need_satisfaction_level |
Farmer's actual satisfaction level. More... | |
vector< OptimisingFarm * > | m_neighbours |
Vector of pointers to the farms considered neighbours (fulfilling the neighbourship condition) of a given farm. More... | |
vector< double > | m_previous_aggregated_yields |
Vector of aggregated yields from previous years. More... | |
vector< double > | m_previous_costs |
Vector of costs from previous years. More... | |
vector< double > | m_previous_incomes |
Vector of incomes from previous years. More... | |
vector< double > | m_previous_profits |
Vector of profits from previous years. More... | |
vector< double > | m_previous_satisfaction_levels |
Vector of satisfaction levels in five previous years. More... | |
OptimisingFarm * | m_previously_imitated_neighbour |
The neighbouring farmer whose crops might be copied in imitation and social comparison decision modes. More... | |
vector< AlmassCrop > | m_rotational_crops |
Vector of structs with almass type crops with positive areas in % (result of optimisation): includes only rotational crops. More... | |
vector< AlmassCrop > | m_rotational_crops_copy |
A copy of m_rotational_crops used when matching crops to fields. More... | |
vector< AlmassCrop > | m_rotational_crops_visible |
Stores a copy of m_rotational_crops from a previous year and is accessible to farmers who want to copy this farm's crops (in imitation or social comparison decision mode). More... | |
vector< CropSort > | m_rotationCrops |
Vector of structs containing pointers to (winter) rotation crops. More... | |
int | m_soilSubType |
Farm's soil subtype. Defined only for cattle farms on sandy soil (0-bad, 1-good, 2-undefined). More... | |
TTypesOfSoils | m_soilType |
Farm's soil type (sandy, clay, other). More... | |
double | m_totalArea |
Total area of a farm. A sum of initial crop areas (if in bedriftsmodel, i.e. original farm optimization model, crops mode) or a sum of farm's fields area (if in ALMaSS crops mode). [ha]. More... | |
double | m_totalArea_original |
Total area of a farm as in bedriftsmodel, i.e. original farm optimization model. [ha]. More... | |
double | m_totalBI |
Total amount of pesticides (sum of m_totalBIHerb and m_totalBIFi) which is planned to be applied at a farm. Expressed as a Treatment frequency index (behandling indeks, BI in Danish). More... | |
double | m_totalBIFi |
Total amount of fung- and insecticides which is planned to be applied at a farm. Expressed as a Treatment frequency index (behandling indeks, BI in Danish). More... | |
double | m_totalBIHerb |
Total amount of herbicides which is planned to be applied at a farm. Expressed as a Treatment frequency index (behandling indeks, BI in Danish). More... | |
double | m_totalCosts |
Planned total costs of growing crops at a farm. [DKK]. More... | |
double | m_totalFUdemand |
Farm's total demand for fodder (it is covered by growing fodder crops and/or purchasing fodder and thus, at the end of a year it should not be positive). [fodder units] More... | |
double | m_totalFUdemandBefore |
Farm's total demand for fodder. [fodder units] More... | |
double | m_totalFUgrown |
Fodder grown, i.e. obtained from growing fodder crops. [fodder units]. More... | |
double | m_totalFUt |
Fodder from trade (has to be purchased). [fodder units]. More... | |
double | m_totalGrooming |
Total grooming planned at a farm. More... | |
double | m_totalHoeing |
Total hoeing planned at a farm. More... | |
double | m_totalIncome |
Planned total income from growing crops at a farm. [DKK]. More... | |
double | m_totalN |
Total amount of fertilizer used at a farm. [kg]. More... | |
double | m_totalNanim |
Total animal fertilizer at a farm. A sum of Livestock::m_NanimUsable (from all types of livestock). [kg]. More... | |
double | m_totalNt |
Total amount of fertilizer purchased at a farm. [kg]. More... | |
double | m_totalProfit |
Planned total profit (= income - costs) at a farm. In case of animal farms costs of purchased fodder is subtracted from the profit. [DKK]. More... | |
double | m_totalWeeding |
Total manual weeding planned at a farm. More... | |
vector< CropSort > | m_variableCrops |
Vector of structs containing pointers to crops which are not fixed. More... | |
vector< CropSort > | m_variableCrops2 |
Vector of structs containing pointers to crops which are not fixed and: in case of the winter rotation restriction - exclude winter rotation crops, in case of the cattle rotation restriction - exclude the three crops that form the condition of the restriction and winter wheat. More... | |
vector< CropSort > | m_winterCrops |
Vector of structs containing pointers to winter crops. More... | |
Protected Attributes inherited from Farm | |
AgroChemIndustryCereal * | m_agrochemindustrycereal |
BroadBeans * | m_broadbeans |
Carrots * | m_carrots |
CloverGrassGrazed1 * | m_CGG1 |
CloverGrassGrazed2 * | m_CGG2 |
DummyCropPestTesting * | m_dummycroppesttesting |
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... | |
int | m_farm_num |
TTypesOfFarm | m_farmtype |
FieldPeas * | m_fieldpeas |
FieldPeasSilage * | m_fieldpeassilage |
FieldPeasStrigling * | m_fieldpeasstrigling |
vector< LE * > | m_fields |
Fodderbeet * | m_fodderbeet |
FodderGrass * | m_foddergrass |
HunterList | m_HuntersList |
A list of hunters allocated to this farm. More... | |
int | m_intensity |
Maize * | m_maize |
MaizeSilage * | m_maizesilage |
MaizeStrigling * | m_maizestrigling |
NLBeet * | m_nlbeet |
NLBeetSpring * | m_nlbeetspring |
NLCabbage * | m_nlcabbage |
NLCabbageSpring * | m_nlcabbagespring |
NLCarrots * | m_nlcarrots |
NLCarrotsSpring * | m_nlcarrotsspring |
NLCatchPeaCrop * | m_nlcatchpeacrop |
NLGrassGrazed1 * | m_nlgrassgrazed1 |
NLGrassGrazed1Spring * | m_nlgrassgrazed1spring |
NLGrassGrazed2 * | m_nlgrassgrazed2 |
NLGrassGrazedLast * | m_nlgrassgrazedlast |
NLMaize * | m_nlmaize |
NLMaizeSpring * | m_nlmaizespring |
NLPermanentGrassGrazed * | m_nlpermanentgrassgrazed |
NLPotatoes * | m_nlpotatoes |
NLPotatoesSpring * | m_nlpotatoesspring |
NLSpringBarley * | m_nlspringbarley |
NLSpringBarleySpring * | m_nlspringbarleyspring |
NLTulips * | m_nltulips |
NLWinterWheat * | m_nlwinterwheat |
NorwegianOats * | m_norwegianoats |
NorwegianPotatoes * | m_norwegianpotatoes |
NorwegianSpringBarley * | m_norwegianspringbarley |
Oats * | m_oats |
OBarleyPeaCloverGrass * | m_OBarleyPCG |
OCarrots * | m_ocarrots |
OCloverGrassGrazed1 * | m_OCGG1 |
OCloverGrassGrazed2 * | m_OCGG2 |
OCloverGrassSilage1 * | m_OCGS1 |
OFieldPeas * | m_ofieldpeas |
OFieldPeasSilage * | m_ofieldpeassilage |
OFirstYearDanger * | m_ofirstyeardanger |
OFodderbeet * | m_ofodderbeet |
OGrazingPigs * | m_ograzingpigs |
OMaizeSilage * | m_omaizesilage |
OOats * | m_ooats |
OPermanentGrassGrazed * | m_opermgrassgrazed |
OPotatoes * | m_opotatoes |
OrchardCrop * | m_orchardcrop |
OSBarleySilage * | m_osbarleysilage |
OSeedGrass1 * | m_oseedgrass1 |
OSeedGrass2 * | m_oseedgrass2 |
OSpringBarley * | m_ospringbarley |
OSpringBarleyExt * | m_ospringbarleyext |
OSpringBarleyPigs * | m_ospringbarleypigs |
OTriticale * | m_otriticale |
FarmManager * | m_OurManager |
Pointer to the FarmManager. More... | |
OWinterBarley * | m_owinterbarley |
OWinterBarleyExt * | m_owinterbarleyext |
OWinterRape * | m_owinterrape |
OWinterRye * | m_owinterrye |
OWinterWheat * | m_owinterwheat |
OWinterWheatUndersown * | m_owinterwheatundersown |
OWinterWheatUndersownExt * | m_owinterwheatundersownext |
PermanentSetAside * | m_permanentsetaside |
vector< PermCropData > | m_PermCrops |
PermanentGrassGrazed * | m_permgrassgrazed |
PermanentGrassLowYield * | m_permgrasslowyield |
PermanentGrassTussocky * | m_permgrasstussocky |
PLBeans * | m_plbeans |
PLBeet * | m_plbeet |
PLBeetSpr * | m_plbeetspr |
PLCarrots * | m_plcarrots |
PLFodderLucerne1 * | m_plfodderlucerne1 |
PLFodderLucerne2 * | m_plfodderlucerne2 |
PLMaize * | m_plmaize |
PLMaizeSilage * | m_plmaizesilage |
PLPotatoes * | m_plpotatoes |
PLSpringBarley * | m_plspringbarley |
PLSpringBarleySpr * | m_plspringbarleyspr |
PLSpringWheat * | m_plspringwheat |
PLWinterBarley * | m_plwinterbarley |
PLWinterRape * | m_plwinterrape |
PLWinterRye * | m_plwinterrye |
PLWinterTriticale * | m_plwintertriticale |
PLWinterWheat * | m_plwinterwheat |
PLWinterWheatLate * | m_plwinterwheatlate |
Potatoes * | m_potatoes |
PotatoesIndustry * | m_potatoesindustry |
LowPriority< FarmEvent * > | m_queue |
vector< TTypesOfVegetation > | m_rotation |
int | m_rotation_sync_index |
SpringBarleyCloverGrass * | m_sbarleyclovergrass |
SeedGrass1 * | m_seedgrass1 |
SeedGrass2 * | m_seedgrass2 |
SetAside * | m_setaside |
SpringBarley * | m_springbarley |
SpringBarleyCloverGrassStrigling * | m_springbarleyclovergrassstrigling |
SpringBarleyPeaCloverGrassStrigling * | m_springbarleypeaclovergrassstrigling |
SpringBarleyPTreatment * | m_springbarleyptreatment |
SpringBarleySeed * | m_springbarleyseed |
SpringBarleySilage * | m_springbarleysilage |
SpringBarleySKManagement * | m_springbarleyskmanagement |
SpringBarleySpr * | m_springbarleyspr |
SpringBarleyStrigling * | m_springbarleystrigling |
SpringBarleyStriglingCulm * | m_springbarleystriglingculm |
SpringBarleyStriglingSingle * | m_springbarleystriglingsingle |
SpringRape * | m_springrape |
bool | m_stockfarmer |
Sugarbeet * | m_sugarbeet |
Triticale * | m_triticale |
WinterBarley * | m_winterbarley |
WinterBarleyStrigling * | m_winterbarleystrigling |
WinterRape * | m_winterrape |
WinterRapeStrigling * | m_winterrapestrigling |
WinterRye * | m_winterrye |
WinterRyeStrigling * | m_winterryestrigling |
WinterWheat * | m_winterwheat |
WinterWheatStrigling * | m_winterwheatstrigling |
WinterWheatStriglingCulm * | m_winterwheatstriglingculm |
WinterWheatStriglingSingle * | m_winterwheatstriglingsingle |
WWheatPControl * | m_wwheatpcontrol |
WWheatPToxicControl * | m_wwheatptoxiccontrol |
WWheatPTreatment * | m_wwheatptreatment |
YoungForestCrop * | m_youngforest |
A farm that carries out crop, pesticide and fertilizer planning using simplified optimisation or other decision startegies.
OptimisingFarm::OptimisingFarm | ( | FarmManager * | a_myfarmmanager, |
int | a_No | ||
) |
The constructor.
Definition at line 5153 of file farm.cpp.
References animals_no, force_deliberation, Initialize(), m_actual_aggregated_yield, m_actual_costs, m_actual_income, m_actual_profit, m_almass_no, m_animals_numbers, m_decision_mode_counters, m_exp_costs, m_exp_income, m_exp_profit, Farm::m_farmtype, m_main_goal, Farm::m_OurManager, m_previously_imitated_neighbour, tof_OptimisingFarm, and tofg_profit.
|
inlinevirtual |
void OptimisingFarm::ActualProfit | ( | ) |
Function that determines actual crop yields and profit in a given year.
The function calculates actual yields, income, costs, profits etc. for a given farm in a previous year by accounting for crops grown at its fields. Determines farmer's need satisfaction level (m_need_satisfaction_level) which depends on farmer's actual results relative to the expected ones; the values compared depend on a farmer type, profit maximizer and environmentalist look at profit, yield maximizer looks at aggregated yield. The function also accounts for the pesticide and fertilizer usage in order to obtain aggregate results. The function is used only in ALMaSS crop set mode.
Definition at line 8806 of file farm.cpp.
References FarmManager::Add_to_cropTotals(), animals_no, CropActualValues::area, CropActualValues::biomass_at_harvest, cfg_AnimalsThreshold, cfg_MaizeEnergy, cfg_Min_need_satisfaction1, cfg_Min_need_satisfaction2, cfg_OnlyDeliberation, cfg_Price_Nt, cfg_PriceChangeThreshold, VegElement::Clean_CropDataStorage(), crop_parameter(), findCropByName_almass(), force_deliberation, g_date, g_msg, DataForOptimisation::Get_beta1(), DataForOptimisation::Get_beta2(), DataForOptimisation::Get_biomass_factor(), VegElement::Get_CropDataStorage(), FarmManager::Get_crops_summary_BIs_tov(), DataForOptimisation::Get_cropTypes_almass(), DataForOptimisation::Get_cropTypes_almass_size(), DataForOptimisation::Get_fodder(), DataForOptimisation::Get_noCrops(), DataForOptimisation::Get_sellingPrice(), DataForOptimisation::Get_sellingPrice_lastyr(), VegElement::Get_taken(), Farm::GetArea(), FarmManager::GetDD(), Calendar::GetYearNumber(), CropActualValues::harvested, m_actual_aggregated_yield, m_actual_costs, m_actual_income, m_actual_profit, m_almass_no, m_animals_numbers, CropOptimised::m_costs_ha, CropOptimised::m_cropType_almass, m_exp_aggregated_yield, m_exp_costs, m_exp_income, m_exp_profit, m_farmType, Farm::m_fields, CropOptimised::m_grooming, CropOptimised::m_hoeing, m_main_goal, CropOptimised::m_n, m_need_satisfaction_level, CropOptimised::m_nt, CropOptimised::m_optimalN, Farm::m_OurManager, m_previous_aggregated_yields, m_previous_costs, m_previous_incomes, m_previous_profits, m_previous_satisfaction_levels, CropOptimised::m_resp, CropOptimised::m_rotationMax, m_soilType, CropOptimised::m_totalLoss, CropOptimised::m_weeding, CropActualValues::missed_fi_app, CropActualValues::missed_herb_app, CropActualValues::no_fi_app, CropActualValues::no_herb_app, FarmManager::pm_data, FarmManager::Set_crops_fertilizer(), FarmManager::Set_crops_fertilizer_trade(), FarmManager::Set_crops_summary_BIs(), FarmManager::Set_crops_summary_BIs_fi(), FarmManager::Set_crops_summary_BIs_herb(), FarmManager::Set_cropTotals_cattle_sum(), FarmManager::Set_cropTotals_other_sum(), FarmManager::Set_cropTotals_pig_sum(), FarmManager::Set_cropTotals_plant_sum(), FarmManager::Set_cropTotals_sum(), CropActualValues::taken, tofg_environment, tofg_profit, tofg_yield, toof_Cattle, toof_Other, toof_Pig, toof_Plant, tos_Foobar, tov_CloverGrassGrazed1, tov_CloverGrassGrazed2, tov_FodderBeet, tov_FodderGrass, tov_Maize, tov_OrchardCrop, tov_PermanentGrassGrazed, tov_PermanentGrassLowYield, tov_PermanentGrassTussocky, tov_Potatoes, tov_PotatoesIndustry, tov_SeedGrass1, tov_SeedGrass2, tov_SpringBarleySilage, CropActualValues::tov_type, tov_Undefined, tov_YoungForest, CfgFloat::value(), CfgBool::value(), MapErrorMsg::Warn(), and WARN_BUG.
Referenced by FarmManager::ActualProfit().
|
protected |
Adds areas of fixed crops to the variable m_assigned. For each fixed crop it saves its area under variable CropOptimised::m_areaPercent.
Function assigning to fixed crops their initial areas as percentages of a farm's total area. It determines the share of a farm (%) reserved for fixed crops - excluded from the optimisation - and saves it in a variable m_assigned.
Definition at line 6275 of file farm.cpp.
References cfg_UseBedriftsmodelFarmAreas, m_area_scaling_factor, m_assigned, m_fixedCrops, m_totalArea, and CfgBool::value().
Referenced by OptimiseFarm().
|
protected |
Checks if the sum of crops' areaPercent is 100%.
Determines the sum of all crops' CropOptimised::m_areaPercent. If the sum is not equal to 100, it issues a warning in a "Check_if_area_is_100%.txt" file.
Definition at line 8060 of file farm.cpp.
References m_almass_no, and m_crops.
Referenced by OptimiseFarm().
|
protected |
Modifies areas of SeedGrass1 and SeedGrass2, CloverGrassGrazed1 and CloverGrassGrazed2 to be even. Used only in ALMaSS crops mode (in Bedriftsmodel (original farm optimization model) crops mode this is taken care of in Translate_crops_to_almass()).
Definition at line 5877 of file farm.cpp.
References findCropByName_almass(), CropOptimised::m_areaPercent, CropOptimised::m_areaVariable, and CropOptimised::m_rotationMin.
Referenced by checkRestrictions().
|
protectedvirtual |
Checks if the restrictions are fulfilled and corrects crops' areas if necessary.
Function checking if restrictions concerning crop rotations are fulfilled. If not, it corrects the crop areas in order to fulfill the restrictions. It starts with checking the restriction on winter crops rotation. Then it checks restriction on max winter crops' area. Finally, for cattle farms it checks the restriction on crop rotation.
The order of checking the first two restrictions does matter: in case the first restriction is not fullfilled, the first function always decreases winter wheat's area and only in a particular case increases area of winter rape. Thus, the total area of winter crops (->second restriction) most likely is decreased or, otherwise - unchanged by the function dealing with the first restriction. The second restriction, on max area of winter crops, does not allow to decrease area of winter rape; this, in certain cases, might result in suboptimal final result, but ensures that the first restriction is not violated. In the third restriction
(only in the version for cattle farms) in the Bedriftsmodel crop mode, winter wheat is removed from the list of crops which is used to fill up the gap after decreasing some of the restriction crops.
In the ALMaSS crops mode the third restriction (for cattle farms) is implemented in a simplified version, i.e. it is limited to changing only areas of crops that form the restriction. Additionally, in the ALMaSS crops mode there is a function which ensures that areas of both CloverGrassGrazed1 and CloverGrassGrazed2 as well as SeedGrass1 and SeedGrass2 are equal (since '1' and '2' are the same crops, but with different management in the first and next year they are grown).
Reimplemented in OptimisingCattleFarm, and OptimisingPigFarm.
Definition at line 6410 of file farm.cpp.
References cfg_Areas_Based_on_Distribution, cfg_OptimiseBedriftsmodelCrops, Check_SG_and_CGG(), checkWinterCrops(), checkWinterRotation1(), and CfgBool::value().
Referenced by OptimisingPigFarm::checkRestrictions(), OptimisingCattleFarm::checkRestrictions(), and OptimiseFarm().
|
inlineprotectedvirtual |
Checks if the restriction on a max. share of winter crops is fulfilled.
Reimplemented in NonAnimalFarm, and AnimalFarm.
Definition at line 2332 of file farm.h.
Referenced by checkRestrictions().
|
inlineprotectedvirtual |
Checks if the restriction on a winter rotation is fulfilled.
Reimplemented in NonAnimalFarm, and AnimalFarm.
Definition at line 2330 of file farm.h.
Referenced by checkRestrictions().
void OptimisingFarm::ChooseDecisionMode | ( | ) |
Function determines which decision mode to use. The choice depends on the values of need satisfaction and uncertainty.
In the first year the function is called (8), it calls Find_neighbour_to_imitate. Every year it determines a farmer's certainty level. Depending on farmer's satisfaction and certainty levels it picks a decision mode: imitation if a farmer is uncertain, but satisfied; social comparison if a farmer is uncertain and not satisfied; repetition if a farmer is certain and satisifed; or deliberation if a farmer is certain, but not satisifed.
Definition at line 5478 of file farm.cpp.
References cfg_Min_certainty, cfg_OnlyDeliberation, Find_neighbour_to_imitate(), force_deliberation, g_date, Get_actual_aggregated_yield(), Get_actual_profit(), Get_rotational_crops_visible(), Calendar::GetYearNumber(), m_certainty_level, m_decision_mode_counters, m_main_goal, m_need_satisfaction_level, m_previous_satisfaction_levels, m_previously_imitated_neighbour, m_rotational_crops, m_rotational_crops_copy, m_totalFUdemand, m_totalFUdemandBefore, m_totalFUgrown, Make_almass_crops_vector(), Make_rotational_crops(), OptimiseFarm(), tofg_environment, tofg_profit, tofg_yield, tov_Undefined, CfgFloat::value(), and CfgBool::value().
Referenced by FarmManager::ChooseDecisionMode_for_farms().
|
protectedvirtual |
Creates lists of crops.
Reimplemented in AnimalFarm.
Definition at line 5570 of file farm.cpp.
References createVariableCrops().
Referenced by Init().
|
protected |
Creates a list of pointers to all variable crops included in the optimisation and a list of pointers to fixed crops.
Creates two vectors: vector of pointers to fixed crops and a vector of structs containing variable crops.
Definition at line 5579 of file farm.cpp.
References cfg_OptimiseBedriftsmodelCrops, DataForOptimisation::Get_fixed(), m_crops, m_farmType, m_fixedCrops, Farm::m_OurManager, m_variableCrops, FarmManager::pm_data, and CfgBool::value().
Referenced by createCropsLists(), and AnimalFarm::createCropsLists().
|
protected |
Reads in crop parameters that do NOT vary with any farm level parameters.
Definition at line 7756 of file farm.cpp.
References DataForOptimisation::Get_cropParameter(), Farm::m_OurManager, FarmManager::pm_data, top_Foobar, and FarmManager::TranslateParametersCodes().
Referenced by ActualProfit(), findBIs(), findGrossMargin(), findMWeedControl(), and findYieldLoss().
|
protectedvirtual |
Decreases area of a crops by a specified number.
Function decreases area of one or more crops from the list given as a first argument.The total area subtracted from the crops in the list is equal to the value of the second argument.
Reimplemented in AnimalFarm.
Definition at line 7912 of file farm.cpp.
Referenced by NonAnimalFarm::checkWinterCrops(), NonAnimalFarm::checkWinterRotation1(), and AnimalFarm::determineMinFodder().
|
protectedvirtual |
Determines areas of variable crops.
Function determining areas of all not fixed, non-fodder crops at a farm as percentages of a farm's total area. It goes through a list of variable crops sorted from the highest to the lowest Gross Margin (i.e., most to least profitable) and assigns a maximal allowed area for each non-fodder crop - until the remaining farm's area is equal to or lower than a maximal allowed area for a given crop. In such case it assigns the remaining area to this crop. All remaining crops are assigned areas equal to zero (above their minimal required areas).
If the cfg_Areas_Based_on_Distribution variable is set to true, the area is assigned on the basis og each crop's GM proportion in the summary GM based on crops with a positive GM.
Reimplemented in AnimalFarm.
Definition at line 6304 of file farm.cpp.
References cfg_Areas_Based_on_Distribution, cfg_OptimiseBedriftsmodelCrops, DataForOptimisation::Get_fodder(), m_assigned, m_farmType, m_grownVariableCrops, Farm::m_OurManager, m_variableCrops, FarmManager::pm_data, and CfgBool::value().
Referenced by AnimalFarm::determineAreas(), and OptimiseFarm().
|
protected |
Determines areas of crops in ha.
Determines areas of crops in ha: CropOptimised::m_area_ha = CropOptimised::m_areaPercent/100 * m_totalArea.
Definition at line 7967 of file farm.cpp.
References m_totalArea.
Referenced by OptimiseFarm().
|
protected |
Calls functions determining farm level values before the initial optimisation.
Calls functions determining farm level values before the initial optimisation (i.e.: amount of animal fertilizer (total - m_totalNanim, and per ha - m_Nanim), farm's area - m_totalArea, and fodder demand - m_totalFUdemand).
Definition at line 5613 of file farm.cpp.
References cfg_Areas_Based_on_Distribution, findFodderDemand(), findNanim(), findTotalArea(), findTotalNanim(), preventCashCrops(), and CfgBool::value().
Referenced by Init().
OptimisingFarm * OptimisingFarm::Find_neighbour_to_imitate | ( | ) |
Picks randomly a farmer to imitate/compare with. It chooses among neighbouring farmers with similar farms.
Chooses a farmer for imitation and social comparison decision making modes. For business (>10 ha) farms it chooses a farmer with the same farm type and soil type. For private (<10 ha) farms it chooses a farmer with the same soil type.
Definition at line 5380 of file farm.cpp.
References g_msg, Get_farmSize(), Get_soilType(), m_almass_no, m_farmSize, m_farmType, m_neighbours, m_previously_imitated_neighbour, m_rotational_crops_visible, m_soilType, tofs_Private, tos_Clay, MapErrorMsg::Warn(), and WARN_BUG.
Referenced by ChooseDecisionMode().
|
protected |
Determines the optimal Treatment frequency indices (behandling index, BI in Danish) (CropOptimised::m_BIHerb, CropOptimised::m_BIFi, CropOptimised::m_BI) for a given crop at a farm.
Function determining the optimal 'behandling indeks' (treatment frequency index) for herbicides (CropOptimised::m_BIHerb), fungicides and insecticides (CropOptimised::m_BIFi), and a summary BI per ha (CropOptimised::m_BIHerb). For each crop there is a specified amount of herbicides, fungicides and insecticides for which the yield loss is equal to zero. The farmer can choose between this value and not using pesticide at all (since yield and profit are linear functions of pesticide usage). However, when a given crop is actually grown, farmer might not apply pesticide if there is no pest problem (even though he originally planned to apply pesticides), or might apply more than he planned to if there is an excess pest problem. Therefore, there is a variation in the actual pesticide usage between farmers.
Definition at line 6047 of file farm.cpp.
References cfg_Env_pest_multiplier, cfg_OptimiseBedriftsmodelCrops, crop_parameter(), CropOptimised::m_BI, CropOptimised::m_BIFi, CropOptimised::m_BIHerb, CropOptimised::m_cropType, CropOptimised::m_cropType_almass, m_main_goal, CropOptimised::m_resp, tofg_environment, tofg_profit, tofg_yield, CfgFloat::value(), and CfgBool::value().
Referenced by optimizeCrops().
|
protected |
Returns a pointer to a crop whose name is specified as the argument (bedriftsmodel, i.e. original farm optimization model, crops mode).
Definition at line 7762 of file farm.cpp.
References g_msg, m_crops, Farm::m_OurManager, FarmManager::TranslateCropsCodes(), MapErrorMsg::Warn(), and WARN_FILE.
Referenced by OptimisingCattleFarm::checkCattleRotation(), AnimalFarm::checkWinterCrops(), NonAnimalFarm::checkWinterCrops(), AnimalFarm::checkWinterRotation1(), NonAnimalFarm::checkWinterRotation1(), fixBI(), and Make_rotations().
|
protected |
Returns a pointer to almass crop whose name is specified as the argument (ALMaSS crops mode).
Definition at line 7770 of file farm.cpp.
References g_msg, m_crops, Farm::m_OurManager, FarmManager::TranslateCropCodes(), MapErrorMsg::Warn(), and WARN_FILE.
Referenced by ActualProfit(), Check_SG_and_CGG(), OptimisingPigFarm::check_WRape_WBarley(), OptimisingCattleFarm::checkCattleRotation_almass(), AnimalFarm::checkWinterCrops(), NonAnimalFarm::checkWinterCrops(), AnimalFarm::checkWinterRotation1(), NonAnimalFarm::checkWinterRotation1(), fixBI(), Make_rotations(), OptimisingCattleFarm::preventCashCrops(), Spraying_fungins(), and Spraying_herbicides().
|
protected |
|
protected |
Determines the optimal amounts of: total fertilizer (CropOptimised::m_n) and purchased fertilizer (CropOptimised::m_nt) for a given crop at a farm.
Function determining the optimal amounts of: total fertilizer (CropOptimised::m_n) and purchased fertilizer (CropOptimised::m_nt) per ha of a crop at a given farm. [kg/ha]
Definition at line 5906 of file farm.cpp.
References cfg_Env_fert_multiplier, cfg_OptimiseBedriftsmodelCrops, cfg_Price_Nt, DataForOptimisation::Get_beta1(), DataForOptimisation::Get_beta2(), DataForOptimisation::Get_Nnorm(), CropOptimised::m_cropType, CropOptimised::m_cropType_almass, m_main_goal, CropOptimised::m_n, m_Nanim, CropOptimised::m_nt, CropOptimised::m_optimalN, Farm::m_OurManager, m_soilType, FarmManager::pm_data, tofg_environment, tofg_profit, tofg_yield, CfgFloat::value(), and CfgBool::value().
Referenced by optimizeCrops().
|
protectedvirtual |
Determines farm's total demand for fodder (m_totalFUdemand).
Function determining farm's demand for fodder. Sums fodder needed for all types of livestock.
Reimplemented in NonAnimalFarm.
Definition at line 5670 of file farm.cpp.
References cfg_UseBedriftsmodelFarmAreas, DataForOptimisation::Get_livestockParameter(), m_area_scaling_factor, m_livestock, Farm::m_OurManager, m_totalFUdemand, m_totalFUdemandBefore, FarmManager::pm_data, tolp_Foobar, FarmManager::TranslateLivestockParametersCodes(), and CfgBool::value().
Referenced by FarmLevelCalculation(), and NonAnimalFarm::findFodderDemand().
|
protected |
Determines the gross margin (CropOptimised::m_GM) for a given crop at a farm.
Function determining gross margin (CropOptimised::m_GM, i.e. profit per ha for a given crop; it might be positive only for non-fodder crops) and savings (CropOptimised::m_savings, savings from growing a fodder crop per ha, it equals zero for all non-fodder crops). [DKK]
Definition at line 6225 of file farm.cpp.
References cfg_OptimiseBedriftsmodelCrops, cfg_Price_Nt, crop_parameter(), DataForOptimisation::Get_fodder(), CropOptimised::m_BIFi, CropOptimised::m_BIHerb, CropOptimised::m_costs_ha, CropOptimised::m_cropType, CropOptimised::m_cropType_almass, m_farmType, CropOptimised::m_GM, CropOptimised::m_GM_Savings, CropOptimised::m_grooming, CropOptimised::m_hoeing, CropOptimised::m_income_ha, CropOptimised::m_nt, Farm::m_OurManager, CropOptimised::m_resp, CropOptimised::m_savings, CropOptimised::m_totalLoss, CropOptimised::m_weeding, FarmManager::pm_data, CfgFloat::value(), and CfgBool::value().
Referenced by optimizeCrops().
|
protected |
Determines the optimal mechanical weed control means (CropOptimised::m_grooming, CropOptimised::m_hoeing, CropOptimised::m_weeding) for a given crop at a farm.
Function determining optimal values of mechanical weed control means: grooming (CropOptimised::m_grooming), hoeing (CropOptimised::m_hoeing) and weeding (CropOptimised::m_weeding). All of them are functions of treatment frequency index (behandling indeks) for herbicides (CropOptimised::m_BIHerb).
Definition at line 6153 of file farm.cpp.
References cfg_OptimiseBedriftsmodelCrops, crop_parameter(), CropOptimised::m_BI, CropOptimised::m_BIFi, CropOptimised::m_BIHerb, CropOptimised::m_cropType, CropOptimised::m_cropType_almass, CropOptimised::m_grooming, CropOptimised::m_hoeing, CropOptimised::m_weeding, and CfgBool::value().
Referenced by optimizeCrops().
|
protected |
Determines amount of animal fertilizer per ha (m_Nanim) at a farm.
Determines m_Nanim - amount of animal fertilizer per ha for a farm.
Definition at line 5665 of file farm.cpp.
References m_Nanim, m_totalArea, and m_totalNanim.
Referenced by FarmLevelCalculation().
|
protected |
Determines the response (CropOptimised::m_resp) of a crop at a farm.
Function determining the response of a crop (yield per ha), CropOptimised::m_resp. It is a function of a total fertilizer (CropOptimised::m_n) applied for a crop at a given farm. [hkg/ha]
Definition at line 6031 of file farm.cpp.
References cfg_OptimiseBedriftsmodelCrops, DataForOptimisation::Get_alfa(), DataForOptimisation::Get_beta1(), DataForOptimisation::Get_beta2(), CropOptimised::m_cropType, CropOptimised::m_cropType_almass, CropOptimised::m_n, Farm::m_OurManager, CropOptimised::m_resp, m_soilType, FarmManager::pm_data, and CfgBool::value().
Referenced by optimizeCrops().
|
protected |
Determines m_totalArea of a farm.
Function determining farm's total area. Depending on which area is to be used it either sums initial crop areas on a farm (to get area equal to area used in Bedriftsmodel) or deteremines area based on farm's fields size.
Definition at line 5624 of file farm.cpp.
References cfg_UseBedriftsmodelFarmAreas, Farm::GetAreaDouble(), m_area_scaling_factor, m_crops, m_totalArea, m_totalArea_original, and CfgBool::value().
Referenced by FarmLevelCalculation().
|
protected |
Determines total animal fertilizer (m_totalNanim) available at a farm.
Function determining farm's total animal fertilizer. Sums usable fertilizer from all types of livestock.
Definition at line 5643 of file farm.cpp.
References cfg_UseBedriftsmodelFarmAreas, DataForOptimisation::Get_livestockParameter(), m_area_scaling_factor, m_livestock, Farm::m_OurManager, m_totalNanim, FarmManager::pm_data, tolp_Foobar, FarmManager::TranslateLivestockParametersCodes(), and CfgBool::value().
Referenced by FarmLevelCalculation().
|
protected |
Determines the yield losses (CropOptimised::m_lossHerb, CropOptimised::m_lossFi, CropOptimised::m_totalLoss) for a given crop at a farm.
Function determining yield losses resulting from not using maximal amount of herbicides (CropOptimised::m_lossHerb), fungicides and insecticides (CropOptimised::m_lossFi) and a total yield loss, which is a sum of m_lossHerb and m_lossFi (CropOptimised::m_totalLoss). Losses are expressed as percentages of yield (take values from 0 to 100).
Definition at line 6200 of file farm.cpp.
References cfg_OptimiseBedriftsmodelCrops, crop_parameter(), CropOptimised::m_BIFi, CropOptimised::m_BIHerb, CropOptimised::m_cropType, CropOptimised::m_cropType_almass, CropOptimised::m_lossFi, CropOptimised::m_lossHerb, CropOptimised::m_totalLoss, and CfgBool::value().
Referenced by optimizeCrops().
|
protected |
Sets values of Treatment frequency indices (BI) for crops with fixed amount of pesticides (CropOptimised::m_BIHerb for FodderBeet and both CropOptimised::m_BIHerb and CropOptimised::m_BIFi for PotatoesIndustry and Potatoes).
Definition at line 6123 of file farm.cpp.
References cfg_OptimiseBedriftsmodelCrops, findCropByName(), findCropByName_almass(), CropOptimised::m_BI, CropOptimised::m_BIFi, CropOptimised::m_BIHerb, and CfgBool::value().
Referenced by optimizeCrops().
|
protectedvirtual |
Carries out fungicide application. Saves information on each application for a given crop.
Reimplemented from Farm.
Definition at line 1307 of file farmfuncs.cpp.
References VegElement::Add_no_fi_app(), cfg_OptimiseBedriftsmodelCrops, Landscape::CheckForPesticideRecord(), DO_IT_PROB, EL_TRAMLINE_DECAYTIME, fungicide, fungicide_treat, g_landscape_p, g_weather, Weather::GetWind(), LE_SIG_NO_FUNGICIDE, Weather::Raining(), LE::SetLastTreatment(), LE::SetTramlinesDecay(), and CfgBool::value().
|
inline |
Definition at line 2054 of file farm.h.
References m_actual_aggregated_yield.
Referenced by ChooseDecisionMode().
|
inline |
Definition at line 2053 of file farm.h.
References m_actual_profit.
Referenced by ChooseDecisionMode().
|
inline |
Definition at line 2039 of file farm.h.
References m_almass_no.
Referenced by FarmManager::DumpFarmAreas(), FarmManager::FindNeighbours(), FarmManager::PrintDecModes_counts(), FarmManager::PrintNeighbours(), and FarmManager::PrintOutput().
|
inline |
Definition at line 2040 of file farm.h.
References m_crops.
Referenced by FarmManager::CropDistribution(), and FarmManager::PrintOutput().
|
inline |
Definition at line 2041 of file farm.h.
References m_crops.
Referenced by FarmManager::CropDistribution(), and FarmManager::PrintOutput().
|
inline |
Definition at line 2060 of file farm.h.
References m_decision_mode_counters.
Referenced by FarmManager::PrintDecModes_counts().
|
inline |
|
inline |
Definition at line 2036 of file farm.h.
References m_farmSize.
Referenced by Find_neighbour_to_imitate().
|
inline |
Definition at line 2034 of file farm.h.
References m_farmType.
Referenced by FarmManager::Save_diff_farm_types_areas().
|
inline |
Definition at line 2058 of file farm.h.
References m_main_goal.
Referenced by FarmManager::FarmManagement().
|
inline |
Definition at line 2050 of file farm.h.
References m_neighbours.
Referenced by FarmManager::PrintNeighbours().
|
inline |
Definition at line 2049 of file farm.h.
References m_neighbours.
Referenced by FarmManager::PrintNeighbours().
|
inline |
|
inline |
Definition at line 2052 of file farm.h.
References m_rotational_crops_visible.
Referenced by ChooseDecisionMode().
|
inline |
|
inline |
Definition at line 2035 of file farm.h.
References m_soilType.
Referenced by Find_neighbour_to_imitate().
|
inline |
Definition at line 2055 of file farm.h.
References Farm::m_farm_centroidx.
Referenced by FarmManager::FindNeighbours().
|
inline |
Definition at line 2056 of file farm.h.
References Farm::m_farm_centroidy.
Referenced by FarmManager::FindNeighbours().
|
protectedvirtual |
If there are events to carry out do this, and perhaps start a new crop.
Call the management plan for the current crop and it this return done=true starts the next management.
Sets the new index to the rotation.
Save the new veg type as the LE vegetation type
Reimplemented from Farm.
Definition at line 952 of file farm.cpp.
References cfg_OptimiseBedriftsmodelCrops, VegElement::Clean_CropDataStorage(), Calendar::Date(), g_date, g_farm_fixed_crop_enable, g_farm_fixed_crop_type, g_letype, g_msg, VegElement::Get_CropDataStorage(), VegElement::Get_taken(), LE::GetArea(), LE::GetRotIndex(), LowPriPair< ELEMTYPE >::m_element, FarmEvent::m_field, LowPriPair< ELEMTYPE >::m_pri, PROG_START, VegElement::Set_area_in_crop_data(), VegElement::Set_CropDataStorage(), VegElement::Set_taken(), VegElement::Set_tov_type(), LE::SetRotIndex(), LE::SetVegType(), tov_Undefined, LE_TypeClass::TranslateVegTypes(), CfgInt::value(), CfgBool::value(), MapErrorMsg::Warn(), and WARN_FILE.
|
virtual |
OptimisingFarm's virtual version of Farm::Harvest(). Saves information on biomass of a crop at harvest.
Reimplemented from Farm.
Definition at line 1859 of file farmfuncs.cpp.
References cfg_OptimiseBedriftsmodelCrops, Calendar::Date(), DO_IT_PROB, EL_TRAMLINE_DECAYTIME, g_date, g_landscape_p, g_weather, LE::GetInsectPop(), Weather::GetRainPeriod(), LE::GetUnsprayedMarginPolyRef(), LE::GetVegBiomass(), VegElement::GetVegType(), harvest, harvest1, LE::InsectMortality(), LE::ResetDigestability(), VegElement::Set_biomass_at_harvest(), VegElement::Set_harvested(), LE::SetGrowthPhase(), LE::SetInsectPop(), LE::SetLastTreatment(), LE::SetTramlinesDecay(), Landscape::SupplyLEPointer(), tov_Potatoes, tov_PotatoesIndustry, and CfgBool::value().
|
protectedvirtual |
Carries out herbicide application. Saves information on each application for a given crop.
Reimplemented from Farm.
Definition at line 1196 of file farmfuncs.cpp.
References VegElement::Add_no_herb_app(), cfg_OptimiseBedriftsmodelCrops, Landscape::CheckForPesticideRecord(), DO_IT_PROB, EL_HERBICIDE_DELAYTIME, EL_TRAMLINE_DECAYTIME, g_landscape_p, 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(), and CfgBool::value().
|
protectedvirtual |
Increases area of crops by a specified number.
Function increases area of one or more crops from the list given as a first argument.The total area added to the crops in the list is equal to the value of the second argument.
Reimplemented in AnimalFarm.
Definition at line 7854 of file farm.cpp.
Referenced by NonAnimalFarm::checkWinterCrops(), and NonAnimalFarm::checkWinterRotation1().
void OptimisingFarm::Init | ( | ofstream * | ap_output_file | ) |
Function carrying out the initial calculations at a farm level (including the initial optimisation).
Definition at line 5294 of file farm.cpp.
References cfg_OptimiseBedriftsmodelCrops, createCropsLists(), FarmLevelCalculation(), m_crops_almass, Farm::m_PermCrops, Farm::m_rotation, Make_almass_crops_vector(), Make_rotational_crops(), Make_rotations(), OptimiseFarm(), Print_FarmVariables(), Print_rotations(), toc_Foobar, tov_OrchardCrop, tov_PermanentGrassGrazed, tov_PermanentGrassLowYield, tov_PermanentGrassTussocky, tov_PermanentSetaside, tov_SpringBarley, tov_Undefined, tov_YoungForest, Translate_crops_to_almass(), and CfgBool::value().
Referenced by FarmManager::InitFarms().
|
protected |
Assigns to each farm its farm type, farm size, farm's real ID number, and soil type. It creates livestock and crops.
Definition at line 5187 of file farm.cpp.
References cfg_OptimiseBedriftsmodelCrops, g_msg, DataForOptimisation::Get_cropArea(), DataForOptimisation::Get_cropAreasSize(), DataForOptimisation::Get_cropTypes(), DataForOptimisation::Get_cropTypes_almass(), DataForOptimisation::Get_livestockNumber(), DataForOptimisation::Get_livestockNumbersSize(), DataForOptimisation::Get_livestockTypes(), DataForOptimisation::Get_noCrops(), DataForOptimisation::Get_rotationMax(), DataForOptimisation::Get_rotationMin(), m_almass_no, DataForOptimisation::m_farm_data, m_farmRealID, m_farmSize, m_farmType, Farm::m_OurManager, CropOptimised::m_rotationMax, CropOptimised::m_rotationMin, m_soilSubType, m_soilType, FarmManager::pm_data, Set_Crop(), Set_Livestock(), toa_Foobar, toc_Foobar, tofs_Foobar, tos_Foobar, tov_Undefined, CfgBool::value(), MapErrorMsg::Warn(), and WARN_BUG.
Referenced by OptimisingFarm().
|
protectedvirtual |
Kicks off the farm's management.
It assignes permanent crops (if there are any) to fields. In case there are no rotational crops it checks if there are any fields that haven't been assigned any permanent crop. In case there are, it assignes to a field a first permanent crop from the list of this farm's permanent crops.
Reimplemented from Farm.
Definition at line 5124 of file farm.cpp.
References Farm::AssignPermanentCrop(), Farm::InitiateManagement(), m_area_rot, Farm::m_fields, Farm::m_PermCrops, and tov_Undefined.
|
protectedvirtual |
Carries out insecticide application. Saves information on each application for a given crop.
Reimplemented from Farm.
Definition at line 1389 of file farmfuncs.cpp.
References VegElement::Add_no_fi_app(), cfg_OptimiseBedriftsmodelCrops, Landscape::CheckForPesticideRecord(), DO_IT_PROB, EL_TRAMLINE_DECAYTIME, g_landscape_p, g_weather, Weather::GetWind(), insecticide, LE::Insecticide(), insecticide_treat, l_farm_insecticide_kills, LE_SIG_NO_INSECTICIDE, Weather::Raining(), LE::SetLastTreatment(), LE::SetTramlinesDecay(), and CfgBool::value().
|
protected |
Creates a vector storing crops with positive area. Used in ALMaSS crop mode.
The function goes throught the list of all crops and attach them to the m_crops_almass vector if the area resulting from optimisation is larger than zero.
Definition at line 8269 of file farm.cpp.
References m_crops, and m_crops_almass.
Referenced by ChooseDecisionMode(), and Init().
|
protected |
Creates a vector m_rotational_crops using the results of optimisation.
Definition at line 8285 of file farm.cpp.
References m_area_rot, m_crops_almass, m_rotational_crops, tov_CloverGrassGrazed1, tov_CloverGrassGrazed2, tov_OrchardCrop, tov_PermanentGrassGrazed, tov_PermanentGrassLowYield, tov_PermanentGrassTussocky, tov_PermanentSetaside, tov_SeedGrass1, tov_SeedGrass2, tov_SpringBarley, and tov_YoungForest.
Referenced by ChooseDecisionMode(), and Init().
|
protected |
Creates m_rotation. Not used in ALMaSS crop mode.
Used in the Bedriftsmodel crop mode. The function provides the functionality of the UserDefinedFarm's constructor:
Definition at line 8403 of file farm.cpp.
References cfg_OptimiseBedriftsmodelCrops, findCropByName(), findCropByName_almass(), g_msg, FarmManager::Get_lookup_table(), m_area_rot, CropOptimised::m_areaPercent, m_crops_almass, m_farmType, Farm::m_OurManager, Farm::m_PermCrops, Farm::m_rotation, m_rotational_crops, Farm::m_stockfarmer, toof_Cattle, toof_Pig, OptimisingFarm::MakeRotation::Tov, tov_CloverGrassGrazed1, tov_CloverGrassGrazed2, tov_FieldPeas, tov_FieldPeasSilage, tov_FodderBeet, tov_MaizeSilage, tov_OrchardCrop, tov_PermanentGrassGrazed, tov_PermanentGrassLowYield, tov_PermanentGrassTussocky, tov_PermanentSetaside, tov_Potatoes, tov_SeedGrass1, tov_SeedGrass2, tov_Setaside, tov_SpringBarley, tov_SpringRape, tov_Undefined, tov_WinterBarley, tov_WinterRape, tov_WinterWheat, tov_YoungForest, CfgBool::value(), MapErrorMsg::Warn(), and WARN_BUG.
Referenced by Init().
void OptimisingFarm::Match_crop_to_field | ( | LE * | a_field | ) |
Finds a crop to be grown on a given field next year.
The function chooses a crop to grow in a given filed after the management plan of the current crop is finished.
Definition at line 9161 of file farm.cpp.
References cfg_Areas_Based_on_Distribution, g_msg, FarmManager::Get_lookup_table(), LE::GetArea(), Farm::GetArea(), m_almass_no, Farm::m_fields, Farm::m_OurManager, Farm::m_rotation, m_rotational_crops, m_rotational_crops_copy, LE::SetRotIndex(), tov_CloverGrassGrazed1, tov_CloverGrassGrazed2, tov_OrchardCrop, tov_PermanentGrassGrazed, tov_PermanentGrassLowYield, tov_PermanentGrassTussocky, tov_PermanentSetaside, tov_SeedGrass1, tov_SeedGrass2, tov_SpringBarley, tov_SpringRape, tov_Undefined, tov_WinterRape, tov_YoungForest, CfgBool::value(), MapErrorMsg::Warn(), WARN_BUG, and WARN_FILE.
Referenced by Crop::ChooseNextCrop().
|
protected |
Carries out the whole farm optimisation.
Definition at line 5765 of file farm.cpp.
References assignFixed(), cfg_Price_FU, Check_if_area_100(), checkRestrictions(), determineAreas(), determineAreas_ha(), m_crops, m_farmSize, m_totalBI, m_totalBIFi, m_totalBIHerb, m_totalCosts, m_totalFUt, m_totalGrooming, m_totalHoeing, m_totalIncome, m_totalN, m_totalNt, m_totalProfit, m_totalWeeding, m_variableCrops, optimizeCrops(), randomizeCropList(), sortCrops(), sumMinAreas(), tocv_BI, tocv_BIFi, tocv_BIHerb, tocv_Costs, tocv_GM, tocv_Grooming, tocv_Hoeing, tocv_Income, tocv_N, tocv_Nt, tocv_Weeding, tofs_Business, total(), and CfgFloat::value().
Referenced by ChooseDecisionMode(), and Init().
|
protected |
Carries out crop optimisation at a farm.
Function carrying out the optimisation of each crop for a given farm. It contains functions determining the optimal amounts (per ha) of fertilizer (animal and purchased), pesticides and mechanical weed control as well as functions finding response (yield per ha), yield loss and gross margin (profitability) of each crop.
Definition at line 5796 of file farm.cpp.
References cfg_OptimiseBedriftsmodelCrops, cfg_Price_FU, cfg_Price_Oats, cfg_Price_SBarley, cfg_Price_SRape, cfg_Price_Triticale, cfg_Price_WBarley, cfg_Price_WRape, cfg_Price_WWheat, cfg_Sensitivity_analysis, findBIs(), findFertilizer(), findGrossMargin(), findMWeedControl(), findResponse(), findYieldLoss(), fixBI(), DataForOptimisation::Get_fodder(), DataForOptimisation::Get_FUKey(), DataForOptimisation::Get_sellingPrice(), CropOptimised::m_benefit, m_crops, m_farmType, Farm::m_OurManager, m_soilType, FarmManager::pm_data, toc_Oats, toc_WWheat, toof_Cattle, toof_Pig, tos_Foobar, tov_Oats, tov_SpringBarley, tov_SpringRape, tov_Triticale, tov_WinterBarley, tov_WinterRape, tov_WinterWheat, CfgFloat::value(), and CfgBool::value().
Referenced by OptimiseFarm().
|
inlineprotectedvirtual |
Prevents small cattle farms from growing cash crops and maize silage.
Reimplemented in OptimisingCattleFarm.
Definition at line 2293 of file farm.h.
Referenced by FarmLevelCalculation().
|
protected |
Prints farm-level variables to a text file (one file for all farms).
Prints farm level variables into one file (FarmVariables.txt).
Definition at line 8045 of file farm.cpp.
References m_almass_no, m_main_goal, m_Nanim, m_totalArea, m_totalBI, m_totalBIFi, m_totalBIHerb, m_totalCosts, m_totalFUdemand, m_totalFUdemandBefore, m_totalFUgrown, m_totalFUt, m_totalGrooming, m_totalHoeing, m_totalIncome, m_totalN, m_totalNanim, m_totalNt, m_totalProfit, and m_totalWeeding.
Referenced by Init().
|
protected |
Prints the content of a farm's m_rotation. Not used in ALMaSS crop mode.
Prints the content of m_rotation vector into the FarmVariables text file.
Definition at line 8389 of file farm.cpp.
References Farm::m_rotation.
Referenced by Init().
|
virtual |
Used when determining whether there should be a spraying event (i.e. pesticides application) or not. For yield maximizer it increases the chance of spraying event to account for his 'just in case' spraying.
Reimplemented from Farm.
Definition at line 5372 of file farm.cpp.
References cfg_Yield_max_pest_prob_multiplier, m_main_goal, tofg_yield, and CfgFloat::value().
|
protected |
Swaps randomly elements of the list holding same values of the key (according to which the list was previosuly sorted).
Function randomly swaps elements of a sorted vector holding equal values of the key used for sorting. Uses a vector to carry out shuffling.
Definition at line 7811 of file farm.cpp.
References g_msg, MapErrorMsg::Warn(), and WARN_FILE.
Referenced by AnimalFarm::determineAreas(), and OptimiseFarm().
void OptimisingFarm::Save_last_years_crops | ( | ) |
It saves the OptimisingFarm::m_rotational_crops in a vector m_rotational_crops_visible which is accessible for other farmers if they decide to copy it in the following year.
Definition at line 5472 of file farm.cpp.
References m_rotational_crops, and m_rotational_crops_visible.
Referenced by FarmManager::Save_last_years_crops_for_farms().
|
inline |
Definition at line 2059 of file farm.h.
References animals_no.
Referenced by FarmManager::FarmManagement().
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 2048 of file farm.h.
References m_neighbours.
Referenced by FarmManager::FindNeighbours().
|
protected |
Increases area of winter rotation crops to their max. allowed area.
|
protected |
Sorts structs of type CropSort.
Function for sorting crops using sortingKey as a criterion for sorting. First argument is a vector of structs containing a pointer to a crop and a key.
Definition at line 7788 of file farm.cpp.
Referenced by OptimisingCattleFarm::checkCattleRotation(), AnimalFarm::checkWinterCrops(), NonAnimalFarm::checkWinterCrops(), AnimalFarm::checkWinterRotation1(), NonAnimalFarm::checkWinterRotation1(), AnimalFarm::determineAreas(), and OptimiseFarm().
|
virtual |
Returns true if a farmer decided to treat a given crop with fung- and insecticides.
Reimplemented from Farm.
Definition at line 5360 of file farm.cpp.
References cfg_OptimiseBedriftsmodelCrops, findCropByName_almass(), CropOptimised::m_BIFi, and CfgBool::value().
|
virtual |
Returns true if a farmer decided to treat a given crop with herbicides.
Reimplemented from Farm.
Definition at line 5348 of file farm.cpp.
References cfg_OptimiseBedriftsmodelCrops, findCropByName_almass(), CropOptimised::m_BIHerb, and CfgBool::value().
|
protected |
Adds minimum required areas of variable crops to the variable m_assigned.
The function adds the minimum required areas of variable crops to the variable m_assigned (which holds a share of the farm area excluded from the optimisation).
Definition at line 6294 of file farm.cpp.
References m_assigned, and m_variableCrops.
Referenced by OptimiseFarm().
|
protected |
Function for determining total values per farm after initial optimisation.
Function for determining total values of crop variables per farm. Goes through the list of all crops. If an area of a crop is positive, it adds the area of this crop (in ha) multiplied by the value of a variable (per ha) to the total value per farm.
Definition at line 7977 of file farm.cpp.
References g_msg, m_crops, tocv_AreaHa, tocv_AreaPercent, tocv_BI, tocv_BIFi, tocv_BIHerb, tocv_Costs, tocv_GM, tocv_Grooming, tocv_Hoeing, tocv_Income, tocv_N, tocv_Nt, tocv_Response, tocv_Savings, tocv_TotalLoss, tocv_Weeding, MapErrorMsg::Warn(), and WARN_BUG.
Referenced by OptimiseFarm().
|
protected |
Translates crops from Bedriftsmodel (original farm optimization model) to Almass crops. Used in Bedriftsmodel crop mode.
The function takes a vector m_crops as an input. It goes through all crops; for those with a positive areaPercent, it finds an equivalent in almass crops. The output is a vector of structs AlmassCrop (with 2 members: area in percent and tov, type of vegetation).
Definition at line 8075 of file farm.cpp.
References g_msg, m_crops, m_crops_almass, tov_Carrots, tov_CloverGrassGrazed1, tov_CloverGrassGrazed2, tov_FieldPeas, tov_FieldPeasSilage, tov_FodderBeet, tov_FodderGrass, tov_MaizeSilage, tov_Oats, tov_OrchardCrop, tov_PermanentGrassGrazed, tov_PermanentGrassLowYield, tov_PermanentGrassTussocky, tov_PermanentSetaside, tov_Potatoes, tov_PotatoesIndustry, tov_SeedGrass1, tov_SeedGrass2, tov_Setaside, tov_SpringBarley, tov_SpringBarleySilage, tov_SpringRape, tov_Triticale, tov_WinterBarley, tov_WinterRape, tov_WinterRye, tov_WinterWheat, tov_YoungForest, MapErrorMsg::Warn(), and WARN_BUG.
Referenced by Init().
|
protected |
Holds the number of animals in a farm at a particular day in a year (depends on a species).
Definition at line 2154 of file farm.h.
Referenced by ActualProfit(), OptimisingFarm(), and Set_animals_no().
|
protected |
If set to true, a farm must use deliberation as a decision strategy.
Definition at line 2152 of file farm.h.
Referenced by ActualProfit(), ChooseDecisionMode(), and OptimisingFarm().
|
protected |
Actual aggregated yield at a farm in a given year.
Sum of yield ratios (actual to expected yield) from all grown crops.
Definition at line 2131 of file farm.h.
Referenced by ActualProfit(), Get_actual_aggregated_yield(), and OptimisingFarm().
|
protected |
Actual costs at a farm in a given year.
Definition at line 2126 of file farm.h.
Referenced by ActualProfit(), and OptimisingFarm().
|
protected |
An actual income at a farm in a given year.
Definition at line 2122 of file farm.h.
Referenced by ActualProfit(), and OptimisingFarm().
|
protected |
An actual profit realised at a farm in a given year.
Definition at line 2118 of file farm.h.
Referenced by ActualProfit(), Get_actual_profit(), and OptimisingFarm().
|
protected |
Farm's almass number.
Definition at line 2220 of file farm.h.
Referenced by ActualProfit(), Check_if_area_100(), OptimisingCattleFarm::checkCattleRotation(), AnimalFarm::checkWinterCrops(), NonAnimalFarm::checkWinterCrops(), AnimalFarm::checkWinterRotation1(), NonAnimalFarm::checkWinterRotation1(), AnimalFarm::determineMinFodder(), Find_neighbour_to_imitate(), Get_almass_no(), Initialize(), Match_crop_to_field(), OptimisingFarm(), and Print_FarmVariables().
|
protected |
Vector for storing numbers of animals at a farm in previous years (3).
Definition at line 2150 of file farm.h.
Referenced by ActualProfit(), and OptimisingFarm().
|
protected |
Area assigned to rotational crops. [ha].
Definition at line 2266 of file farm.h.
Referenced by InitiateManagement(), Make_rotational_crops(), and Make_rotations().
|
protected |
Factor used to scale areas of fixed crops and livestock numbers. Used to adjust these values to the farm's area used in ALMaSS crops mode.
Definition at line 2228 of file farm.h.
Referenced by assignFixed(), findFodderDemand(), findTotalArea(), and findTotalNanim().
|
protected |
Variable holding a value of area already reserved for certain crops at a farm. [0-100%].
Definition at line 2242 of file farm.h.
Referenced by assignFixed(), determineAreas(), AnimalFarm::determineAreas(), and sumMinAreas().
|
protected |
Farmer's certainty level.
Definition at line 2112 of file farm.h.
Referenced by ChooseDecisionMode().
|
protected |
Vector of pointers to all crops.
Definition at line 2183 of file farm.h.
Referenced by Check_if_area_100(), OptimisingPigFarm::check_WRape_WBarley(), AnimalFarm::createFodderCrops(), createVariableCrops(), findCropByName(), findCropByName_almass(), findTotalArea(), Get_crop(), Get_cropsSize(), Make_almass_crops_vector(), OptimiseFarm(), optimizeCrops(), Set_Crop(), total(), and Translate_crops_to_almass().
|
protected |
Vector of structs with almass type crops with positive areas in % (result of optimisation).
Definition at line 2200 of file farm.h.
Referenced by Init(), Make_almass_crops_vector(), Make_rotational_crops(), Make_rotations(), and Translate_crops_to_almass().
|
protected |
Vector with counters for each decision mode. 0 - imitation, 1 - social comparison, 2 - repeat, 3 - deliberation.
Definition at line 2114 of file farm.h.
Referenced by ChooseDecisionMode(), Get_decision_mode_counters(), and OptimisingFarm().
|
protected |
Expected aggregated yield at a farm in a given year.
Equal to a number of fields with crops with positive CropOptimised::m_resp values.
Definition at line 2134 of file farm.h.
Referenced by ActualProfit().
|
protected |
Expected costs at a farm in a given year.
Definition at line 2128 of file farm.h.
Referenced by ActualProfit(), and OptimisingFarm().
|
protected |
An expected farm's income at a farm in a given year.
Definition at line 2124 of file farm.h.
Referenced by ActualProfit(), and OptimisingFarm().
|
protected |
An expected farm's profit for a given year.
Definition at line 2120 of file farm.h.
Referenced by ActualProfit(), and OptimisingFarm().
|
protected |
Farm's real ID number.
Definition at line 2216 of file farm.h.
Referenced by Get_farmRealID(), and Initialize().
|
protected |
Scale of the farm - business (size above 10 ha) or private (size below 10 ha).
Definition at line 2214 of file farm.h.
Referenced by Find_neighbour_to_imitate(), Get_farmSize(), Initialize(), and OptimiseFarm().
|
protected |
Farm's type (cattle, pig, plant, other).
Definition at line 2210 of file farm.h.
Referenced by ActualProfit(), OptimisingPigFarm::check_WRape_WBarley(), OptimisingCattleFarm::checkCattleRotation(), OptimisingCattleFarm::checkCattleRotation_almass(), AnimalFarm::checkWinterCrops(), NonAnimalFarm::checkWinterCrops(), AnimalFarm::checkWinterRotation1(), AnimalFarm::correctFodderDemand(), AnimalFarm::createFodderCrops(), createVariableCrops(), AnimalFarm::decreaseCrops(), determineAreas(), AnimalFarm::determineFodderAreas(), AnimalFarm::determineMinFodder(), Find_neighbour_to_imitate(), findGrossMargin(), Get_farmType(), AnimalFarm::increaseCrops(), Initialize(), Make_rotations(), optimizeCrops(), and OptimisingCattleFarm::setCattleCropsAtMin().
|
protected |
Vector of pointers to fixed crops.
Definition at line 2194 of file farm.h.
Referenced by assignFixed(), AnimalFarm::correctFodderDemand(), and createVariableCrops().
|
protected |
Vector of pointers to variable crops that are grown on area larger than areaMin (after determineAreas function was called).
Definition at line 2192 of file farm.h.
Referenced by determineAreas(), AnimalFarm::determineAreas(), AnimalFarm::determineFodderAreas(), and AnimalFarm::determineMinFodder().
|
protected |
Vector of pointers to animals belonging to a farm.
Definition at line 2181 of file farm.h.
Referenced by findFodderDemand(), findTotalNanim(), and Set_Livestock().
|
protected |
Farmer's main goal (determined by a farmer's type) .
Definition at line 2103 of file farm.h.
Referenced by ActualProfit(), ChooseDecisionMode(), findBIs(), findFertilizer(), Get_main_goal(), OptimisingFarm(), Print_FarmVariables(), Prob_multiplier(), and Set_main_goal().
|
protected |
Amount of animal fertilizer available at a farm per hectar. [kg/ha].
Definition at line 2232 of file farm.h.
Referenced by findFertilizer(), findNanim(), and Print_FarmVariables().
|
protected |
Farmer's actual satisfaction level.
Definition at line 2110 of file farm.h.
Referenced by ActualProfit(), and ChooseDecisionMode().
|
protected |
Vector of pointers to the farms considered neighbours (fulfilling the neighbourship condition) of a given farm.
Definition at line 2108 of file farm.h.
Referenced by Find_neighbour_to_imitate(), Get_Neighbour(), Get_NeighboursSize(), and Set_Neighbour().
|
protected |
Vector of aggregated yields from previous years.
Definition at line 2143 of file farm.h.
Referenced by ActualProfit().
|
protected |
Vector of costs from previous years.
Definition at line 2141 of file farm.h.
Referenced by ActualProfit().
|
protected |
Vector of incomes from previous years.
Definition at line 2139 of file farm.h.
Referenced by ActualProfit().
|
protected |
Vector of profits from previous years.
Definition at line 2137 of file farm.h.
Referenced by ActualProfit().
|
protected |
Vector of satisfaction levels in five previous years.
Definition at line 2145 of file farm.h.
Referenced by ActualProfit(), and ChooseDecisionMode().
|
protected |
The neighbouring farmer whose crops might be copied in imitation and social comparison decision modes.
Definition at line 2147 of file farm.h.
Referenced by ChooseDecisionMode(), Find_neighbour_to_imitate(), and OptimisingFarm().
|
protected |
Vector of structs with almass type crops with positive areas in % (result of optimisation): includes only rotational crops.
Definition at line 2202 of file farm.h.
Referenced by ChooseDecisionMode(), Get_rotational_crops(), Make_rotational_crops(), Make_rotations(), Match_crop_to_field(), and Save_last_years_crops().
|
protected |
A copy of m_rotational_crops used when matching crops to fields.
Definition at line 2204 of file farm.h.
Referenced by ChooseDecisionMode(), and Match_crop_to_field().
|
protected |
Stores a copy of m_rotational_crops from a previous year and is accessible to farmers who want to copy this farm's crops (in imitation or social comparison decision mode).
Definition at line 2206 of file farm.h.
Referenced by Find_neighbour_to_imitate(), Get_rotational_crops_visible(), and Save_last_years_crops().
|
protected |
Vector of structs containing pointers to (winter) rotation crops.
Definition at line 2196 of file farm.h.
Referenced by AnimalFarm::checkWinterRotation1(), and NonAnimalFarm::checkWinterRotation1().
|
protected |
Farm's soil subtype. Defined only for cattle farms on sandy soil (0-bad, 1-good, 2-undefined).
Definition at line 2218 of file farm.h.
Referenced by Get_soilSubType(), Initialize(), and OptimisingCattleFarm::preventCashCrops().
|
protected |
Farm's soil type (sandy, clay, other).
Definition at line 2212 of file farm.h.
Referenced by ActualProfit(), Find_neighbour_to_imitate(), findFertilizer(), findResponse(), Get_soilType(), Initialize(), optimizeCrops(), and OptimisingCattleFarm::preventCashCrops().
|
protected |
Total area of a farm. A sum of initial crop areas (if in bedriftsmodel, i.e. original farm optimization model, crops mode) or a sum of farm's fields area (if in ALMaSS crops mode). [ha].
Definition at line 2224 of file farm.h.
Referenced by assignFixed(), OptimisingPigFarm::check_WRape_WBarley(), OptimisingCattleFarm::checkCattleRotation(), OptimisingCattleFarm::checkCattleRotation_almass(), AnimalFarm::checkWinterRotation1(), AnimalFarm::correctFodderDemand(), AnimalFarm::decreaseCrops(), determineAreas_ha(), AnimalFarm::determineFodderAreas(), AnimalFarm::determineMinFodder(), findNanim(), findTotalArea(), AnimalFarm::increaseCrops(), Print_FarmVariables(), and OptimisingCattleFarm::setCattleCropsAtMin().
|
protected |
Total area of a farm as in bedriftsmodel, i.e. original farm optimization model. [ha].
Definition at line 2226 of file farm.h.
Referenced by findTotalArea(), and OptimisingCattleFarm::preventCashCrops().
|
protected |
Total amount of pesticides (sum of m_totalBIHerb and m_totalBIFi) which is planned to be applied at a farm. Expressed as a Treatment frequency index (behandling indeks, BI in Danish).
Definition at line 2252 of file farm.h.
Referenced by OptimiseFarm(), and Print_FarmVariables().
|
protected |
Total amount of fung- and insecticides which is planned to be applied at a farm. Expressed as a Treatment frequency index (behandling indeks, BI in Danish).
Definition at line 2250 of file farm.h.
Referenced by OptimiseFarm(), and Print_FarmVariables().
|
protected |
Total amount of herbicides which is planned to be applied at a farm. Expressed as a Treatment frequency index (behandling indeks, BI in Danish).
Definition at line 2248 of file farm.h.
Referenced by OptimiseFarm(), and Print_FarmVariables().
|
protected |
Planned total costs of growing crops at a farm. [DKK].
Definition at line 2260 of file farm.h.
Referenced by OptimiseFarm(), and Print_FarmVariables().
|
protected |
Farm's total demand for fodder (it is covered by growing fodder crops and/or purchasing fodder and thus, at the end of a year it should not be positive). [fodder units]
Definition at line 2236 of file farm.h.
Referenced by ChooseDecisionMode(), AnimalFarm::correctFodderDemand(), AnimalFarm::determineFodderAreas(), AnimalFarm::determineMinFodder(), findFodderDemand(), NonAnimalFarm::findFodderDemand(), and Print_FarmVariables().
|
protected |
Farm's total demand for fodder. [fodder units]
Definition at line 2234 of file farm.h.
Referenced by ChooseDecisionMode(), findFodderDemand(), and Print_FarmVariables().
|
protected |
Fodder grown, i.e. obtained from growing fodder crops. [fodder units].
Definition at line 2240 of file farm.h.
Referenced by OptimisingPigFarm::check_WRape_WBarley(), OptimisingCattleFarm::checkCattleRotation(), OptimisingCattleFarm::checkCattleRotation_almass(), AnimalFarm::checkWinterRotation1(), ChooseDecisionMode(), AnimalFarm::correctFodderDemand(), AnimalFarm::decreaseCrops(), AnimalFarm::determineFodderAreas(), AnimalFarm::determineMinFodder(), NonAnimalFarm::findFodderDemand(), AnimalFarm::increaseCrops(), Print_FarmVariables(), and OptimisingCattleFarm::setCattleCropsAtMin().
|
protected |
Fodder from trade (has to be purchased). [fodder units].
Definition at line 2238 of file farm.h.
Referenced by OptimisingPigFarm::check_WRape_WBarley(), OptimisingCattleFarm::checkCattleRotation(), OptimisingCattleFarm::checkCattleRotation_almass(), AnimalFarm::checkWinterRotation1(), AnimalFarm::decreaseCrops(), AnimalFarm::determineFodderAreas(), NonAnimalFarm::findFodderDemand(), AnimalFarm::increaseCrops(), OptimiseFarm(), Print_FarmVariables(), and OptimisingCattleFarm::setCattleCropsAtMin().
|
protected |
Total grooming planned at a farm.
Definition at line 2254 of file farm.h.
Referenced by OptimiseFarm(), and Print_FarmVariables().
|
protected |
Total hoeing planned at a farm.
Definition at line 2256 of file farm.h.
Referenced by OptimiseFarm(), and Print_FarmVariables().
|
protected |
Planned total income from growing crops at a farm. [DKK].
Definition at line 2262 of file farm.h.
Referenced by OptimiseFarm(), and Print_FarmVariables().
|
protected |
Total amount of fertilizer used at a farm. [kg].
Definition at line 2244 of file farm.h.
Referenced by OptimiseFarm(), and Print_FarmVariables().
|
protected |
Total animal fertilizer at a farm. A sum of Livestock::m_NanimUsable (from all types of livestock). [kg].
Definition at line 2230 of file farm.h.
Referenced by findNanim(), findTotalNanim(), and Print_FarmVariables().
|
protected |
Total amount of fertilizer purchased at a farm. [kg].
Definition at line 2246 of file farm.h.
Referenced by OptimiseFarm(), and Print_FarmVariables().
|
protected |
Planned total profit (= income - costs) at a farm. In case of animal farms costs of purchased fodder is subtracted from the profit. [DKK].
Definition at line 2264 of file farm.h.
Referenced by OptimiseFarm(), and Print_FarmVariables().
|
protected |
Total manual weeding planned at a farm.
Definition at line 2258 of file farm.h.
Referenced by OptimiseFarm(), and Print_FarmVariables().
|
protected |
Vector of structs containing pointers to crops which are not fixed.
Definition at line 2185 of file farm.h.
Referenced by OptimisingPigFarm::check_WRape_WBarley(), OptimisingCattleFarm::checkCattleRotation(), OptimisingCattleFarm::checkCattleRotation_almass(), AnimalFarm::checkWinterCrops(), NonAnimalFarm::checkWinterCrops(), AnimalFarm::checkWinterRotation1(), NonAnimalFarm::checkWinterRotation1(), AnimalFarm::correctFodderDemand(), createVariableCrops(), determineAreas(), AnimalFarm::determineAreas(), OptimiseFarm(), and sumMinAreas().
|
protected |
Vector of structs containing pointers to crops which are not fixed and: in case of the winter rotation restriction - exclude winter rotation crops, in case of the cattle rotation restriction - exclude the three crops that form the condition of the restriction and winter wheat.
Definition at line 2190 of file farm.h.
Referenced by OptimisingPigFarm::check_WRape_WBarley(), OptimisingCattleFarm::checkCattleRotation(), OptimisingCattleFarm::checkCattleRotation_almass(), AnimalFarm::checkWinterCrops(), NonAnimalFarm::checkWinterCrops(), AnimalFarm::checkWinterRotation1(), and NonAnimalFarm::checkWinterRotation1().
|
protected |
Vector of structs containing pointers to winter crops.
Definition at line 2198 of file farm.h.
Referenced by AnimalFarm::checkWinterCrops(), and NonAnimalFarm::checkWinterCrops().