ALMaSS Rabbit ODdox
1.00
The rabbit model description following ODdox protocol
|
The base class for all farm types. More...
#include <farm.h>
Public Member Functions | |
virtual void | Management (void) |
Starts the main management loop for the farm and performs some error checking. More... | |
virtual void | InitiateManagement (void) |
Kicks off the farm's management. More... | |
void | AddField (LE *a_newfield) |
Adds a field to a farm. More... | |
void | RemoveField (LE *a_field) |
Removes a field from a farm. More... | |
Farm (FarmManager *a_manager) | |
Farm constructor - creates an instance of each possible crop type. More... | |
virtual | ~Farm (void) |
Farm destructor - deletes all crop instances and empties event queues. More... | |
void | SetFarmNumber (int a_farm_num) |
int | GetFarmNumber (void) |
virtual bool | Spraying_herbicides (TTypesOfVegetation) |
virtual bool | Spraying_fungins (TTypesOfVegetation) |
virtual double | Prob_multiplier () |
void | Assign_rotation (vector< TTypesOfVegetation >a_new_rotation) |
polylist * | ListOpenFields (int a_openness) |
Returns a list of fields with openness above a_openness. More... | |
void | Centroids () |
Finds farm's centroids - x and y. More... | |
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... | |
int | GetAreaOpenFields (int a_openness) |
Returns the area of the fields above an openness of a_openness. More... | |
APoint | GetValidCoords () |
Returns the valid coordinates of the first field owned by a farm. More... | |
int | GetMaxOpenness () |
Returns the maximum openness score of the fields. More... | |
virtual bool | SleepAllDay (LE *a_field, double a_user, int a_days) |
Nothing to to today 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 | AutumnHarrow (LE *a_field, double a_user, int a_days) |
Carry out a harrow 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 | WinterPlough (LE *a_field, double a_user, int a_days) |
Carry out a ploughing event in the winter 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... | |
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 | SpringHarrow (LE *a_field, double a_user, int a_days) |
Carry out a harrow 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 | HerbicideTreat (LE *a_field, double a_user, int a_days) |
Apply herbicide to a_field. More... | |
virtual bool | GrowthRegulator (LE *a_field, double a_user, int a_days) |
Apply growth regulator to a_field. More... | |
virtual bool | FungicideTreat (LE *a_field, double a_user, int a_days) |
Apply fungicide to a_field. More... | |
virtual bool | InsecticideTreat (LE *a_field, double a_user, int a_days) |
Apply insecticide to a_field. More... | |
virtual bool | SynInsecticideTreat (LE *a_field, double a_user, int a_days) |
Apply special insecticide to a_field. More... | |
virtual bool | ProductApplication0 (LE *a_field, double a_user, int a_days) |
Apply test pesticide to a_field. More... | |
virtual bool | ProductApplication1 (LE *a_field, double a_user, int a_days) |
Apply test pesticide to a_field. More... | |
virtual bool | Molluscicide (LE *a_field, double a_user, int a_days) |
Apply molluscidie to a_field. More... | |
virtual bool | RowCultivation (LE *a_field, double a_user, int a_days) |
Carry out a harrowing between crop rows 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 | StriglingSow (LE *a_field, double a_user, int a_days) |
Carry out a mechanical weeding followed by sowing on a_field. More... | |
virtual bool | HillingUp (LE *a_field, double a_user, int a_days) |
Do hilling up on a_field, probably of potatoes. More... | |
virtual bool | Water (LE *a_field, double a_user, int a_days) |
Carry out a watering on a_field. 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 | Harvest (LE *a_field, double a_user, int a_days) |
Carry out a harvest on 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 | 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... | |
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 | 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 | 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 | CutToHay (LE *a_field, double a_user, int a_days) |
Carry out hay cutting 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 | CutToSilage (LE *a_field, double a_user, int a_days) |
Cut vegetation for silage on a_field. 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 | StrawChopping (LE *a_field, double a_user, int a_days) |
Carry out straw chopping 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 | HayBailing (LE *a_field, double a_user, int a_days) |
Carry out hay bailing on a_field. More... | |
virtual bool | BurnStrawStubble (LE *a_field, double a_user, int a_days) |
Burn stubble on a_field. More... | |
virtual bool | StubbleHarrowing (LE *a_field, double a_user, int a_days) |
Carry out stubble harrowing on a_field. 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_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_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_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_Slurry (LE *a_field, double a_user, int a_days) |
Apply slurry 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_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_Sludge (LE *a_field, double a_user, int a_days) |
Spread sewege on a_field owned by an arable 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_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_Slurry (LE *a_field, double a_user, int a_days) |
Spready slurry on a_field owned by an stock farmer. More... | |
virtual bool | FA_AmmoniumSulphate (LE *a_field, double a_user, int a_days) |
Apply ammonium supahte 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_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_Sludge (LE *a_field, double a_user, int a_days) |
Spread sewege sludge on a_field owned by an stock farmer. More... | |
virtual bool | Trial_PesticideTreat (LE *a_field, double a_user, int a_days) |
Special pesticide trial functionality. More... | |
virtual bool | Trial_PesticideTreat_DateLimited (LE *a_field, double, int) |
Special pesticide trial functionality. More... | |
virtual bool | Trial_PesticideTreat_GS (LE *a_field, double a_user, int a_days) |
Special pesticide trial functionality. More... | |
virtual bool | Trial_ToxicControl (LE *a_field, double a_user, int a_days) |
Special pesticide trial functionality. More... | |
virtual bool | Trial_Control (LE *a_field, double a_user, int a_days) |
Special pesticide trial functionality. More... | |
virtual bool | Glyphosate (LE *a_field, double a_user, int a_days) |
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... | |
bool | DoIt (int a_probability) |
Return chance out of 100. More... | |
TTypesOfFarm | GetType (void) |
int | GetArea (void) |
Returns the area of arable fields owned by that farm. More... | |
int | GetTotalArea (void) |
Returns the area of all fields owned by that farm. More... | |
double | GetAreaDouble (void) |
Returns the area of arable fields owned by that farm. More... | |
bool | IsStockFarmer (void) |
virtual void | MakeStockFarmer (void) |
int | GetIntensity (void) |
APoint | GetCentroids () |
TTypesOfVegetation | GetPreviousCrop (int a_index) |
TTypesOfVegetation | GetCrop (int a_index) |
TTypesOfVegetation | GetNextCrop (int a_index) |
void | AddHunter (Hunter *a_hunter) |
bool | RemoveHunter (Hunter *a_hunter) |
Protected Member Functions | |
int | GetFirstDate (TTypesOfVegetation a_tov) |
Gets the start date for a crop type. More... | |
int | GetNextCropStartDate (LE *a_field, TTypesOfVegetation &a_curr_veg) |
Returns the start date of the next crop in the rotation. More... | |
virtual int | GetFirstCropIndex (TTypesOfLandscapeElement a_type) |
Gets the first crop for the farm. More... | |
virtual int | GetNextCropIndex (int a_rot_index) |
Returns the next crop in the rotation. More... | |
virtual void | HandleEvents (void) |
If there are events to carry out do this, and perhaps start a new crop. More... | |
bool | LeSwitch (FarmEvent *ev) |
Call do function for any crop with an outstanding event. Signal if the crop has terminated. More... | |
void | CheckRotationManagementLoop (FarmEvent *ev) |
void | ReadRotation (std::string fname) |
Reads a rotation file into the rotation. More... | |
void | AssignPermanentCrop (TTypesOfVegetation tov, int pct) |
Used to assign a permanent crop to an otherwise rotational field polygon. More... | |
int | InvIntPartition (vector< tpct > *items, int target) |
Finds all possible sums of the integers in the items array. More... | |
Protected Attributes | |
FarmManager * | m_OurManager |
Pointer to the FarmManager. More... | |
LowPriority< FarmEvent * > | m_queue |
vector< LE * > | m_fields |
vector< TTypesOfVegetation > | m_rotation |
vector< PermCropData > | m_PermCrops |
TTypesOfFarm | m_farmtype |
HunterList | m_HuntersList |
A list of hunters allocated to this farm. More... | |
bool | m_stockfarmer |
int | m_farm_num |
int | m_rotation_sync_index |
int | m_intensity |
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... | |
Carrots * | m_carrots |
BroadBeans * | m_broadbeans |
FodderGrass * | m_foddergrass |
CloverGrassGrazed1 * | m_CGG1 |
CloverGrassGrazed2 * | m_CGG2 |
FieldPeas * | m_fieldpeas |
FieldPeasSilage * | m_fieldpeassilage |
Fodderbeet * | m_fodderbeet |
Sugarbeet * | m_sugarbeet |
OFodderbeet * | m_ofodderbeet |
Maize * | m_maize |
MaizeSilage * | m_maizesilage |
OMaizeSilage * | m_omaizesilage |
OBarleyPeaCloverGrass * | m_OBarleyPCG |
OCarrots * | m_ocarrots |
OCloverGrassGrazed1 * | m_OCGG1 |
OCloverGrassGrazed2 * | m_OCGG2 |
OCloverGrassSilage1 * | m_OCGS1 |
OFieldPeas * | m_ofieldpeas |
OFieldPeasSilage * | m_ofieldpeassilage |
OFirstYearDanger * | m_ofirstyeardanger |
OGrazingPigs * | m_ograzingpigs |
OrchardCrop * | m_orchardcrop |
Oats * | m_oats |
OOats * | m_ooats |
OPermanentGrassGrazed * | m_opermgrassgrazed |
OPotatoes * | m_opotatoes |
OSeedGrass1 * | m_oseedgrass1 |
OSeedGrass2 * | m_oseedgrass2 |
OSpringBarley * | m_ospringbarley |
OSpringBarleyExt * | m_ospringbarleyext |
OSpringBarleyPigs * | m_ospringbarleypigs |
OSBarleySilage * | m_osbarleysilage |
OTriticale * | m_otriticale |
OWinterBarley * | m_owinterbarley |
OWinterBarleyExt * | m_owinterbarleyext |
OWinterRape * | m_owinterrape |
OWinterRye * | m_owinterrye |
OWinterWheatUndersown * | m_owinterwheatundersown |
OWinterWheat * | m_owinterwheat |
OWinterWheatUndersownExt * | m_owinterwheatundersownext |
PermanentGrassGrazed * | m_permgrassgrazed |
PermanentGrassLowYield * | m_permgrasslowyield |
PermanentGrassTussocky * | m_permgrasstussocky |
PermanentSetAside * | m_permanentsetaside |
Potatoes * | m_potatoes |
PotatoesIndustry * | m_potatoesindustry |
SeedGrass1 * | m_seedgrass1 |
SeedGrass2 * | m_seedgrass2 |
SetAside * | m_setaside |
SpringBarley * | m_springbarley |
SpringBarleySpr * | m_springbarleyspr |
SpringBarleySKManagement * | m_springbarleyskmanagement |
SpringBarleyPTreatment * | m_springbarleyptreatment |
SpringBarleyCloverGrass * | m_sbarleyclovergrass |
SpringBarleySeed * | m_springbarleyseed |
SpringBarleySilage * | m_springbarleysilage |
SpringRape * | m_springrape |
Triticale * | m_triticale |
WinterBarley * | m_winterbarley |
WinterRape * | m_winterrape |
WinterRye * | m_winterrye |
WinterWheat * | m_winterwheat |
WWheatPControl * | m_wwheatpcontrol |
WWheatPToxicControl * | m_wwheatptoxiccontrol |
WWheatPTreatment * | m_wwheatptreatment |
AgroChemIndustryCereal * | m_agrochemindustrycereal |
WinterWheatStrigling * | m_winterwheatstrigling |
WinterWheatStriglingCulm * | m_winterwheatstriglingculm |
WinterWheatStriglingSingle * | m_winterwheatstriglingsingle |
SpringBarleyCloverGrassStrigling * | m_springbarleyclovergrassstrigling |
SpringBarleyStrigling * | m_springbarleystrigling |
SpringBarleyStriglingCulm * | m_springbarleystriglingculm |
SpringBarleyStriglingSingle * | m_springbarleystriglingsingle |
MaizeStrigling * | m_maizestrigling |
WinterRapeStrigling * | m_winterrapestrigling |
WinterRyeStrigling * | m_winterryestrigling |
WinterBarleyStrigling * | m_winterbarleystrigling |
FieldPeasStrigling * | m_fieldpeasstrigling |
SpringBarleyPeaCloverGrassStrigling * | m_springbarleypeaclovergrassstrigling |
YoungForestCrop * | m_youngforest |
Farm::Farm | ( | FarmManager * | a_manager | ) |
Farm constructor - creates an instance of each possible crop type.
Definition at line 862 of file farm.cpp.
|
virtual |
Farm destructor - deletes all crop instances and empties event queues.
Definition at line 958 of file farm.cpp.
References LowPriPair< ELEMTYPE >::m_element.
void Farm::AddField | ( | LE * | a_newfield | ) |
Adds a field to a farm.
Definition at line 1161 of file farm.cpp.
References LE::GetElementType(), tole_Orchard, tole_PermanentSetaside, tole_PermPasture, tole_PermPastureLowYield, tole_PermPastureTussocky, and tole_YoungForest.
|
inline |
Definition at line 824 of file farm.h.
void Farm::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 | ||
) |
void Farm::Assign_rotation | ( | vector< TTypesOfVegetation > | a_new_rotation | ) |
|
protected |
Used to assign a permanent crop to an otherwise rotational field polygon.
Definition at line 1973 of file farm.cpp.
References CompPcts(), GetArea(), tpct::index, InvIntPartition(), m_fields, tpct::pct, and tov_Undefined.
Referenced by OptimisingFarm::InitiateManagement().
|
virtual |
Carry out a harrow event in the autumn on a_field.
Definition at line 154 of file farmfuncs.cpp.
References autumn_harrow, DO_IT_PROB, g_weather, LE::GetUnsprayedMarginPolyRef(), LE::InsectMortality(), Weather::Raining(), LE::SetLastTreatment(), Landscape::SupplyLEPointer(), LE::Trace(), and LE::ZeroVeg().
|
virtual |
Carry out a ploughing event in the autumn on a_field.
Definition at line 100 of file farmfuncs.cpp.
References autumn_plough, DO_IT_PROB, g_weather, LE::GetUnsprayedMarginPolyRef(), LE::InsectMortality(), Weather::Raining(), LE::SetLastTreatment(), Landscape::SupplyLEPointer(), LE::Trace(), and LE::ZeroVeg().
|
virtual |
Carry out a roll event in the autumn on a_field.
Definition at line 181 of file farmfuncs.cpp.
References autumn_roll, DO_IT_PROB, g_weather, LE::GetUnsprayedMarginPolyRef(), Weather::Raining(), LE::SetLastTreatment(), Landscape::SupplyLEPointer(), LE::Trace(), and LE::ZeroVeg().
|
virtual |
Carry out a sowing event in the autumn on a_field.
Definition at line 204 of file farmfuncs.cpp.
References autumn_sow, DO_IT_PROB, g_weather, LE::GetUnsprayedMarginPolyRef(), LE::GetVegType(), Weather::Raining(), LE::SetGrowthPhase(), LE::SetLastSownVeg(), LE::SetLastTreatment(), sow, Landscape::SupplyLEPointer(), LE::Trace(), and LE::ZeroVeg().
|
virtual |
Burn stubble on a_field.
Definition at line 1864 of file farmfuncs.cpp.
References burn_straw_stubble, Calendar::Date(), DO_IT_PROB, EL_TRAMLINE_DECAYTIME, g_date, g_weather, Weather::GetRainPeriod(), LE::GetUnsprayedMarginPolyRef(), LE::InsectMortality(), LE::ReduceVeg(), LE::SetLastTreatment(), LE::SetTramlinesDecay(), Landscape::SupplyLEPointer(), and LE::Trace().
|
virtual |
Generate a 'cattle_out' event for every day the cattle are on a_field.
This is the main grazing method and as such is called by all grazed field management plans each day the cattle are out.
Definition at line 1602 of file farmfuncs.cpp.
References cattle_out, Calendar::DayInYear(), g_date, LE::GetUnsprayedMarginPolyRef(), LE::GetVegBiomass(), LE::GrazeVegetation(), l_farm_cattle_veg_reduce, LE::SetLastTreatment(), Landscape::SupplyLEPointer(), LE::ToggleCattleGrazing(), LE::Trace(), and CfgFloat::value().
|
virtual |
Generate a 'cattle_out_low' event for every day the cattle are on a_field.
Definition at line 1646 of file farmfuncs.cpp.
References cattle_out_low, Calendar::DayInYear(), g_date, LE::GetUnsprayedMarginPolyRef(), LE::GetVegBiomass(), LE::GrazeVegetation(), l_farm_cattle_veg_reduce2, LE::SetLastTreatment(), Landscape::SupplyLEPointer(), LE::ToggleCattleGrazing(), LE::Trace(), and CfgFloat::value().
|
virtual |
Start a grazing event on a_field today.
This is the main initiate grazing method and as such is called by all grazed field management plans at the moment cattle are put out.
Definition at line 1538 of file farmfuncs.cpp.
References cattle_out, DO_IT_PROB, LE::GetUnsprayedMarginPolyRef(), LE::GrazeVegetation(), l_farm_cattle_veg_reduce, LE::SetLastTreatment(), Landscape::SupplyLEPointer(), LE::ToggleCattleGrazing(), LE::Trace(), and CfgFloat::value().
|
virtual |
Start a extensive grazing event on a_field today.
Definition at line 1572 of file farmfuncs.cpp.
References cattle_out_low, DO_IT_PROB, LE::GetUnsprayedMarginPolyRef(), LE::GrazeVegetation(), l_farm_cattle_veg_reduce2, LE::SetLastTreatment(), Landscape::SupplyLEPointer(), LE::ToggleCattleGrazing(), LE::Trace(), and CfgFloat::value().
void Farm::Centroids | ( | ) |
Finds farm's centroids - x and y.
Calculate a farm's centroid as an average of its fields' centroids.
Definition at line 4857 of file farm.cpp.
References m_farm_centroidx, m_farm_centroidy, and m_fields.
Referenced by FarmManager::FindNeighbours().
|
protected |
Rotation error check function
Definition at line 641 of file farm.cpp.
References Calendar::Date(), g_date, g_msg, LE::GetMgtLoopDetectCount(), LE::GetMgtLoopDetectDate(), FarmEvent::m_field, LE::SetMgtLoopDetectCount(), MapErrorMsg::Warn(), and WARN_BUG.
|
virtual |
Cut vegetation on orchard crop. //based on cut to silage - values from cutting function of orchard.
Definition at line 1988 of file farmfuncs.cpp.
References DO_IT_PROB, g_weather, LE::GetUnsprayedMarginPolyRef(), harvest1, LE::InsectMortality(), mow, Weather::Raining(), LE::ReduceVeg_Extended(), LE::SetGrowthPhase(), LE::SetLastTreatment(), LE::SetMownDecay(), LE::SetVegParameters(), Landscape::SupplyLEPointer(), LE::Trace(), and CfgFloat::value().
|
virtual |
Carry out hay cutting on a_field.
Definition at line 1897 of file farmfuncs.cpp.
References cut_to_hay, Calendar::Date(), DO_IT_PROB, EL_TRAMLINE_DECAYTIME, g_date, g_weather, Weather::GetRainPeriod(), LE::GetUnsprayedMarginPolyRef(), harvest1, LE::InsectMortality(), LE::ReduceVeg_Extended(), LE::SetGrowthPhase(), LE::SetLastTreatment(), LE::SetTramlinesDecay(), LE::SetVegHeight(), Landscape::SupplyLEPointer(), and LE::Trace().
|
virtual |
Cut vegetation for silage on a_field.
Definition at line 1957 of file farmfuncs.cpp.
References cut_to_silage, DO_IT_PROB, EL_TRAMLINE_DECAYTIME, g_weather, LE::GetUnsprayedMarginPolyRef(), LE::InsectMortality(), Weather::Raining(), LE::ReduceVeg_Extended(), LE::ResetDigestability(), LE::SetLastTreatment(), LE::SetTramlinesDecay(), LE::SetVegHeight(), Landscape::SupplyLEPointer(), and LE::Trace().
|
virtual |
Carry out weed topping on a_field.
Definition at line 1931 of file farmfuncs.cpp.
References cut_weeds, DO_IT_PROB, EL_TRAMLINE_DECAYTIME, g_weather, LE::GetUnsprayedMarginPolyRef(), Weather::Raining(), LE::ReduceVeg(), LE::SetLastTreatment(), LE::SetTramlinesDecay(), Landscape::SupplyLEPointer(), and LE::Trace().
|
virtual |
Carry out a deep ploughing event on a_field.
Definition at line 257 of file farmfuncs.cpp.
References deep_ploughing, DO_IT_PROB, g_weather, LE::GetUnsprayedMarginPolyRef(), LE::InsectMortality(), Weather::Raining(), LE::SetLastTreatment(), Landscape::SupplyLEPointer(), LE::Trace(), and LE::ZeroVeg().
bool Farm::DoIt | ( | int | a_probability | ) |
|
virtual |
Apply ammonium supahte to a_field owned by an stock farmer.
Definition at line 684 of file farmfuncs.cpp.
References DO_IT_PROB, EL_TRAMLINE_DECAYTIME, fa_ammoniumsulphate, g_weather, LE::GetUnsprayedMarginPolyRef(), Weather::Raining(), LE::SetLastTreatment(), LE::SetTramlinesDecay(), Landscape::SupplyLEPointer(), and LE::Trace().
|
virtual |
Spread green manure on a_field owned by an stock farmer.
Definition at line 734 of file farmfuncs.cpp.
References DO_IT_PROB, EL_TRAMLINE_DECAYTIME, fa_greenmanure, g_weather, LE::GetUnsprayedMarginPolyRef(), Weather::Raining(), LE::SetLastTreatment(), LE::SetTramlinesDecay(), Landscape::SupplyLEPointer(), and LE::Trace().
|
virtual |
Spread manure on a_field owned by an stock farmer.
Definition at line 708 of file farmfuncs.cpp.
References DO_IT_PROB, EL_TRAMLINE_DECAYTIME, fa_manure, g_weather, Weather::GetTemp(), LE::GetUnsprayedMarginPolyRef(), Weather::Raining(), LE::SetLastTreatment(), LE::SetTramlinesDecay(), Landscape::SupplyLEPointer(), and LE::Trace().
|
virtual |
Apply NPK fertilizer to a_field owned by an stock farmer.
Definition at line 611 of file farmfuncs.cpp.
References DO_IT_PROB, EL_TRAMLINE_DECAYTIME, fa_npk, g_weather, LE::GetUnsprayedMarginPolyRef(), Weather::Raining(), LE::SetLastTreatment(), LE::SetTramlinesDecay(), Landscape::SupplyLEPointer(), and LE::Trace().
|
virtual |
Apply PK fertilizer to a_field owned by an stock farmer.
Definition at line 635 of file farmfuncs.cpp.
References DO_IT_PROB, EL_TRAMLINE_DECAYTIME, fa_pk, g_weather, LE::GetUnsprayedMarginPolyRef(), Weather::Raining(), LE::SetLastTreatment(), LE::SetTramlinesDecay(), Landscape::SupplyLEPointer(), and LE::Trace().
|
virtual |
Spread sewege sludge on a_field owned by an stock farmer.
Definition at line 758 of file farmfuncs.cpp.
References DO_IT_PROB, EL_TRAMLINE_DECAYTIME, fa_sludge, g_weather, Weather::GetTemp(), LE::GetUnsprayedMarginPolyRef(), Weather::Raining(), LE::SetLastTreatment(), LE::SetTramlinesDecay(), Landscape::SupplyLEPointer(), and LE::Trace().
|
virtual |
Spready slurry on a_field owned by an stock farmer.
Definition at line 659 of file farmfuncs.cpp.
References DO_IT_PROB, EL_TRAMLINE_DECAYTIME, fa_slurry, g_weather, Weather::GetTemp(), LE::GetUnsprayedMarginPolyRef(), Weather::Raining(), LE::SetLastTreatment(), LE::SetTramlinesDecay(), Landscape::SupplyLEPointer(), and LE::Trace().
|
virtual |
Spread green manure on a_field owned by an arable farmer.
Definition at line 561 of file farmfuncs.cpp.
References DO_IT_PROB, EL_TRAMLINE_DECAYTIME, fp_greenmanure, g_weather, LE::GetUnsprayedMarginPolyRef(), Weather::Raining(), LE::SetLastTreatment(), LE::SetTramlinesDecay(), Landscape::SupplyLEPointer(), and LE::Trace().
|
virtual |
Apply liquid ammonia fertilizer to a_field owned by an arable farmer.
Definition at line 462 of file farmfuncs.cpp.
References DO_IT_PROB, EL_TRAMLINE_DECAYTIME, fp_liquidNH3, g_weather, LE::GetUnsprayedMarginPolyRef(), Weather::Raining(), LE::SetLastTreatment(), LE::SetTramlinesDecay(), Landscape::SupplyLEPointer(), and LE::Trace().
|
virtual |
Apply Manganse Sulphate to a_field owned by an arable farmer.
Definition at line 512 of file farmfuncs.cpp.
References DO_IT_PROB, EL_TRAMLINE_DECAYTIME, fp_manganesesulphate, g_weather, LE::GetUnsprayedMarginPolyRef(), Weather::Raining(), LE::SetLastTreatment(), LE::SetTramlinesDecay(), Landscape::SupplyLEPointer(), and LE::Trace().
|
virtual |
Spread manure on a_field owned by an arable farmer.
Definition at line 536 of file farmfuncs.cpp.
References DO_IT_PROB, EL_TRAMLINE_DECAYTIME, fp_manure, g_weather, Weather::GetTemp(), LE::GetUnsprayedMarginPolyRef(), Weather::Raining(), LE::SetLastTreatment(), LE::SetTramlinesDecay(), Landscape::SupplyLEPointer(), and LE::Trace().
|
virtual |
Apply NPK fertilizer, on a_field owned by an arable farmer.
Definition at line 414 of file farmfuncs.cpp.
References DO_IT_PROB, EL_TRAMLINE_DECAYTIME, fp_npk, g_weather, LE::GetUnsprayedMarginPolyRef(), Weather::Raining(), LE::SetLastTreatment(), LE::SetTramlinesDecay(), Landscape::SupplyLEPointer(), and LE::Trace().
|
virtual |
Apply NPKS fertilizer, on a_field owned by an arable farmer.
Definition at line 387 of file farmfuncs.cpp.
References DO_IT_PROB, EL_TRAMLINE_DECAYTIME, fp_npks, g_weather, LE::GetUnsprayedMarginPolyRef(), harvest1, LE::InsectMortality(), Weather::Raining(), LE::SetGrowthPhase(), LE::SetLastTreatment(), LE::SetTramlinesDecay(), sleep_all_day, Landscape::SupplyLEPointer(), and LE::Trace().
|
virtual |
Apply PK fertilizer, on a_field owned by an arable farmer.
Definition at line 438 of file farmfuncs.cpp.
References DO_IT_PROB, EL_TRAMLINE_DECAYTIME, fp_pk, g_weather, LE::GetUnsprayedMarginPolyRef(), Weather::Raining(), LE::SetLastTreatment(), LE::SetTramlinesDecay(), Landscape::SupplyLEPointer(), and LE::Trace().
|
virtual |
Spread sewege on a_field owned by an arable farmer.
Definition at line 585 of file farmfuncs.cpp.
References DO_IT_PROB, EL_TRAMLINE_DECAYTIME, fp_sludge, g_weather, Weather::GetTemp(), LE::GetUnsprayedMarginPolyRef(), Weather::Raining(), LE::SetLastTreatment(), LE::SetTramlinesDecay(), Landscape::SupplyLEPointer(), and LE::Trace().
|
virtual |
Apply slurry to a_field owned by an arable farmer.
Definition at line 486 of file farmfuncs.cpp.
References DO_IT_PROB, EL_TRAMLINE_DECAYTIME, fp_slurry, g_weather, Weather::GetTemp(), LE::GetUnsprayedMarginPolyRef(), Weather::Raining(), LE::SetLastTreatment(), LE::SetTramlinesDecay(), Landscape::SupplyLEPointer(), and LE::Trace().
|
virtual |
Apply fungicide to a_field.
Reimplemented in OptimisingFarm.
Definition at line 902 of file farmfuncs.cpp.
References DO_IT_PROB, EL_TRAMLINE_DECAYTIME, fungicide_treat, g_weather, LE::GetSignal(), Weather::GetWind(), LE_SIG_NO_FUNGICIDE, Weather::Raining(), LE::SetLastTreatment(), LE::SetTramlinesDecay(), and LE::Trace().
int Farm::GetArea | ( | void | ) |
Returns the area of arable fields owned by that farm.
Definition at line 1045 of file farm.cpp.
References tole_Field.
Referenced by OptimisingFarm::ActualProfit(), AssignPermanentCrop(), FarmManager::DumpFarmAreas(), and OptimisingFarm::Match_crop_to_field().
double Farm::GetAreaDouble | ( | void | ) |
Returns the area of arable fields owned by that farm.
Definition at line 1064 of file farm.cpp.
References tole_Field.
Referenced by OptimisingFarm::findTotalArea(), and FarmManager::Save_diff_farm_types_areas().
int Farm::GetAreaOpenFields | ( | int | a_openness | ) |
Returns the area of the fields above an openness of a_openness.
Returns the area of fields owned by that farm with an openness above a_openness
Definition at line 1083 of file farm.cpp.
|
inline |
Definition at line 810 of file farm.h.
|
inline |
|
inline |
Definition at line 698 of file farm.h.
Referenced by FarmManager::ConnectFarm(), FarmManager::FarmManagement(), FarmManager::FindFarmWithOpenness(), FarmManager::FindFarmWithRandom(), FarmManager::FindOpennessFarm(), and InvIntPartition().
|
protectedvirtual |
Gets the first crop for the farm.
This method also synchronises farm rotations either within or between farms if needed. This is useful to try simple what if scenarios.
Definition at line 1099 of file farm.cpp.
References g_farm_fixed_rotation_enable, g_farm_fixed_rotation_farms_async, and CfgBool::value().
|
protected |
Gets the start date for a crop type.
Definition at line 1288 of file farm.cpp.
References tov_AgroChemIndustryCereal, tov_BroadBeans, tov_Carrots, tov_CloverGrassGrazed1, tov_CloverGrassGrazed2, tov_FieldPeas, tov_FieldPeasSilage, tov_FodderBeet, tov_FodderGrass, tov_Maize, tov_MaizeSilage, tov_Oats, tov_OBarleyPeaCloverGrass, tov_OCarrots, tov_OCloverGrassGrazed1, tov_OCloverGrassGrazed2, tov_OCloverGrassSilage1, tov_OFieldPeas, tov_OFirstYearDanger, tov_OFodderBeet, tov_OGrazingPigs, tov_OMaizeSilage, tov_OOats, tov_OPermanentGrassGrazed, tov_OPotatoes, tov_OrchardCrop, tov_OSBarleySilage, tov_OSpringBarley, tov_OSpringBarleyExt, 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_Potatoes, tov_SeedGrass1, tov_SeedGrass2, tov_Setaside, tov_SpringBarley, tov_SpringBarleyCloverGrass, tov_SpringBarleyPTreatment, tov_SpringBarleySeed, tov_SpringBarleySilage, tov_SpringBarleySKManagement, tov_SpringBarleySpr, tov_SpringBarleyStrigling, tov_SpringBarleyStriglingCulm, tov_SpringBarleyStriglingSingle, tov_SpringRape, tov_SugarBeet, tov_Triticale, tov_WinterBarley, tov_WinterRape, tov_WinterRye, tov_WinterWheat, tov_WinterWheatStrigling, tov_WinterWheatStriglingCulm, tov_WinterWheatStriglingSingle, tov_WWheatPControl, tov_WWheatPToxicControl, tov_WWheatPTreatment, and tov_YoungForest.
|
inline |
Returns the maximum openness score of the fields.
Definition at line 718 of file farm.h.
Referenced by FarmManager::CheckOpenness(), FarmManager::FindClosestFarmOpenness(), FarmManager::FindClosestFarmOpennessProb(), FarmManager::FindClosestFarmOpennessProbNearRoostIsBest(), FarmManager::FindClosestFarmOpennessProbSmallIsBest(), FarmManager::FindFarmWithOpenness(), and FarmManager::FindOpennessFarm().
|
inline |
|
protectedvirtual |
Returns the next crop in the rotation.
Also provides the possibility of over-riding rotations using configuration settings
Definition at line 1141 of file farm.cpp.
References g_farm_enable_crop_rotation, and CfgBool::value().
|
protected |
Returns the start date of the next crop in the rotation.
Definition at line 666 of file farm.cpp.
References g_farm_fixed_crop_enable, LE::GetRotIndex(), and CfgBool::value().
|
inline |
int Farm::GetNoOpenFields | ( | int | a_openness | ) |
|
inline |
int Farm::GetTotalArea | ( | void | ) |
Returns the area of all fields owned by that farm.
Definition at line 1054 of file farm.cpp.
|
inline |
Definition at line 803 of file farm.h.
Referenced by FarmManager::ActualProfit(), FarmManager::ChooseDecisionMode_for_farms(), FarmManager::CropDistribution(), FarmManager::DistributeFarmerTypes(), FarmManager::FarmManagement(), FarmManager::FindNeighbours(), FarmManager::InitFarms(), FarmManager::PrintDecModes_counts(), FarmManager::PrintNeighbours(), FarmManager::PrintOutput(), FarmManager::Save_diff_farm_types_areas(), FarmManager::Save_last_years_crops_for_farms(), and FarmManager::Switch_rotation().
|
inline |
|
virtual |
Definition at line 2102 of file farmfuncs.cpp.
References glyphosate, LE::InsectMortality(), LE::ReduceVeg_Extended(), LE::SetLastTreatment(), and LE::Trace().
|
virtual |
Apply growth regulator to a_field.
Definition at line 873 of file farmfuncs.cpp.
References DO_IT_PROB, EL_TRAMLINE_DECAYTIME, g_weather, LE::GetSignal(), Weather::GetWind(), growth_regulator, LE_SIG_NO_GROWTH_REG, Weather::Raining(), LE::SetLastTreatment(), LE::SetTramlinesDecay(), and LE::Trace().
|
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 in OptimisingFarm.
Definition at line 684 of file farm.cpp.
References LE::BumpRunNum(), Calendar::Date(), g_date, g_farm_fixed_crop_enable, g_farm_fixed_crop_type, g_letype, LE::GetRotIndex(), LE::GetRunNum(), LE::GetVegType(), LowPriPair< ELEMTYPE >::m_element, FarmEvent::m_field, LowPriPair< ELEMTYPE >::m_pri, PROG_START, LE::ResetTrace(), LE::SetMgtLoopDetectDate(), LE::SetRotIndex(), LE::SetVegStore(), LE::SetVegType(), tov_Undefined, LE_TypeClass::TranslateVegTypes(), CfgInt::value(), and CfgBool::value().
|
virtual |
Carry out a harvest on a_field.
Reimplemented in OptimisingFarm.
Definition at line 1397 of file farmfuncs.cpp.
References Calendar::Date(), DO_IT_PROB, EL_TRAMLINE_DECAYTIME, g_date, g_weather, LE::GetInsectPop(), Weather::GetRainPeriod(), LE::GetUnsprayedMarginPolyRef(), harvest, harvest1, LE::InsectMortality(), LE::RecalculateBugsNStuff(), LE::ResetDigestability(), LE::SetBirdMaize(), LE::SetBirdSeed(), LE::SetGrowthPhase(), LE::SetInsectPop(), LE::SetLastTreatment(), LE::SetTramlinesDecay(), Landscape::SupplyLEPointer(), and LE::Trace().
|
virtual |
Carry out a harvest on a_field.
Definition at line 1449 of file farmfuncs.cpp.
References Calendar::Date(), DO_IT_PROB_LONG, EL_TRAMLINE_DECAYTIME, g_date, g_weather, LE::GetInsectPop(), Weather::GetRainPeriod(), LE::GetUnsprayedMarginPolyRef(), harvest, harvest1, LE::InsectMortality(), LE::RecalculateBugsNStuff(), LE::ResetDigestability(), LE::SetBirdMaize(), LE::SetBirdSeed(), LE::SetGrowthPhase(), LE::SetInsectPop(), LE::SetLastTreatment(), LE::SetTramlinesDecay(), Landscape::SupplyLEPointer(), and LE::Trace().
|
virtual |
Carry out hay bailing on a_field.
Definition at line 1812 of file farmfuncs.cpp.
References Calendar::Date(), DO_IT_PROB, EL_TRAMLINE_DECAYTIME, g_date, g_weather, Weather::GetRainPeriod(), LE::GetUnsprayedMarginPolyRef(), hay_bailing, LE::SetLastTreatment(), LE::SetTramlinesDecay(), Landscape::SupplyLEPointer(), and LE::Trace().
|
virtual |
Carry out hay turning on a_field.
Definition at line 1787 of file farmfuncs.cpp.
References Calendar::Date(), DO_IT_PROB, EL_TRAMLINE_DECAYTIME, g_date, g_weather, Weather::GetRainPeriod(), LE::GetUnsprayedMarginPolyRef(), hay_turning, LE::SetLastTreatment(), LE::SetTramlinesDecay(), Landscape::SupplyLEPointer(), and LE::Trace().
|
virtual |
Apply herbicide to a_field.
Reimplemented in OptimisingFarm.
Definition at line 784 of file farmfuncs.cpp.
References DO_IT_PROB, EL_HERBICIDE_DELAYTIME, EL_TRAMLINE_DECAYTIME, g_weather, LE::GetSignal(), Weather::GetWind(), herbicide_treat, l_farm_herbicide_kills, LE_SIG_NO_HERBICIDE, Weather::Raining(), LE::ReduceWeedBiomass(), LE::SetHerbicideDelay(), LE::SetLastTreatment(), LE::SetTramlinesDecay(), LE::Trace(), and CfgBool::value().
|
virtual |
Do hilling up on a_field, probably of potatoes.
Definition at line 1318 of file farmfuncs.cpp.
References DO_IT_PROB, EL_TRAMLINE_DECAYTIME, g_weather, LE::GetUnsprayedMarginPolyRef(), hilling_up, LE::InsectMortality(), Weather::Raining(), LE::ReduceWeedBiomass(), LE::SetLastTreatment(), LE::SetTramlinesDecay(), Landscape::SupplyLEPointer(), and LE::Trace().
|
virtual |
Kicks off the farm's management.
Reimplemented in OptimisingFarm, and UserDefinedFarm.
Definition at line 1227 of file farm.cpp.
References Calendar::Date(), g_date, g_farm_fixed_crop_enable, g_farm_fixed_crop_type, g_letype, g_msg, janfirst, PROG_START, tole_Orchard, tole_PermanentSetaside, tole_PermPasture, tole_PermPastureLowYield, tole_PermPastureTussocky, tole_YoungForest, tov_OrchardCrop, tov_PermanentGrassGrazed, tov_PermanentGrassLowYield, tov_PermanentGrassTussocky, tov_PermanentSetaside, tov_Undefined, tov_YoungForest, LE_TypeClass::TranslateVegTypes(), CfgInt::value(), CfgBool::value(), and MapErrorMsg::Warn().
Referenced by UserDefinedFarm::InitiateManagement(), and OptimisingFarm::InitiateManagement().
|
virtual |
Apply insecticide to a_field.
Reimplemented in OptimisingFarm.
Definition at line 967 of file farmfuncs.cpp.
References DO_IT_PROB, EL_TRAMLINE_DECAYTIME, g_weather, LE::GetSignal(), Weather::GetWind(), LE::Insecticide(), insecticide_treat, l_farm_insecticide_kills, LE_SIG_NO_INSECTICIDE, Weather::Raining(), LE::SetLastTreatment(), LE::SetTramlinesDecay(), LE::Trace(), and CfgBool::value().
|
protected |
Finds all possible sums of the integers in the items array.
Definition at line 2045 of file farm.cpp.
References g_msg, GetFarmNumber(), and MapErrorMsg::Warn().
Referenced by AssignPermanentCrop().
|
protected |
Call do function for any crop with an outstanding event. Signal if the crop has terminated.
Definition at line 331 of file farm.cpp.
References g_msg, LE::GetRunNum(), FarmEvent::m_event, FarmEvent::m_field, FarmEvent::m_run, FarmEvent::m_todo, LE::m_tried_to_do, tov_AgroChemIndustryCereal, tov_BroadBeans, tov_Carrots, tov_CloverGrassGrazed1, tov_CloverGrassGrazed2, tov_FieldPeas, tov_FieldPeasSilage, tov_FieldPeasStrigling, tov_FodderBeet, tov_FodderGrass, tov_Maize, tov_MaizeSilage, tov_MaizeStrigling, 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_OSpringBarleyExt, 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_Potatoes, tov_PotatoesIndustry, tov_SeedGrass1, tov_SeedGrass2, tov_Setaside, tov_SpringBarley, tov_SpringBarleyCloverGrass, tov_SpringBarleyCloverGrassStrigling, tov_SpringBarleyPeaCloverGrassStrigling, tov_SpringBarleyPTreatment, tov_SpringBarleySeed, tov_SpringBarleySilage, tov_SpringBarleySKManagement, tov_SpringBarleySpr, tov_SpringBarleyStrigling, tov_SpringBarleyStriglingCulm, tov_SpringBarleyStriglingSingle, tov_SpringRape, tov_SugarBeet, tov_Triticale, tov_WinterBarley, tov_WinterBarleyStrigling, tov_WinterRape, tov_WinterRapeStrigling, tov_WinterRye, tov_WinterRyeStrigling, tov_WinterWheat, tov_WinterWheatStrigling, tov_WinterWheatStriglingCulm, tov_WinterWheatStriglingSingle, tov_WWheatPControl, tov_WWheatPToxicControl, tov_WWheatPTreatment, tov_YoungForest, MapErrorMsg::Warn(), and WARN_FILE.
polylist * Farm::ListOpenFields | ( | int | a_openness | ) |
|
inlinevirtual |
Reimplemented in PesticideTrialTreatment, PesticideTrialToxicControl, PesticideTrialControl, OrganicPlant, and ConventionalPlant.
Definition at line 808 of file farm.h.
|
virtual |
Starts the main management loop for the farm and performs some error checking.
Definition at line 306 of file farm.cpp.
References g_msg, MapErrorMsg::Warn(), and WARN_BUG.
|
virtual |
Apply molluscidie to a_field.
Definition at line 1167 of file farmfuncs.cpp.
References DO_IT_PROB, EL_TRAMLINE_DECAYTIME, g_weather, LE::GetSignal(), Weather::GetWind(), LE_SIG_NO_MOLLUSC, molluscicide, Weather::Raining(), LE::SetLastTreatment(), LE::SetTramlinesDecay(), and LE::Trace().
|
virtual |
Start a pig grazing event on a_field today or soon.
Definition at line 1740 of file farmfuncs.cpp.
References LE::GetUnsprayedMarginPolyRef(), Landscape::SupplyLEPointer(), and LE::TogglePigGrazing().
|
virtual |
Start a pig grazing event on a_field today - no exceptions.
Definition at line 1718 of file farmfuncs.cpp.
References LE::GetUnsprayedMarginPolyRef(), l_farm_pig_veg_reduce, pigs_out, LE::ReduceVeg_Extended(), LE::SetLastTreatment(), Landscape::SupplyLEPointer(), LE::Trace(), and CfgFloat::value().
|
virtual |
Generate a 'pigs_out' event for every day the cattle are on a_field.
Definition at line 1690 of file farmfuncs.cpp.
References DO_IT_PROB, LE::GetUnsprayedMarginPolyRef(), l_farm_pig_veg_reduce, pigs_out, LE::ReduceVeg_Extended(), LE::SetLastTreatment(), Landscape::SupplyLEPointer(), LE::TogglePigGrazing(), LE::Trace(), and CfgFloat::value().
|
inlinevirtual |
|
virtual |
Apply test pesticide to a_field.
Definition at line 1099 of file farmfuncs.cpp.
References Pesticide::DailyQueueAdd(), EL_TRAMLINE_DECAYTIME, g_pest, g_weather, Weather::GetWind(), LE::Insecticide(), l_farm_insecticide_kills, product_treat, Weather::Raining(), LE::SetLastTreatment(), LE::SetTramlinesDecay(), LE::Trace(), CfgFloat::value(), and CfgBool::value().
|
virtual |
Apply test pesticide to a_field.
Definition at line 1132 of file farmfuncs.cpp.
References Pesticide::DailyQueueAdd(), EL_TRAMLINE_DECAYTIME, g_pest, g_weather, Weather::GetWind(), LE::Insecticide(), l_farm_insecticide_kills, product_treat, Weather::Raining(), LE::SetLastTreatment(), LE::SetTramlinesDecay(), LE::Trace(), CfgFloat::value(), and CfgBool::value().
|
protected |
Reads a rotation file into the rotation.
Definition at line 618 of file farm.cpp.
References g_msg, FarmManager::TranslateCropCodes(), and MapErrorMsg::Warn().
Referenced by OrganicCattle::OrganicCattle(), OrganicPig::OrganicPig(), OrganicPlant::OrganicPlant(), PesticideTrialTreatment::PesticideTrialTreatment(), UserDefinedFarm1::UserDefinedFarm1(), UserDefinedFarm10::UserDefinedFarm10(), UserDefinedFarm11::UserDefinedFarm11(), UserDefinedFarm12::UserDefinedFarm12(), UserDefinedFarm13::UserDefinedFarm13(), UserDefinedFarm14::UserDefinedFarm14(), UserDefinedFarm15::UserDefinedFarm15(), UserDefinedFarm16::UserDefinedFarm16(), UserDefinedFarm17::UserDefinedFarm17(), UserDefinedFarm2::UserDefinedFarm2(), UserDefinedFarm3::UserDefinedFarm3(), UserDefinedFarm4::UserDefinedFarm4(), UserDefinedFarm5::UserDefinedFarm5(), UserDefinedFarm6::UserDefinedFarm6(), UserDefinedFarm7::UserDefinedFarm7(), UserDefinedFarm8::UserDefinedFarm8(), and UserDefinedFarm9::UserDefinedFarm9().
void Farm::RemoveField | ( | LE * | a_field | ) |
Removes a field from a farm.
Definition at line 1186 of file farm.cpp.
References g_msg, MapErrorMsg::Warn(), and WARN_BUG.
|
inline |
Definition at line 827 of file farm.h.
|
virtual |
Carry out a harrowing between crop rows on a_field.
Definition at line 1194 of file farmfuncs.cpp.
References Calendar::Date(), DO_IT_PROB, EL_TRAMLINE_DECAYTIME, g_date, g_weather, Weather::GetRainPeriod(), LE::GetUnsprayedMarginPolyRef(), LE::InsectMortality(), LE::ReduceWeedBiomass(), row_cultivation, LE::SetLastTreatment(), LE::SetTramlinesDecay(), Landscape::SupplyLEPointer(), and LE::Trace().
|
virtual |
Nothing to to today on a_field.
Definition at line 136 of file farmfuncs.cpp.
References LE::GetUnsprayedMarginPolyRef(), LE::SetLastTreatment(), sleep_all_day, Landscape::SupplyLEPointer(), and LE::Trace().
|
inlinevirtual |
|
inlinevirtual |
|
virtual |
Carry out a harrow event in the spring on a_field.
Definition at line 311 of file farmfuncs.cpp.
References DO_IT_PROB, g_weather, LE::GetUnsprayedMarginPolyRef(), LE::InsectMortality(), Weather::Raining(), LE::SetLastTreatment(), spring_harrow, Landscape::SupplyLEPointer(), LE::Trace(), and LE::ZeroVeg().
|
virtual |
Carry out a ploughing event in the spring on a_field.
Definition at line 284 of file farmfuncs.cpp.
References DO_IT_PROB, g_weather, LE::GetUnsprayedMarginPolyRef(), LE::InsectMortality(), Weather::Raining(), LE::SetLastTreatment(), spring_plough, Landscape::SupplyLEPointer(), LE::Trace(), and LE::ZeroVeg().
|
virtual |
Carry out a roll event in the spring on a_field.
Definition at line 338 of file farmfuncs.cpp.
References DO_IT_PROB, g_weather, LE::GetUnsprayedMarginPolyRef(), Weather::Raining(), LE::SetLastTreatment(), spring_roll, Landscape::SupplyLEPointer(), and LE::Trace().
|
virtual |
Carry out a sowing event in the spring on a_field.
Definition at line 359 of file farmfuncs.cpp.
References DO_IT_PROB, g_weather, LE::GetUnsprayedMarginPolyRef(), LE::GetVegType(), Weather::Raining(), LE::SetGrowthPhase(), LE::SetLastSownVeg(), LE::SetLastTreatment(), sow, spring_sow, Landscape::SupplyLEPointer(), LE::Trace(), and LE::ZeroVeg().
|
virtual |
Carry out straw chopping on a_field.
Definition at line 1760 of file farmfuncs.cpp.
References Calendar::Date(), DO_IT_PROB, EL_TRAMLINE_DECAYTIME, g_date, g_weather, Weather::GetRainPeriod(), LE::GetUnsprayedMarginPolyRef(), LE::InsectMortality(), LE::SetLastTreatment(), LE::SetTramlinesDecay(), straw_chopping, Landscape::SupplyLEPointer(), and LE::Trace().
|
virtual |
Carry out a mechanical weeding on a_field.
Definition at line 1229 of file farmfuncs.cpp.
References Calendar::Date(), DO_IT_PROB, EL_STRIGLING_DELAYTIME, EL_TRAMLINE_DECAYTIME, g_date, g_weather, Weather::GetRainPeriod(), LE::GetUnsprayedMarginPolyRef(), LE::InsectMortality(), LE::ReduceWeedBiomass(), LE::SetHerbicideDelay(), LE::SetLastTreatment(), LE::SetTramlinesDecay(), strigling, Landscape::SupplyLEPointer(), and LE::Trace().
|
virtual |
Carry out a mechanical weeding followed by sowing on a_field.
Definition at line 1281 of file farmfuncs.cpp.
References Calendar::Date(), DO_IT_PROB, EL_STRIGLING_DELAYTIME, EL_TRAMLINE_DECAYTIME, g_date, g_weather, Weather::GetRainPeriod(), LE::GetUnsprayedMarginPolyRef(), LE::InsectMortality(), LE::ReduceWeedBiomass(), LE::SetHerbicideDelay(), LE::SetLastTreatment(), LE::SetTramlinesDecay(), strigling_sow, Landscape::SupplyLEPointer(), and LE::Trace().
|
virtual |
Carry out stubble harrowing on a_field.
Definition at line 1837 of file farmfuncs.cpp.
References Calendar::Date(), DO_IT_PROB, g_date, g_weather, Weather::GetRainPeriod(), LE::GetUnsprayedMarginPolyRef(), LE::InsectMortality(), LE::SetLastTreatment(), stubble_harrowing, Landscape::SupplyLEPointer(), LE::Trace(), and LE::ZeroVeg().
|
virtual |
Cut the crop on a_field and leave it lying (probably rape)
Definition at line 1372 of file farmfuncs.cpp.
References DO_IT_PROB, EL_TRAMLINE_DECAYTIME, g_weather, LE::GetUnsprayedMarginPolyRef(), LE::InsectMortality(), Weather::Raining(), LE::SetLastTreatment(), LE::SetTramlinesDecay(), Landscape::SupplyLEPointer(), swathing, and LE::Trace().
|
virtual |
Apply special insecticide to a_field.
Definition at line 1061 of file farmfuncs.cpp.
References EL_TRAMLINE_DECAYTIME, g_weather, LE::GetSignal(), Weather::GetWind(), LE::Insecticide(), l_farm_insecticide_kills, LE_SIG_NO_SYNG_INSECT, Weather::Raining(), LE::SetLastTreatment(), LE::SetTramlinesDecay(), syninsecticide_treat, LE::Trace(), and CfgBool::value().
|
virtual |
Special pesticide trial functionality.
Definition at line 2093 of file farmfuncs.cpp.
References EL_TRAMLINE_DECAYTIME, LE::SetLastTreatment(), LE::SetTramlinesDecay(), LE::Trace(), and trial_control.
|
virtual |
Special pesticide trial functionality.
Any testing for year or date limitations must be done by calling methods, otherwise use Trial_PesticideTreat_DateLimited()
Definition at line 2044 of file farmfuncs.cpp.
References EL_TRAMLINE_DECAYTIME, LE::InsectMortality(), LE::SetLastTreatment(), LE::SetTramlinesDecay(), LE::Trace(), and trial_insecticidetreat.
|
virtual |
Special pesticide trial functionality.
This methods tests for date limitations
Definition at line 2022 of file farmfuncs.cpp.
References Pesticide::DailyQueueAdd(), EL_TRAMLINE_DECAYTIME, g_pest, LE::InsectMortality(), LE::SetLastTreatment(), LE::SetSprayedToday(), LE::SetTramlinesDecay(), Landscape::SupplyYearNumber(), LE::Trace(), trial_insecticidetreat, CfgInt::value(), and CfgFloat::value().
|
virtual |
Special pesticide trial functionality.
Definition at line 2059 of file farmfuncs.cpp.
References EL_HERBICIDE_DELAYTIME, EL_TRAMLINE_DECAYTIME, LE::GetVegHeight(), LE::ReduceWeedBiomass(), LE::SetHerbicideDelay(), LE::SetLastTreatment(), LE::SetTramlinesDecay(), LE::Trace(), and trial_insecticidetreat.
|
virtual |
Special pesticide trial functionality.
Definition at line 2079 of file farmfuncs.cpp.
References EL_TRAMLINE_DECAYTIME, LE::InsectMortality(), LE::SetLastTreatment(), LE::SetTramlinesDecay(), LE::Trace(), and trial_toxiccontrol.
|
virtual |
Carry out a watering on a_field.
Definition at line 1345 of file farmfuncs.cpp.
References DO_IT_PROB, g_weather, LE::GetUnsprayedMarginPolyRef(), Weather::Raining(), LE::SetLastTreatment(), Landscape::SupplyLEPointer(), LE::Trace(), and water.
|
virtual |
Carry out a ploughing event in the winter on a_field.
Definition at line 232 of file farmfuncs.cpp.
References DO_IT_PROB, g_weather, LE::GetUnsprayedMarginPolyRef(), LE::InsectMortality(), Weather::Raining(), LE::SetLastTreatment(), Landscape::SupplyLEPointer(), LE::Trace(), winter_plough, and LE::ZeroVeg().
|
protected |
|
protected |
Farm's centroid, value x. Equal to the average of the x centroid values of all farm's fields.
Definition at line 861 of file farm.h.
Referenced by Centroids().
|
protected |
Farm's centroid, value y. Equal to the average of the y centroid values of all farm's fields.
Definition at line 863 of file farm.h.
Referenced by Centroids().
|
protected |
Definition at line 842 of file farm.h.
Referenced by AgroChemIndustryCerealFarm1::AgroChemIndustryCerealFarm1(), AgroChemIndustryCerealFarm2::AgroChemIndustryCerealFarm2(), AgroChemIndustryCerealFarm3::AgroChemIndustryCerealFarm3(), ConventionalCattle::ConventionalCattle(), ConventionalPig::ConventionalPig(), ConventionalPlant::ConventionalPlant(), ConvMarginalJord::ConvMarginalJord(), NoPesticideBaseFarm::NoPesticideBaseFarm(), NoPesticideNoPFarm::NoPesticideNoPFarm(), OptimisingFarm::OptimisingFarm(), OrganicCattle::OrganicCattle(), OrganicPig::OrganicPig(), OrganicPlant::OrganicPlant(), PesticideTrialControl::PesticideTrialControl(), PesticideTrialToxicControl::PesticideTrialToxicControl(), PesticideTrialTreatment::PesticideTrialTreatment(), UserDefinedFarm1::UserDefinedFarm1(), UserDefinedFarm10::UserDefinedFarm10(), UserDefinedFarm11::UserDefinedFarm11(), UserDefinedFarm12::UserDefinedFarm12(), UserDefinedFarm13::UserDefinedFarm13(), UserDefinedFarm14::UserDefinedFarm14(), UserDefinedFarm15::UserDefinedFarm15(), UserDefinedFarm16::UserDefinedFarm16(), UserDefinedFarm17::UserDefinedFarm17(), UserDefinedFarm18::UserDefinedFarm18(), UserDefinedFarm19::UserDefinedFarm19(), UserDefinedFarm2::UserDefinedFarm2(), UserDefinedFarm20::UserDefinedFarm20(), UserDefinedFarm21::UserDefinedFarm21(), UserDefinedFarm22::UserDefinedFarm22(), UserDefinedFarm23::UserDefinedFarm23(), UserDefinedFarm24::UserDefinedFarm24(), UserDefinedFarm25::UserDefinedFarm25(), UserDefinedFarm26::UserDefinedFarm26(), UserDefinedFarm27::UserDefinedFarm27(), UserDefinedFarm28::UserDefinedFarm28(), UserDefinedFarm29::UserDefinedFarm29(), UserDefinedFarm3::UserDefinedFarm3(), UserDefinedFarm30::UserDefinedFarm30(), UserDefinedFarm31::UserDefinedFarm31(), UserDefinedFarm32::UserDefinedFarm32(), UserDefinedFarm33::UserDefinedFarm33(), UserDefinedFarm34::UserDefinedFarm34(), UserDefinedFarm35::UserDefinedFarm35(), UserDefinedFarm4::UserDefinedFarm4(), UserDefinedFarm5::UserDefinedFarm5(), UserDefinedFarm6::UserDefinedFarm6(), UserDefinedFarm7::UserDefinedFarm7(), UserDefinedFarm8::UserDefinedFarm8(), and UserDefinedFarm9::UserDefinedFarm9().
|
protected |
Definition at line 839 of file farm.h.
Referenced by OptimisingFarm::ActualProfit(), AssignPermanentCrop(), Centroids(), OptimisingFarm::InitiateManagement(), ListOpenFields(), and OptimisingFarm::Match_crop_to_field().
|
protected |
|
protected |
Pointer to the FarmManager.
Definition at line 837 of file farm.h.
Referenced by OptimisingFarm::ActualProfit(), OptimisingPigFarm::check_WRape_WBarley(), OptimisingCattleFarm::checkCattleRotation(), OptimisingCattleFarm::checkCattleRotation_almass(), AnimalFarm::checkWinterCrops(), NonAnimalFarm::checkWinterCrops(), AnimalFarm::checkWinterRotation1(), AnimalFarm::correctFodderDemand(), AnimalFarm::createFodderCrops(), OptimisingFarm::createVariableCrops(), OptimisingFarm::crop_parameter(), AnimalFarm::decreaseCrops(), OptimisingFarm::determineAreas(), AnimalFarm::determineFodderAreas(), AnimalFarm::determineMinFodder(), OptimisingFarm::findCropByName(), OptimisingFarm::findCropByName_almass(), OptimisingFarm::findFertilizer(), OptimisingFarm::findFodderDemand(), OptimisingFarm::findGrossMargin(), OptimisingFarm::findResponse(), OptimisingFarm::findTotalNanim(), AnimalFarm::increaseCrops(), OptimisingFarm::Initialize(), OptimisingFarm::Make_rotations(), OptimisingFarm::Match_crop_to_field(), OptimisingFarm::OptimisingFarm(), OptimisingFarm::optimizeCrops(), and OptimisingCattleFarm::setCattleCropsAtMin().
|
protected |
|
protected |
|
protected |
Definition at line 841 of file farm.h.
Referenced by OptimisingFarm::Init(), OptimisingFarm::InitiateManagement(), OptimisingFarm::Make_rotations(), and UserDefinedFarm::UserDefinedFarm().
|
protected |
|
protected |
Definition at line 840 of file farm.h.
Referenced by AgroChemIndustryCerealFarm1::AgroChemIndustryCerealFarm1(), AgroChemIndustryCerealFarm2::AgroChemIndustryCerealFarm2(), AgroChemIndustryCerealFarm3::AgroChemIndustryCerealFarm3(), ConventionalCattle::ConventionalCattle(), ConventionalPig::ConventionalPig(), ConventionalPlant::ConventionalPlant(), ConvMarginalJord::ConvMarginalJord(), OptimisingFarm::Init(), OptimisingFarm::Make_rotations(), OptimisingFarm::Match_crop_to_field(), NoPesticideBaseFarm::NoPesticideBaseFarm(), NoPesticideNoPFarm::NoPesticideNoPFarm(), PesticideTrialControl::PesticideTrialControl(), PesticideTrialToxicControl::PesticideTrialToxicControl(), OptimisingFarm::Print_rotations(), and UserDefinedFarm::UserDefinedFarm().
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Definition at line 845 of file farm.h.
Referenced by AgroChemIndustryCerealFarm1::AgroChemIndustryCerealFarm1(), AgroChemIndustryCerealFarm2::AgroChemIndustryCerealFarm2(), AgroChemIndustryCerealFarm3::AgroChemIndustryCerealFarm3(), ConventionalCattle::ConventionalCattle(), ConventionalPig::ConventionalPig(), ConventionalPlant::ConventionalPlant(), ConvMarginalJord::ConvMarginalJord(), OptimisingFarm::Make_rotations(), NoPesticideBaseFarm::NoPesticideBaseFarm(), NoPesticideNoPFarm::NoPesticideNoPFarm(), OrganicCattle::OrganicCattle(), OrganicPig::OrganicPig(), OrganicPlant::OrganicPlant(), PesticideTrialControl::PesticideTrialControl(), PesticideTrialToxicControl::PesticideTrialToxicControl(), PesticideTrialTreatment::PesticideTrialTreatment(), UserDefinedFarm::UserDefinedFarm(), UserDefinedFarm1::UserDefinedFarm1(), UserDefinedFarm10::UserDefinedFarm10(), UserDefinedFarm11::UserDefinedFarm11(), UserDefinedFarm12::UserDefinedFarm12(), UserDefinedFarm13::UserDefinedFarm13(), UserDefinedFarm14::UserDefinedFarm14(), UserDefinedFarm15::UserDefinedFarm15(), UserDefinedFarm16::UserDefinedFarm16(), UserDefinedFarm17::UserDefinedFarm17(), UserDefinedFarm2::UserDefinedFarm2(), UserDefinedFarm3::UserDefinedFarm3(), UserDefinedFarm4::UserDefinedFarm4(), UserDefinedFarm5::UserDefinedFarm5(), UserDefinedFarm6::UserDefinedFarm6(), UserDefinedFarm7::UserDefinedFarm7(), UserDefinedFarm8::UserDefinedFarm8(), and UserDefinedFarm9::UserDefinedFarm9().
|
protected |
|
protected |
|
protected |