ALMaSS Skylark ODDox
1.1
The skylark model description following ODdox protocol
|
The Farm Manager class. More...
#include <farm.h>
Classes | |
struct | PesticideData |
Struct used for storing data on pesticide usage throughout the whole simulation (one instance, m_crops_summary_BIs). More... | |
Public Member Functions | |
FarmManager () | |
Farm manager constructor. More... | |
~FarmManager () | |
Farm manager destructor. More... | |
void | FarmManagement () |
Runs the daily farm management for each farm, but also calculates annual spilled grain and maize. More... | |
void | InitiateManagement (void) |
void | AddField (int a_OwnerIndex, LE *a_newland, int a_Owner) |
void | RemoveField (int a_OwnerIndex, LE *a_field) |
int | ConnectFarm (int a_owner) |
TTypesOfVegetation | TranslateCropCodes (std::string &str) |
void | DumpFarmAreas () |
void | DumpFarmrefs () |
dumps the farmrefs file to a standard named file More... | |
void | InitFarms () |
Calls OptimisingFarm::Init for all optimising farms. More... | |
void | Save_diff_farm_types_areas () |
Calculates and saves total areas of all optimising farms and specific farm types. More... | |
int | GetFarmTotalSize (int a_farmref) |
Returns the total farm area from the farm ref num. More... | |
int | GetFarmArableSize (int a_farmref) |
Returns the arable area from the farm ref num. More... | |
TTypesOfFarm | GetFarmType (int a_farmref) |
Returns the farm type from the farm ref num. More... | |
int | GetFarmNoFields (int a_farmref) |
Returns the number of fields owned by a from the farm ref num. More... | |
APoint | GetFarmValidCoords (int a_farmref) |
Returns the number of fields owned by a from the farm ref num. More... | |
int | GetFarmNoOpenFields (int a_farmref, int a_openness) |
Returns the number of fields with openness more than a_openness. More... | |
int | GetFarmAreaOpenFields (int a_farmref, int a_openness) |
Returns the area of fields with openness more than a_openness. More... | |
Farm * | GetFarmPtr (int a_owner) |
Returns the pointer to a farm with a specific number. More... | |
Farm * | GetFarmPtrIndex (int a_index) |
Returns the pointer to a farm with a specific index. More... | |
int | GetRandomFarmRefnum () |
Returns a random farm reference number. More... | |
void | CalcCentroids () |
calculate all farm centroids More... | |
bool | InIllegalList (int a_farm_ref, vector< int > *a_farmlist) |
Checks a list to see if a farm matches the illegal list of references. More... | |
void | AddToIllegalList (int a_farm_ref, vector< int > *a_farmlist) |
Add to a list if a farm is not already among the illegal list of references. More... | |
int | FindClosestFarm (HunterInfo a_hinfo, vector< int > *a_farmlist) |
Finds the closest farm to this co-ordinate. More... | |
int | FindClosestFarmOpenness (HunterInfo a_hinfo, vector< int > *a_farmlist, int a_openness) |
Finds the closest farm to this co-ordinate but uses a probability distribtution for acceptance. More... | |
int | FindClosestFarmOpennessProb (HunterInfo a_hinfo, vector< int > *a_farmlist, int a_openness) |
Finds the closest farm to this co-ordinate with openness more than a value but uses a probability distribtution for acceptance based on closeness. More... | |
int | FindClosestFarmOpennessProbSmallIsBest (HunterInfo a_hinfo, vector< int > *a_farmlist, int a_openness, vector< int > *a_farmsizelist) |
Finds the closest farm to this co-ordinate with openness more than a value but uses a probability distribtution for acceptance based on closeness and another based on farm size. More... | |
int | FindClosestFarmOpennessProbNearRoostIsBest (HunterInfo a_hinfo, vector< int > *a_farmlist, int a_openness, vector< APoint > *a_farmsizelist) |
Finds the closest farm to this co-ordinate with openness more than a value but uses a probability distribtution for acceptance based on closeness and another based on farm size. More... | |
int | FindFarmWithRandom (vector< int > *a_farmlist) |
Finds a farm openness more than a value not on the list. More... | |
int | FindFarmWithOpenness (vector< int > *a_farmlist, int a_openness) |
Finds a farm openness more than a value not on the list. More... | |
int | FindOpennessFarm (int a_openness) |
Finds a random farm with at least one field with openness above a_openness. More... | |
bool | CheckOpenness (int a_openness, int a_ref) |
Check if a farm has at least one field with openness above a_openness. More... | |
APoint | GetFarmCentroid (int a_farmref) |
Gets the farm centroid as an APoint. More... | |
bool | IsDuplicateRef (int a_ref, HunterInfo *a_hinfo) |
Checks if we already have this ref. More... | |
double | GetSpilledGrain () |
Returns the average amount of spilled grain in KJ/m2 this year. More... | |
double | GetSpilledMaize () |
Returns the average amount of spilled maize in KJ/m2 this year. More... | |
void | SetSpilledGrain (bool a_spilledgrain) |
Set m_SpilledGrain which is the flag for either 2013 (true) or 2014 (false) spilled grain distributions. More... | |
void | FindNeighbours () |
Finds all OptimisingFarms' neighbours and saves them in the farm's OptimisingFarm::m_neighbours vector. More... | |
double | GetDD (void) |
Returnes day degrees for the period March 1st - November 1st. Used for determining yields of crops that are not harvested. More... | |
void | SetDD (double a_dd) |
double | Get_cropTotals (int i) |
void | Add_to_cropTotals (int i, double value) |
void | Set_cropTotals (int i, double value) |
int | Get_cropTotals_size () |
void | ActualProfit () |
Calls OptimisingFarm::ActualProfit for all optimising farms. More... | |
void | ChooseDecisionMode_for_farms () |
Calls OptimisingFarm::ChooseDecisionMode for all optimising farms. More... | |
void | Save_last_years_crops_for_farms () |
Calls OptimisingFarm::Save_last_years_crops for all optimising farms. More... | |
void | PrintDecModes_counts () |
For each OptimizingFarm it prints the number of times each of the decision modes was used within a single simulation. See also OptimisingFarm::m_decision_mode_counters. More... | |
void | PrintFinalResults () |
At the end of a simulation it prints results on crop distribution, pesticide and fertilizer usage. More... | |
void | Switch_rotation () |
Switches OptimisingFarms Farm::m_rotation to the list of all possible rotational crops. More... | |
TTypesOfVegetation | Get_crops_summary_BIs_tov (int i) |
void | Set_crops_summary_BIs_herb (int i, double BIherb) |
void | Set_crops_summary_BIs_fi (int i, double BIfi) |
void | Set_crops_summary_BIs (int i, double BI) |
void | Set_cropTotals_sum (int i, double crop_area) |
void | Set_cropTotals_plant_sum (int i, double crop_area) |
void | Set_cropTotals_pig_sum (int i, double crop_area) |
void | Set_cropTotals_cattle_sum (int i, double crop_area) |
void | Set_cropTotals_other_sum (int i, double crop_area) |
void | Set_crops_fertilizer (int i, double fert) |
void | Set_crops_fertilizer_trade (int i, double fert_trade) |
TTypesOfOptFarms | TranslateFarmCodes (string &str) |
TTypesOfSoils | TranslateSoilCodes (string &str) |
TTypesOfFarmSize | TranslateFarmSizeCodes (string &str) |
TTypesOfAnimals | TranslateAnimalsCodes (string &str) |
TTypesOfCrops | TranslateCropsCodes (string &str) |
TTypesOfParameters | TranslateParametersCodes (string &str) |
TTypesOfLivestockParameters | TranslateLivestockParametersCodes (string &str) |
TTypesOfCropVariables | TranslateCropVariablesCodes (string &str) |
int | Get_lookup_table (int index) |
int | GetFarmNoLookup (int a_ref) |
Get a farm reference from the lookup table. More... | |
int | GetFarmTypeLookup (int a_ref) |
Get a farm type from the lookup table. More... | |
bool | GetIsRenumbered () |
Returns the flag for renumbering. More... | |
int | GetRenumberedFarmRef (int a_farmref) |
Returns the farm ref index for a farmref. More... | |
int | GetNoFarms () |
Public Attributes | |
DataForOptimisation * | pm_data |
Pointer to the DataForOptimisation. More... | |
ofstream * | pm_output_file |
Protected Member Functions | |
void | CreateFarms (const char *a_farmfile) |
void | ReadFarmsData () |
Reads farm level parameters and saves them in a vector DataForOptimisation::m_farm_data. More... | |
void | ReadLivestockNumbers () |
Reads the data on livestock numbers and saves them in a vector DataForOptimisation::m_livestockNumbers. More... | |
void | ReadInitialCropAreas () |
Reads the data on farms' initial crop distributions and saves them in a vector DataForOptimisation::m_cropAreas. More... | |
void | ReadFarmsData_perFarmType () |
Reads the data on farms' parameters that vary with a farm type and saves them in a vector of a DataForOptimisation class. More... | |
void | ReadLivestockData () |
Reads the data on livestock parameters (do not vary with farm variables) and saves them in a vector DataForOptimisation::m_livestockParameters. More... | |
void | ReadCropsData () |
Reads the data on crops' parameters that do not vary with farm variables and saves them in a vector DataForOptimisation::m_cropParameters. More... | |
void | ReadCropsData_perSoilType () |
Reads the data on crops' parameters that vary with a soil type (alfa, beta1, beta2, Nnorm) and saves them in vectors of the DataForOptimisation class. More... | |
void | ReadCropsData_perFarmType () |
Reads the data on crops' parameters that vary with a farm type (fixed, fodder, FUKey) and saves them in vectors of the DataForOptimisation class. More... | |
void | ReadCropsData_perFarm_and_Soil () |
Reads the data on crops' parameters that vary with a farm and soil type (sellingPrice) and saves them in a vector DataForOptimisation::m_sellingPrice. More... | |
void | ReadCropsData_perFarm_and_Soil_and_Size () |
Reads the data on crops' parameters that vary with a farm type, soil type and farm size (rotationMax, rotationMin) and saves them in vectors of the DataForOptimisation class. More... | |
void | ReadInitialCropAreas_almass () |
Reads the data on farms' initial crop distributions and saves them in a vector of a DataForOptimisation class. ALMaSS crop mode. More... | |
void | ReadCropsData_almass () |
Reads the data on crops' parameters that do not vary with farm variables and saves them in a vector DataForOptimisation::m_cropParameters. ALMaSS crop mode. More... | |
void | ReadCropsData_perSoilType_almass () |
Reads the data on crops' parameters that vary with a soil type (alfa, beta1, beta2, Nnorm) and saves them in vectors of the DataForOptimisation class. ALMaSS crop mode. More... | |
void | ReadCropsData_perFarmType_almass () |
Reads the data on crops' parameters that vary with a farm type (fixed, fodder, FUKey) and saves them in vectors of the DataForOptimisation class. ALMaSS crop mode. More... | |
void | ReadCropsData_perFarm_and_Soil_almass () |
Reads the data on crops' parameters that vary with a farm and soil type (sellingPrice) and saves them in a vector DataForOptimisation:m_sellingPrice. ALMaSS crop mode. More... | |
void | ReadCropsData_perFarm_and_Soil_and_Size_almass () |
Reads the data on crops' parameters that vary with a farm type, soil type and farm size (rotationMax, rotationMin) and saves them in vectors of the DataForOptimisation class. ALMaSS crop mode. More... | |
void | ReadEnergyMaizePrice () |
void | OptimisationOutput () |
Creates output files for all crop level variables and for landscape level crop distribution. Includes results of the initial farm otpimisation. More... | |
void | PrintOutput (TTypesOfCropVariables a_var, string a_fileName) |
Makes an output file for one crop variable and prints its values for each crop and each OptimisingFarm. Includes results of the initial farm otpimisation. More... | |
void | CropDistribution () |
Calculates total crop areas (at the landscape level). Includes results of the initial farm otpimisation. More... | |
void | Create_Output_file_for_farms () |
Creates an output file. Prints the crop variables in the first row of the file. The file is used then by farms (OptimisingFarm) to print the farm level results of optimisation. Includes results of the initial farm otpimisation. More... | |
void | ReadLookupTable () |
Reads the lookup table with allowed/forbidden crop order from a text file and saves it into a vector m_crop_lookup_table. More... | |
void | PrintNeighbours () |
Creates an output file with a list of neighbours of each OptimisingFarm. More... | |
void | DistributeFarmerTypes () |
Randomly assigns farmer types to farms (OptimisingFarm) in proportions specified in an input file. More... | |
Protected Attributes | |
vector< Farm * > | m_farms |
Population_Manager * | m_population_manager |
double | daydegrees |
Daydegress for period March 1st - November 1st. Used to determine yield of crops that are not harvested (and thus do not have values of biomass at harvest). More... | |
bool | m_SpilledGrain |
Is it 2013 (true) or 2014 (false) as far as grain goes. More... | |
int * | m_farmmapping_lookup |
Used for a dynamic array of lookups converting farm references to internal renumbering. More... | |
bool | m_renumbered |
A flag to show whether renumbering was already done. More... | |
double | totalOptFarmsArea |
double | totalOptFarmsArea_plant |
double | totalOptFarmsArea_pig |
double | totalOptFarmsArea_cattle |
double | totalOptFarmsArea_other |
vector< double > | m_cropTotals |
Stores crops areas at the landscape level per year. More... | |
vector< int > | m_crop_lookup_table |
Specifies which crop order is allowed in a rotation (i.e. if a given crop can follow another crop). More... | |
vector< double > | m_cropTotals_sum |
Stores the sums of crops areas within one simulation at the landscape level. More... | |
vector< double > | m_cropTotals_plant_sum |
Stores the sums of crops areas on plant farms within one simulation at the landscape level. More... | |
vector< double > | m_cropTotals_pig_sum |
Stores the sums of crops areas on pig farms within one simulation at the landscape level. More... | |
vector< double > | m_cropTotals_cattle_sum |
Stores the sums of crops areas on cattle farms within one simulation at the landscape level. More... | |
vector< double > | m_cropTotals_other_sum |
Stores the sums of crops areas on other farms within one simulation at the landscape level. More... | |
vector< PesticideData > | m_crops_summary_BIs |
Stores information on aggregate (all farms)pesticide usage for each crop. More... | |
vector< double > | m_crops_fertilizer |
Stores information on aggregate (all farms) fertilizer usage for each crop. More... | |
vector< double > | m_crops_fertilizer_trade |
Stores information on aggregate (all farms) fertilizer trade (Nt) usage for each crop. More... | |
vector< double > | m_crop_areas_stages |
Stores information on crop areas calculated in different stages of model development: for comparison in sensitivity analysis. More... | |
The Farm Manager class.
FarmManager::FarmManager | ( | ) |
Farm manager constructor.
References cfg_MaizeEnergy(), cfg_OptimiseBedriftsmodelCrops(), cfg_OptimisingFarms(), CreateFarms(), g_farmmanager, DataForOptimisation::Get_cropTypes_almass(), DataForOptimisation::Get_noCrops(), l_map_farmref_file(), l_map_read_farmfile(), m_crop_areas_stages, m_crops_fertilizer, m_crops_fertilizer_trade, m_crops_summary_BIs, m_cropTotals_cattle_sum, m_cropTotals_other_sum, m_cropTotals_pig_sum, m_cropTotals_plant_sum, m_cropTotals_sum, pm_data, ReadCropsData(), ReadCropsData_almass(), ReadCropsData_perFarm_and_Soil(), ReadCropsData_perFarm_and_Soil_almass(), ReadCropsData_perFarm_and_Soil_and_Size(), ReadCropsData_perFarm_and_Soil_and_Size_almass(), ReadCropsData_perFarmType(), ReadCropsData_perFarmType_almass(), ReadCropsData_perSoilType(), ReadCropsData_perSoilType_almass(), ReadEnergyMaizePrice(), ReadFarmsData(), ReadFarmsData_perFarmType(), ReadInitialCropAreas(), ReadInitialCropAreas_almass(), ReadLivestockData(), ReadLivestockNumbers(), and ReadLookupTable().
FarmManager::~FarmManager | ( | ) |
void FarmManager::ActualProfit | ( | ) |
Calls OptimisingFarm::ActualProfit for all optimising farms.
References OptimisingFarm::ActualProfit(), m_farms, and tof_OptimisingFarm.
|
inline |
void FarmManager::AddField | ( | int | a_OwnerIndex, |
LE * | a_newland, | ||
int | a_Owner | ||
) |
void FarmManager::AddToIllegalList | ( | int | a_farm_ref, |
vector< int > * | a_farmlist | ||
) |
Add to a list if a farm is not already among the illegal list of references.
a_farmlist is a pointer to a list of integers with illegal farm ref numbers.
Referenced by FindFarmWithOpenness().
|
inline |
bool FarmManager::CheckOpenness | ( | int | a_openness, |
int | a_ref | ||
) |
void FarmManager::ChooseDecisionMode_for_farms | ( | ) |
Calls OptimisingFarm::ChooseDecisionMode for all optimising farms.
References OptimisingFarm::ChooseDecisionMode(), m_farms, and tof_OptimisingFarm.
int FarmManager::ConnectFarm | ( | int | a_owner | ) |
References m_farms.
|
protected |
Creates an output file. Prints the crop variables in the first row of the file. The file is used then by farms (OptimisingFarm) to print the farm level results of optimisation. Includes results of the initial farm otpimisation.
References pm_output_file.
Referenced by InitFarms().
|
protected |
References cfg_OptimisingFarms(), DistributeFarmerTypes(), DataForOptimisation::Get_farmType(), GetFarmNoLookup(), m_farmmapping_lookup, m_farms, m_renumbered, pm_data, toof_Cattle, toof_Other, toof_Pig, and toof_Plant.
Referenced by FarmManager().
|
protected |
Calculates total crop areas (at the landscape level). Includes results of the initial farm otpimisation.
References cfg_OptimiseBedriftsmodelCrops(), OptimisingFarm::Get_crop(), OptimisingFarm::Get_cropsSize(), DataForOptimisation::Get_noCrops(), CropOptimised::m_area_ha, m_cropTotals, m_farms, pm_data, toc_Foobar, and tof_OptimisingFarm.
Referenced by OptimisationOutput().
|
protected |
Randomly assigns farmer types to farms (OptimisingFarm) in proportions specified in an input file.
References cfg_Environmentalist_proportion(), cfg_Profit_max_proportion(), cfg_Yield_max_proportion(), m_farms, tof_OptimisingFarm, tofg_environment, tofg_profit, and tofg_yield.
Referenced by CreateFarms().
void FarmManager::DumpFarmAreas | ( | ) |
References OptimisingFarm::Get_almass_no(), Farm::GetArea(), and tof_OptimisingFarm.
void FarmManager::DumpFarmrefs | ( | ) |
void FarmManager::FarmManagement | ( | ) |
Runs the daily farm management for each farm, but also calculates annual spilled grain and maize.
References cfg_Animals_number_test_day(), cfg_AnimalsThreshold(), cfg_LifeStage(), g_landscape_p, OptimisingFarm::Get_main_goal(), Farm::GetFarmNumber(), m_farms, OptimisingFarm::Set_animals_no(), Landscape::SupplyDayInYear(), Landscape::SupplyFarmAnimalCensus(), Landscape::SupplyYearNumber(), tof_OptimisingFarm, and tofg_environment.
int FarmManager::FindClosestFarm | ( | HunterInfo | a_hinfo, |
vector< int > * | a_farmlist | ||
) |
Finds the closest farm to this co-ordinate.
Centroid calculation on farms must be called before calling this method for the first time.
a_farmlist is a pointer to a list of integers with illegal farm ref numbers. The first entry lists the number of illegal numbers.
References HunterInfo::homeX, HunterInfo::homeY, InIllegalList(), IsDuplicateRef(), and m_farms.
int FarmManager::FindClosestFarmOpenness | ( | HunterInfo | a_hinfo, |
vector< int > * | a_farmlist, | ||
int | a_openness | ||
) |
Finds the closest farm to this co-ordinate but uses a probability distribtution for acceptance.
Finds the closest farm to this co-ordinate with openness more than a value
References HunterInfo::homeX, HunterInfo::homeY, InIllegalList(), IsDuplicateRef(), and m_farms.
int FarmManager::FindClosestFarmOpennessProb | ( | HunterInfo | a_hinfo, |
vector< int > * | a_farmlist, | ||
int | a_openness | ||
) |
Finds the closest farm to this co-ordinate with openness more than a value but uses a probability distribtution for acceptance based on closeness.
Centroid calculation on farms must be called before calling this method for the first time.
a_farmlist is a pointer to a list of integers with illegal farm ref numbers. The first entry lists the number of illegal numbers. The chance of acceptance is probability based, taking the nearest farm first then testing the next etc.. The probability is based on y = 1*EXP(-x*cfg) with cfg being a fitting parameter in cfg_ClosestFarmProbParam1
We use typedef here to create our own name for APoint - but it is just two unsigned ints. We will use 'x' for the farm num and 'y' for the distance.
We use a vector of AFarmDists to be able to sort it easily
Struct redefining operator < - used for sorting distances from smallest to largest.
References cfg_ClosestFarmProbParam1(), cfg_ClosestFarmProbParam2(), g_rand_uni, HunterInfo::homeX, HunterInfo::homeY, InIllegalList(), IsDuplicateRef(), and m_farms.
int FarmManager::FindClosestFarmOpennessProbNearRoostIsBest | ( | HunterInfo | a_hinfo, |
vector< int > * | a_farmlist, | ||
int | a_openness, | ||
vector< APoint > * | a_farmsizelist | ||
) |
Finds the closest farm to this co-ordinate with openness more than a value but uses a probability distribtution for acceptance based on closeness and another based on farm size.
Centroid calculation on farms must be called before calling this method for the first time.
a_farmlist is a pointer to a list of integers with illegal farm ref numbers. The first entry lists the number of illegal numbers. The chance of acceptance is probability based, taking the nearest farm first then testing the next etc.. The probability is based on y = 1*EXP(-x*cfg) with cfg being a fitting parameter in cfg_ClosestFarmProbParam1
We use typedef here to create our own name for APoint - but it is just two unsigned ints. We will use 'x' for the farm num and 'y' for the distance.
We use a vector of AFarmDists to be able to sort it easily
Struct redefining operator < - used for sorting distances from smallest to largest.
References cfg_ClosestFarmProbParam1(), cfg_ClosestFarmProbParam2(), cfg_RoostDistProbParam1(), g_rand_uni, HunterInfo::homeX, HunterInfo::homeY, InIllegalList(), IsDuplicateRef(), and m_farms.
int FarmManager::FindClosestFarmOpennessProbSmallIsBest | ( | HunterInfo | a_hinfo, |
vector< int > * | a_farmlist, | ||
int | a_openness, | ||
vector< int > * | a_farmsizelist | ||
) |
Finds the closest farm to this co-ordinate with openness more than a value but uses a probability distribtution for acceptance based on closeness and another based on farm size.
Centroid calculation on farms must be called before calling this method for the first time.
a_farmlist is a pointer to a list of integers with illegal farm ref numbers. The first entry lists the number of illegal numbers. The chance of acceptance is probability based, taking the nearest farm first then testing the next etc.. The probability is based on y = 1*EXP(-x*cfg) with cfg being a fitting parameter in cfg_ClosestFarmProbParam1
We use typedef here to create our own name for APoint - but it is just two unsigned ints. We will use 'x' for the farm num and 'y' for the distance.
We use a vector of AFarmDists to be able to sort it easily
Struct redefining operator < - used for sorting distances from smallest to largest.
References cfg_ClosestFarmProbParam1(), cfg_ClosestFarmProbParam2(), cfg_FarmSizeProbParam1(), g_rand_uni, HunterInfo::homeX, HunterInfo::homeY, InIllegalList(), IsDuplicateRef(), and m_farms.
int FarmManager::FindFarmWithOpenness | ( | vector< int > * | a_farmlist, |
int | a_openness | ||
) |
Finds a farm openness more than a value not on the list.
References AddToIllegalList(), InIllegalList(), and m_farms.
int FarmManager::FindFarmWithRandom | ( | vector< int > * | a_farmlist | ) |
Finds a farm openness more than a value not on the list.
References InIllegalList(), and m_farms.
void FarmManager::FindNeighbours | ( | ) |
Finds all OptimisingFarms' neighbours and saves them in the farm's OptimisingFarm::m_neighbours vector.
References Farm::Centroids(), cfg_Neighbor_dist(), OptimisingFarm::Get_almass_no(), OptimisingFarm::GetFarmCentroidX(), OptimisingFarm::GetFarmCentroidY(), m_farms, PrintNeighbours(), OptimisingFarm::Set_Neighbour(), and tof_OptimisingFarm.
int FarmManager::FindOpennessFarm | ( | int | a_openness | ) |
|
inline |
|
inline |
References m_cropTotals.
|
inline |
References m_cropTotals.
|
inline |
References m_crop_lookup_table.
Referenced by OptimisingFarm::Make_rotations(), and OptimisingFarm::Match_crop_to_field().
|
inline |
Returnes day degrees for the period March 1st - November 1st. Used for determining yields of crops that are not harvested.
References daydegrees.
Referenced by OptimisingFarm::ActualProfit().
|
inline |
Returns the arable area from the farm ref num.
References GetFarmPtr().
|
inline |
Returns the area of fields with openness more than a_openness.
References GetFarmPtr().
|
inline |
|
inline |
Returns the number of fields owned by a from the farm ref num.
References GetFarmPtr().
|
inline |
Get a farm reference from the lookup table.
References m_farmmapping_lookup.
Referenced by CreateFarms().
|
inline |
Returns the number of fields with openness more than a_openness.
References GetFarmPtr().
|
inline |
Returns the pointer to a farm with a specific number.
References m_farms.
Referenced by GetFarmArableSize(), GetFarmAreaOpenFields(), GetFarmNoFields(), GetFarmNoOpenFields(), GetFarmTotalSize(), GetFarmType(), GetFarmValidCoords(), and Landscape::SupplyFarmPtr().
|
inline |
|
inline |
Returns the total farm area from the farm ref num.
References GetFarmPtr().
|
inline |
Returns the farm type from the farm ref num.
References GetFarmPtr().
|
inline |
|
inline |
Returns the number of fields owned by a from the farm ref num.
References GetFarmPtr().
|
inline |
|
inline |
References m_farms.
Referenced by Landscape::SupplyNumberOfFarms().
|
inline |
|
inline |
Returns the farm ref index for a farmref.
References m_farmmapping_lookup, and m_farms.
double FarmManager::GetSpilledGrain | ( | ) |
Returns the average amount of spilled grain in KJ/m2 this year.
References cfg_grain_distribution(), g_rand_uni, and m_SpilledGrain.
double FarmManager::GetSpilledMaize | ( | ) |
Returns the average amount of spilled maize in KJ/m2 this year.
References g_rand_uni.
bool FarmManager::InIllegalList | ( | int | a_farm_ref, |
vector< int > * | a_farmlist | ||
) |
Checks a list to see if a farm matches the illegal list of references.
a_farmlist is a pointer to a list of integers with illegal farm ref numbers. The first entry lists the number of illegal numbers.
Referenced by FindClosestFarm(), FindClosestFarmOpenness(), FindClosestFarmOpennessProb(), FindClosestFarmOpennessProbNearRoostIsBest(), FindClosestFarmOpennessProbSmallIsBest(), FindFarmWithOpenness(), and FindFarmWithRandom().
void FarmManager::InitFarms | ( | ) |
Calls OptimisingFarm::Init for all optimising farms.
References cfg_OptimisingFarms(), Create_Output_file_for_farms(), OptimisingFarm::Init(), m_farms, OptimisationOutput(), pm_output_file, and tof_OptimisingFarm.
void FarmManager::InitiateManagement | ( | void | ) |
bool FarmManager::IsDuplicateRef | ( | int | a_ref, |
HunterInfo * | a_hinfo | ||
) |
Checks if we already have this ref.
References HunterInfo::FarmHuntRef.
Referenced by FindClosestFarm(), FindClosestFarmOpenness(), FindClosestFarmOpennessProb(), FindClosestFarmOpennessProbNearRoostIsBest(), and FindClosestFarmOpennessProbSmallIsBest().
|
protected |
Creates output files for all crop level variables and for landscape level crop distribution. Includes results of the initial farm otpimisation.
References cfg_OptimiseBedriftsmodelCrops(), CropDistribution(), DataForOptimisation::Get_cropTypes_almass_str(), DataForOptimisation::Get_cropTypes_str(), DataForOptimisation::Get_noCrops(), m_cropTotals, pm_data, PrintOutput(), toc_Foobar, 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, and tocv_Weeding.
Referenced by InitFarms().
void FarmManager::PrintDecModes_counts | ( | ) |
For each OptimizingFarm it prints the number of times each of the decision modes was used within a single simulation. See also OptimisingFarm::m_decision_mode_counters.
References OptimisingFarm::Get_almass_no(), OptimisingFarm::Get_decision_mode_counters(), m_farms, and tof_OptimisingFarm.
Referenced by PrintFinalResults().
void FarmManager::PrintFinalResults | ( | ) |
At the end of a simulation it prints results on crop distribution, pesticide and fertilizer usage.
References DataForOptimisation::Get_cropTypes_almass_str(), DataForOptimisation::Get_noCrops(), m_crop_areas_stages, m_crops_fertilizer, m_crops_fertilizer_trade, m_crops_summary_BIs, m_cropTotals_cattle_sum, m_cropTotals_other_sum, m_cropTotals_pig_sum, m_cropTotals_plant_sum, m_cropTotals_sum, pm_data, PrintDecModes_counts(), totalOptFarmsArea, totalOptFarmsArea_cattle, totalOptFarmsArea_other, totalOptFarmsArea_pig, and totalOptFarmsArea_plant.
|
protected |
Creates an output file with a list of neighbours of each OptimisingFarm.
References OptimisingFarm::Get_almass_no(), OptimisingFarm::Get_Neighbour(), OptimisingFarm::Get_NeighboursSize(), m_farms, and tof_OptimisingFarm.
Referenced by FindNeighbours().
|
protected |
Makes an output file for one crop variable and prints its values for each crop and each OptimisingFarm. Includes results of the initial farm otpimisation.
References cfg_OptimiseBedriftsmodelCrops(), OptimisingFarm::Get_almass_no(), OptimisingFarm::Get_crop(), OptimisingFarm::Get_cropsSize(), DataForOptimisation::Get_cropTypes_almass_str(), DataForOptimisation::Get_cropTypes_str(), DataForOptimisation::Get_noCrops(), CropOptimised::m_area_ha, CropOptimised::m_areaPercent, CropOptimised::m_BI, CropOptimised::m_BIFi, CropOptimised::m_BIHerb, CropOptimised::m_costs_ha, m_farms, CropOptimised::m_GM, CropOptimised::m_grooming, CropOptimised::m_hoeing, CropOptimised::m_income_ha, CropOptimised::m_n, CropOptimised::m_nt, CropOptimised::m_resp, CropOptimised::m_savings, CropOptimised::m_totalLoss, CropOptimised::m_weeding, pm_data, toc_Foobar, 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, and tof_OptimisingFarm.
Referenced by OptimisationOutput().
|
protected |
Reads the data on crops' parameters that do not vary with farm variables and saves them in a vector DataForOptimisation::m_cropParameters.
References pm_data, DataForOptimisation::Set_cropParameter(), toc_Foobar, and top_Foobar.
Referenced by FarmManager().
|
protected |
Reads the data on crops' parameters that do not vary with farm variables and saves them in a vector DataForOptimisation::m_cropParameters. ALMaSS crop mode.
References DataForOptimisation::Get_cropTypes_almass(), pm_data, DataForOptimisation::Set_cropParameter(), and top_Foobar.
Referenced by FarmManager().
|
protected |
Reads the data on crops' parameters that vary with a farm and soil type (sellingPrice) and saves them in a vector DataForOptimisation::m_sellingPrice.
References pm_data, DataForOptimisation::Set_sellingPrice(), toc_Foobar, toof_Foobar, and tos_Foobar.
Referenced by FarmManager().
|
protected |
Reads the data on crops' parameters that vary with a farm and soil type (sellingPrice) and saves them in a vector DataForOptimisation:m_sellingPrice. ALMaSS crop mode.
References DataForOptimisation::Get_cropTypes_almass(), pm_data, DataForOptimisation::Set_sellingPrice(), toof_Foobar, tos_Foobar, and tov_Undefined.
Referenced by FarmManager().
|
protected |
Reads the data on crops' parameters that vary with a farm type, soil type and farm size (rotationMax, rotationMin) and saves them in vectors of the DataForOptimisation class.
References pm_data, DataForOptimisation::Set_rotationMax(), DataForOptimisation::Set_rotationMin(), toc_Foobar, tofs_Foobar, toof_Foobar, and tos_Foobar.
Referenced by FarmManager().
|
protected |
Reads the data on crops' parameters that vary with a farm type, soil type and farm size (rotationMax, rotationMin) and saves them in vectors of the DataForOptimisation class. ALMaSS crop mode.
References cfg_Areas_Based_on_Distribution(), DataForOptimisation::Get_cropTypes_almass(), pm_data, DataForOptimisation::Set_rotationMax(), DataForOptimisation::Set_rotationMin(), tofs_Foobar, toof_Foobar, tos_Foobar, and tov_Undefined.
Referenced by FarmManager().
|
protected |
Reads the data on crops' parameters that vary with a farm type (fixed, fodder, FUKey) and saves them in vectors of the DataForOptimisation class.
References pm_data, DataForOptimisation::Set_fixed(), DataForOptimisation::Set_fodder(), DataForOptimisation::Set_FUKey(), toc_Foobar, and toof_Foobar.
Referenced by FarmManager().
|
protected |
Reads the data on crops' parameters that vary with a farm type (fixed, fodder, FUKey) and saves them in vectors of the DataForOptimisation class. ALMaSS crop mode.
References DataForOptimisation::Get_cropTypes_almass(), pm_data, DataForOptimisation::Set_fixed(), DataForOptimisation::Set_fodder(), DataForOptimisation::Set_FUKey(), toof_Foobar, and tov_Undefined.
Referenced by FarmManager().
|
protected |
Reads the data on crops' parameters that vary with a soil type (alfa, beta1, beta2, Nnorm) and saves them in vectors of the DataForOptimisation class.
References pm_data, DataForOptimisation::Set_alfa(), DataForOptimisation::Set_beta1(), DataForOptimisation::Set_beta2(), DataForOptimisation::Set_Nnorm(), toc_Foobar, and tos_Foobar.
Referenced by FarmManager().
|
protected |
Reads the data on crops' parameters that vary with a soil type (alfa, beta1, beta2, Nnorm) and saves them in vectors of the DataForOptimisation class. ALMaSS crop mode.
References DataForOptimisation::Get_cropTypes_almass(), pm_data, DataForOptimisation::Set_alfa(), DataForOptimisation::Set_beta1(), DataForOptimisation::Set_beta2(), DataForOptimisation::Set_biomass_factor(), DataForOptimisation::Set_Nnorm(), tos_Foobar, and tov_Undefined.
Referenced by FarmManager().
|
protected |
References l_emaize_price_file(), pm_data, and DataForOptimisation::Set_emaize_price().
Referenced by FarmManager().
|
protected |
Reads farm level parameters and saves them in a vector DataForOptimisation::m_farm_data.
References DataForOptimisation::m_farm_data, DataForOptimisation::FarmData::md_almass_no, DataForOptimisation::FarmData::md_farmRealID, DataForOptimisation::FarmData::md_farmSize, DataForOptimisation::FarmData::md_farmType, DataForOptimisation::FarmData::md_soilSubType, DataForOptimisation::FarmData::md_soilType, pm_data, TranslateFarmCodes(), TranslateFarmSizeCodes(), and TranslateSoilCodes().
Referenced by FarmManager().
|
protected |
Reads the data on farms' parameters that vary with a farm type and saves them in a vector of a DataForOptimisation class.
References pm_data, DataForOptimisation::Set_winterMax(), and toof_Foobar.
Referenced by FarmManager().
|
protected |
Reads the data on farms' initial crop distributions and saves them in a vector DataForOptimisation::m_cropAreas.
References pm_data, DataForOptimisation::Set_cropArea(), DataForOptimisation::Set_cropTypes(), DataForOptimisation::Set_cropTypes_str(), toc_Foobar, and TranslateCropsCodes().
Referenced by FarmManager().
|
protected |
Reads the data on farms' initial crop distributions and saves them in a vector of a DataForOptimisation class. ALMaSS crop mode.
References pm_data, DataForOptimisation::Set_cropArea(), DataForOptimisation::Set_cropTypes_almass(), DataForOptimisation::Set_cropTypes_almass_str(), DataForOptimisation::Set_noCrops(), and TranslateCropCodes().
Referenced by FarmManager().
|
protected |
Reads the data on livestock parameters (do not vary with farm variables) and saves them in a vector DataForOptimisation::m_livestockParameters.
References pm_data, DataForOptimisation::Set_livestockParameter(), toa_Foobar, and tolp_Foobar.
Referenced by FarmManager().
|
protected |
Reads the data on livestock numbers and saves them in a vector DataForOptimisation::m_livestockNumbers.
References pm_data, DataForOptimisation::Set_livestockNumber(), DataForOptimisation::Set_livestockTypes(), toa_Foobar, and TranslateAnimalsCodes().
Referenced by FarmManager().
|
protected |
Reads the lookup table with allowed/forbidden crop order from a text file and saves it into a vector m_crop_lookup_table.
References m_crop_lookup_table, and tov_Undefined.
Referenced by FarmManager().
void FarmManager::RemoveField | ( | int | a_OwnerIndex, |
LE * | a_field | ||
) |
void FarmManager::Save_diff_farm_types_areas | ( | ) |
Calculates and saves total areas of all optimising farms and specific farm types.
References OptimisingFarm::Get_farmType(), Farm::GetAreaDouble(), m_farms, tof_OptimisingFarm, toof_Cattle, toof_Other, toof_Pig, toof_Plant, totalOptFarmsArea, totalOptFarmsArea_cattle, totalOptFarmsArea_other, totalOptFarmsArea_pig, and totalOptFarmsArea_plant.
void FarmManager::Save_last_years_crops_for_farms | ( | ) |
Calls OptimisingFarm::Save_last_years_crops for all optimising farms.
References m_farms, OptimisingFarm::Save_last_years_crops(), and tof_OptimisingFarm.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
References m_cropTotals.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
References daydegrees.
|
inline |
Set m_SpilledGrain which is the flag for either 2013 (true) or 2014 (false) spilled grain distributions.
References m_SpilledGrain.
void FarmManager::Switch_rotation | ( | ) |
Switches OptimisingFarms Farm::m_rotation to the list of all possible rotational crops.
References Farm::Assign_rotation(), DataForOptimisation::Get_cropTypes_almass(), DataForOptimisation::Get_cropTypes_almass_size(), m_farms, pm_data, tof_OptimisingFarm, tov_OrchardCrop, tov_PermanentGrassGrazed, tov_PermanentGrassLowYield, tov_PermanentGrassTussocky, tov_PermanentSetaside, and tov_YoungForest.
TTypesOfAnimals FarmManager::TranslateAnimalsCodes | ( | string & | str | ) |
References toa_DCalf, toa_DCow, toa_Deer, toa_Duck, toa_EHen, toa_Finisher, toa_Goat, toa_Goose, toa_Horse, toa_MCalf, toa_MCattle, toa_MDuck, toa_MHen, toa_Mink, toa_Ostrich, toa_Piglet, toa_Sheep, toa_So, toa_Suckler, and toa_Turkey.
Referenced by ReadLivestockNumbers().
TTypesOfVegetation FarmManager::TranslateCropCodes | ( | std::string & | str | ) |
References tov_AgroChemIndustryCereal, tov_BroadBeans, tov_Carrots, tov_CloverGrassGrazed1, tov_CloverGrassGrazed2, tov_DummyCropPestTesting, tov_FieldPeas, tov_FieldPeasSilage, tov_FieldPeasStrigling, tov_FodderBeet, tov_FodderGrass, tov_Maize, tov_MaizeSilage, tov_MaizeStrigling, tov_NLBeet, tov_NLBeetSpring, tov_NLCabbage, tov_NLCabbageSpring, tov_NLCarrots, tov_NLCarrotsSpring, tov_NLCatchPeaCrop, tov_NLGrassGrazed1, tov_NLGrassGrazed1Spring, tov_NLGrassGrazed2, tov_NLGrassGrazedLast, tov_NLMaize, tov_NLMaizeSpring, tov_NLPermanentGrassGrazed, tov_NLPotatoes, tov_NLPotatoesSpring, tov_NLSpringBarley, tov_NLSpringBarleySpring, tov_NLTulips, tov_NLWinterWheat, tov_NorwegianOats, tov_NorwegianPotatoes, tov_NorwegianSpringBarley, tov_Oats, tov_OBarleyPeaCloverGrass, tov_OCarrots, tov_OCloverGrassGrazed1, tov_OCloverGrassGrazed2, tov_OCloverGrassSilage1, tov_OFieldPeas, tov_OFieldPeasSilage, tov_OFodderBeet, tov_OGrazingPigs, tov_OMaizeSilage, tov_OOats, tov_OPermanentGrassGrazed, tov_OPotatoes, tov_OrchardCrop, tov_OSBarleySilage, tov_OSeedGrass1, tov_OSeedGrass2, tov_OSpringBarley, tov_OSpringBarleyClover, tov_OSpringBarleyExt, tov_OSpringBarleyGrass, tov_OSpringBarleyPigs, tov_OTriticale, tov_OWinterBarley, tov_OWinterBarleyExt, tov_OWinterRape, tov_OWinterRye, tov_OWinterWheat, tov_OWinterWheatUndersown, tov_OWinterWheatUndersownExt, tov_PermanentGrassGrazed, tov_PermanentGrassLowYield, tov_PermanentGrassTussocky, tov_PermanentSetaside, tov_PlantNursery, tov_PLBeans, tov_PLBeet, tov_PLBeetSpr, tov_PLCarrots, tov_PLFodderLucerne1, tov_PLFodderLucerne2, tov_PLMaize, tov_PLMaizeSilage, tov_PLPotatoes, tov_PLSpringBarley, tov_PLSpringBarleySpr, tov_PLSpringWheat, tov_PLWinterBarley, tov_PLWinterRape, tov_PLWinterRye, tov_PLWinterTriticale, tov_PLWinterWheat, tov_PLWinterWheatLate, tov_Potatoes, tov_PotatoesIndustry, tov_SeedGrass1, tov_SeedGrass2, tov_Setaside, tov_SpringBarley, tov_SpringBarleyCloverGrass, tov_SpringBarleyCloverGrassStrigling, tov_SpringBarleyGrass, tov_SpringBarleyPeaCloverGrassStrigling, tov_SpringBarleyPTreatment, tov_SpringBarleySeed, tov_SpringBarleySilage, tov_SpringBarleySpr, tov_SpringBarleyStrigling, tov_SpringBarleyStriglingCulm, tov_SpringBarleyStriglingSingle, tov_SpringRape, tov_SpringWheat, tov_SugarBeet, tov_Triticale, tov_WinterBarley, tov_WinterBarleyStrigling, tov_WinterRape, tov_WinterRapeStrigling, tov_WinterRye, tov_WinterRyeStrigling, tov_WinterWheat, tov_WinterWheatShort, tov_WinterWheatStrigling, tov_WinterWheatStriglingCulm, tov_WinterWheatStriglingSingle, tov_WWheatPControl, tov_WWheatPToxicControl, tov_WWheatPTreatment, and tov_YoungForest.
Referenced by OptimisingFarm::findCropByName_almass(), ReadInitialCropAreas_almass(), Farm::ReadRotation(), and UserDefinedFarm::UserDefinedFarm().
TTypesOfCrops FarmManager::TranslateCropsCodes | ( | string & | str | ) |
References toc_ChrisTree, toc_CloverGrz, toc_EnergyFor, toc_Fruit, toc_FruitTree, toc_GrassClover, toc_GrassEnv1, toc_GrassEnv2, toc_GrassRot, toc_GrassSeed, toc_MaizeSil, toc_Oats, toc_OFodderBeet, toc_OLSeed, toc_OLSeedCut, toc_OOilseed, toc_OSCrops, toc_OSpecCrops, toc_Other, toc_OUncult, toc_Peas, toc_PeasSil, toc_PerGrassLow, toc_PerGrassNorm, toc_Potato, toc_PotatoFood, toc_SBarley, toc_SCerealG, toc_SCerealSil, toc_Setaside, toc_SRape, toc_SugarBeet, toc_Triticale, toc_Uncult, toc_Veg, toc_WBarley, toc_WCerealSil, toc_WRape, toc_WRye, and toc_WWheat.
Referenced by OptimisingFarm::findCropByName(), and ReadInitialCropAreas().
TTypesOfCropVariables FarmManager::TranslateCropVariablesCodes | ( | string & | str | ) |
References 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, and tocv_Weeding.
TTypesOfOptFarms FarmManager::TranslateFarmCodes | ( | string & | str | ) |
References toof_Cattle, toof_Other, toof_Pig, and toof_Plant.
Referenced by ReadFarmsData().
TTypesOfFarmSize FarmManager::TranslateFarmSizeCodes | ( | string & | str | ) |
References tofs_Business, and tofs_Private.
Referenced by ReadFarmsData().
TTypesOfLivestockParameters FarmManager::TranslateLivestockParametersCodes | ( | string & | str | ) |
References tolp_AUKey, tolp_FUuKey, and tolp_Nusable.
Referenced by OptimisingFarm::findFodderDemand(), and OptimisingFarm::findTotalNanim().
TTypesOfParameters FarmManager::TranslateParametersCodes | ( | string & | str | ) |
References top_AlfaFi, top_AlfaG, top_AlfaH, top_AlfaHerb, top_AlfaW, top_BetaFi, top_BetaG, top_BetaH, top_BetaHerb, top_BetaW, top_PriceFi, top_PriceG, top_PriceH, top_PriceHerb, top_PriceLM, top_PriceW, and top_Subsidy.
Referenced by OptimisingFarm::crop_parameter().
TTypesOfSoils FarmManager::TranslateSoilCodes | ( | string & | str | ) |
References tos_Clay, tos_Other, and tos_Sand.
Referenced by ReadFarmsData().
|
protected |
|
protected |
Stores information on crop areas calculated in different stages of model development: for comparison in sensitivity analysis.
Referenced by FarmManager(), and PrintFinalResults().
|
protected |
Specifies which crop order is allowed in a rotation (i.e. if a given crop can follow another crop).
Referenced by Get_lookup_table(), and ReadLookupTable().
|
protected |
Stores information on aggregate (all farms) fertilizer usage for each crop.
Referenced by FarmManager(), PrintFinalResults(), and Set_crops_fertilizer().
|
protected |
Stores information on aggregate (all farms) fertilizer trade (Nt) usage for each crop.
Referenced by FarmManager(), PrintFinalResults(), and Set_crops_fertilizer_trade().
|
protected |
Stores information on aggregate (all farms)pesticide usage for each crop.
Referenced by FarmManager(), Get_crops_summary_BIs_tov(), PrintFinalResults(), Set_crops_summary_BIs(), Set_crops_summary_BIs_fi(), and Set_crops_summary_BIs_herb().
|
protected |
Stores crops areas at the landscape level per year.
Referenced by Add_to_cropTotals(), CropDistribution(), Get_cropTotals(), Get_cropTotals_size(), OptimisationOutput(), and Set_cropTotals().
|
protected |
Stores the sums of crops areas on cattle farms within one simulation at the landscape level.
Referenced by FarmManager(), PrintFinalResults(), and Set_cropTotals_cattle_sum().
|
protected |
Stores the sums of crops areas on other farms within one simulation at the landscape level.
Referenced by FarmManager(), PrintFinalResults(), and Set_cropTotals_other_sum().
|
protected |
Stores the sums of crops areas on pig farms within one simulation at the landscape level.
Referenced by FarmManager(), PrintFinalResults(), and Set_cropTotals_pig_sum().
|
protected |
Stores the sums of crops areas on plant farms within one simulation at the landscape level.
Referenced by FarmManager(), PrintFinalResults(), and Set_cropTotals_plant_sum().
|
protected |
Stores the sums of crops areas within one simulation at the landscape level.
Referenced by FarmManager(), PrintFinalResults(), and Set_cropTotals_sum().
|
protected |
Used for a dynamic array of lookups converting farm references to internal renumbering.
Referenced by CreateFarms(), DumpFarmrefs(), GetFarmNoLookup(), GetFarmTypeLookup(), and GetRenumberedFarmRef().
Referenced by ActualProfit(), AddField(), CalcCentroids(), CheckOpenness(), ChooseDecisionMode_for_farms(), ConnectFarm(), CreateFarms(), CropDistribution(), DistributeFarmerTypes(), DumpFarmrefs(), FarmManagement(), FindClosestFarm(), FindClosestFarmOpenness(), FindClosestFarmOpennessProb(), FindClosestFarmOpennessProbNearRoostIsBest(), FindClosestFarmOpennessProbSmallIsBest(), FindFarmWithOpenness(), FindFarmWithRandom(), FindNeighbours(), FindOpennessFarm(), GetFarmCentroid(), GetFarmPtr(), GetFarmPtrIndex(), GetNoFarms(), GetRandomFarmRefnum(), GetRenumberedFarmRef(), InitFarms(), InitiateManagement(), PrintDecModes_counts(), PrintNeighbours(), PrintOutput(), RemoveField(), Save_diff_farm_types_areas(), Save_last_years_crops_for_farms(), Switch_rotation(), and ~FarmManager().
|
protected |
|
protected |
A flag to show whether renumbering was already done.
Referenced by CreateFarms(), and GetIsRenumbered().
|
protected |
Is it 2013 (true) or 2014 (false) as far as grain goes.
Referenced by GetSpilledGrain(), and SetSpilledGrain().
DataForOptimisation* FarmManager::pm_data |
Pointer to the DataForOptimisation.
Referenced by OptimisingFarm::ActualProfit(), OptimisingPigFarm::check_WRape_WBarley(), OptimisingCattleFarm::checkCattleRotation(), OptimisingCattleFarm::checkCattleRotation_almass(), AnimalFarm::checkWinterCrops(), NonAnimalFarm::checkWinterCrops(), AnimalFarm::checkWinterRotation1(), AnimalFarm::correctFodderDemand(), CreateFarms(), AnimalFarm::createFodderCrops(), OptimisingFarm::createVariableCrops(), OptimisingFarm::crop_parameter(), CropDistribution(), AnimalFarm::decreaseCrops(), OptimisingFarm::determineAreas(), AnimalFarm::determineFodderAreas(), AnimalFarm::determineMinFodder(), FarmManager(), OptimisingFarm::findFertilizer(), OptimisingFarm::findFodderDemand(), OptimisingFarm::findGrossMargin(), OptimisingFarm::findResponse(), OptimisingFarm::findTotalNanim(), AnimalFarm::increaseCrops(), OptimisingFarm::Initialize(), OptimisationOutput(), OptimisingFarm::optimizeCrops(), PrintFinalResults(), PrintOutput(), ReadCropsData(), ReadCropsData_almass(), ReadCropsData_perFarm_and_Soil(), ReadCropsData_perFarm_and_Soil_almass(), ReadCropsData_perFarm_and_Soil_and_Size(), ReadCropsData_perFarm_and_Soil_and_Size_almass(), ReadCropsData_perFarmType(), ReadCropsData_perFarmType_almass(), ReadCropsData_perSoilType(), ReadCropsData_perSoilType_almass(), ReadEnergyMaizePrice(), ReadFarmsData(), ReadFarmsData_perFarmType(), ReadInitialCropAreas(), ReadInitialCropAreas_almass(), ReadLivestockData(), ReadLivestockNumbers(), OptimisingCattleFarm::setCattleCropsAtMin(), Switch_rotation(), and ~FarmManager().
ofstream* FarmManager::pm_output_file |
Referenced by Create_Output_file_for_farms(), and InitFarms().
|
protected |
Referenced by PrintFinalResults(), and Save_diff_farm_types_areas().
|
protected |
Referenced by PrintFinalResults(), and Save_diff_farm_types_areas().
|
protected |
Referenced by PrintFinalResults(), and Save_diff_farm_types_areas().
|
protected |
Referenced by PrintFinalResults(), and Save_diff_farm_types_areas().
|
protected |
Referenced by PrintFinalResults(), and Save_diff_farm_types_areas().