ALMaSS Skylark ODDox
1.1
The skylark model description following ODdox protocol
|
#include <CloverGrassGrazed2.h>
◆ CloverGrassGrazed2()
CloverGrassGrazed2::CloverGrassGrazed2 |
( |
| ) |
|
|
inline |
◆ Do()
bool CloverGrassGrazed2::Do |
( |
Farm * |
a_farm, |
|
|
LE * |
a_field, |
|
|
FarmEvent * |
a_ev |
|
) |
| |
|
virtual |
Reimplemented from Crop.
61 m_field->SetMDates(0,0,g_date->DayInYear(25, 6));
64 m_field->SetMDates(1,0,g_date->DayInYear(25, 6));
65 m_field->SetMDates(0,1,g_date->DayInYear(1,9));
66 m_field->SetMDates(1,1,g_date->DayInYear(1,10));
80 g_msg->Warn( WARN_BUG,
"CloverGrassGrazed2::Do(): "
81 "Harvest too late for the next crop to start!!!",
"" );
85 for (
int i=0; i<noDates; i++) {
100 d1 = g_date->OldDays() + g_date->DayInYear( 1,7 );
101 if (g_date->Date() < d1) {
103 g_msg->Warn( WARN_BUG,
"CloverGrassGrazed2::Do(): "
104 "Crop start attempt between 1st Jan & 1st July",
"" );
110 if (g_date->Date() > d1) {
112 g_msg->Warn( WARN_BUG,
"CloverGrassGrazed2::Do(): "
113 "Crop start attempt after last possible start date",
120 d1 = g_date->OldDays() + g_date->DayInYear( 1, 4 );
138 if (g_date->Date() >= d1) d1 += 365;
159 g_date->DayInYear( 25, 4 ) -
160 g_date->DayInYear())) {
171 g_date->DayInYear( 25, 4 ) -
172 g_date->DayInYear())) {
182 SimpleEvent( g_date->OldDays() + g_date->DayInYear( 1,5 ),
188 SimpleEvent( g_date->OldDays() + g_date->DayInYear( 15, 5 ),
195 if (
m_field->GetMConstants(1)==0) {
197 g_msg->Warn( WARN_BUG,
"CloverGrassGrazed2::Do(): failure in 'CattleOut' execution",
"" );
239 if (g_date->Date() ==
m_field->GetMDates(1, 1)){
240 g_msg->Warn(WARN_BUG,
"CloverGrassGrazed2::Do(): failure in 'CattleIsOut' execution",
"Over-stepped the last possible date");
256 g_date->DayInYear( 25, 6 ) -
257 g_date->DayInYear())) {
273 if (
m_field->GetMConstants(1)==0) {
275 g_msg->Warn( WARN_BUG,
"CloverGrassGrazed2::Do(): failure in 'StubbleHarrowing' execution",
"" );
288 m_field->SetMDates(1,1,g_date->DayInYear()-1);
300 g_date->DayInYear( 30, 5 ) -
301 g_date->DayInYear())) {
308 long newdate1 = g_date->OldDays() + g_date->DayInYear( 1,6 );
309 long newdate2 = g_date->Date() + 7;
310 if ( newdate2 > newdate1 )
324 g_date->DayInYear( 15, 6 ) -
325 g_date->DayInYear())) {
336 g_msg->Warn( WARN_BUG,
"CloverGrassGrazed2::Do(): "
337 "Unknown event type! ",
"" );
References cfg_pest_product_1_amount, cfg_pest_productapplic_period, cfg_pest_productapplic_startdate, cfg_silage_prop, cgg2_cattle_is_out, cgg2_cattle_out, CGG2_CUT_DATE, cgg2_cut_to_silage, CGG2_DO_STUBBLE, cgg2_ferti_one, cgg2_ferti_zero, cgg2_productapplic_one, cgg2_start, CGG2_STOP_CATTLE, cgg2_stubble_harrow, CGG2_WATER_DATE, cgg2_water_one, cgg2_water_zero, g_landscape_p, ppp_1, Landscape::SupplyShouldSpray(), and tof_OptimisingFarm.
The documentation for this class was generated from the following files:
virtual bool FA_Slurry(LE *a_field, double a_user, int a_days)
Spready slurry on a_field owned by an stock farmer.
Definition: farmfuncs.cpp:965
CfgInt cfg_pest_productapplic_startdate
bool m_lock
Definition: farm.h:465
virtual bool ProductApplication(LE *a_field, double a_user, int a_days, double a_applicationrate, PlantProtectionProducts a_ppp)
Apply test pesticide to a_field.
Definition: farmfuncs.cpp:1445
bool SupplyShouldSpray()
Definition: Landscape.h:357
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.
Definition: farmfuncs.cpp:1974
virtual bool CutToSilage(LE *a_field, double a_user, int a_days)
Cut vegetation for silage on a_field.
Definition: farmfuncs.cpp:2329
bool DoIt(double a_probability)
Return chance out of 0 to 100.
Definition: farm.cpp:800
bool m_first_year
Definition: farm.h:467
TTypesOfFarm GetType(void)
Definition: farm.h:901
int m_first_date
Definition: farm.h:540
int m_startday
Definition: farm.h:466
virtual bool FA_NPK(LE *a_field, double a_user, int a_days)
Apply NPK fertilizer to a_field owned by an stock farmer.
Definition: farmfuncs.cpp:917
#define CGG2_DO_STUBBLE
Definition: CloverGrassGrazed2.h:33
void SimpleEvent(long a_date, int a_todo, bool a_lock)
Adds an event to this crop management.
Definition: farm.cpp:307
Landscape * g_landscape_p
Definition: Landscape.cpp:258
Definition: CloverGrassGrazed2.h:46
CfgFloat cfg_pest_product_1_amount
Definition: CloverGrassGrazed2.h:43
Definition: CloverGrassGrazed2.h:47
Definition: CloverGrassGrazed2.h:44
Farm * m_farm
Definition: farm.h:537
LE * m_field
Definition: farm.h:538
int m_todo
Definition: farm.h:469
Definition: CloverGrassGrazed2.h:45
Definition: CloverGrassGrazed2.h:48
virtual bool Water(LE *a_field, double a_user, int a_days)
Carry out a watering on a_field.
Definition: farmfuncs.cpp:1717
int m_last_date
Definition: farm.h:542
CfgInt cfg_pest_productapplic_period
#define CGG2_CUT_DATE
Definition: CloverGrassGrazed2.h:31
Definition: CloverGrassGrazed2.h:40
Definition: CloverGrassGrazed2.h:39
#define CGG2_WATER_DATE
Definition: CloverGrassGrazed2.h:32
#define CGG2_STOP_CATTLE
Definition: CloverGrassGrazed2.h:34
void ChooseNextCrop(int a_no_dates)
Chooses the next crop to grow in a field.
Definition: farm.cpp:318
FarmEvent * m_ev
Definition: farm.h:539
Definition: CloverGrassGrazed2.h:38
virtual bool CattleOut(LE *a_field, double a_user, int a_days)
Start a grazing event on a_field today.
Definition: farmfuncs.cpp:1910
Definition: CloverGrassGrazed2.h:42
virtual bool StubbleHarrowing(LE *a_field, double a_user, int a_days)
Carry out stubble harrowing on a_field.
Definition: farmfuncs.cpp:2209