ALMaSS Hare ODDox  1.1
The hare model description following ODdox protocol
OFirstYearDanger Class Reference

#include <OFirstYearDanger.h>

Public Member Functions

bool Do (Farm *a_farm, LE *a_field, FarmEvent *a_ev)
 
- Public Member Functions inherited from Crop
void ChooseNextCrop (int a_no_dates)
 Chooses the next crop to grow in a field. More...
 
 Crop ()
 
int GetCropClassification ()
 
int GetFirstDate (void)
 
void SetCropClassification (int a_classification)
 
virtual ~Crop ()
 

Additional Inherited Members

- Protected Member Functions inherited from Crop
void SimpleEvent (long a_date, int a_todo, bool a_lock)
 Adds an event to this crop management. More...
 
void SimpleEvent_ (long a_date, int a_todo, bool a_lock, Farm *a_farm, LE *a_field)
 Adds an event to this crop management without relying on member variables. More...
 
- Protected Attributes inherited from Crop
int m_count
 
int m_CropClassification
 
int m_ddegstoharvest
 
FarmEventm_ev
 
Farmm_farm
 
LE * m_field
 
int m_first_date
 
int m_last_date
 

Detailed Description

Definition at line 38 of file OFirstYearDanger.h.

Member Function Documentation

◆ Do()

bool OFirstYearDanger::Do ( Farm a_farm,
LE *  a_field,
FarmEvent a_ev 
)
virtual

Reimplemented from Crop.

Definition at line 32 of file OFirstYearDanger.cpp.

33 {
34  m_farm = a_farm;
35  m_field = a_field;
36  m_ev = a_ev;
37 
38  bool done = false;
39 
40  switch ( m_ev->m_todo )
41  {
42  case ofyd_start:
43  {
44  // ***CJT*** Adjust ending date for this dummy management
45  // plan as needed. FN.
46  int d1 = g_date->OldDays() + g_date->DayInYear( 1,8 );
47  SimpleEvent( d1, ofyd_end, false );
48  }
49  break;
50 
51  case ofyd_end:
52  done = true;
53  break;
54 
55  default:
56  g_msg->Warn( WARN_BUG, "OFirstYearDanger::Do(): "
57  "Unknown event type! ", "" );
58  exit( 1 );
59  }
60 
61  return done;
62 }

References Crop::m_ev, Crop::m_farm, Crop::m_field, FarmEvent::m_todo, ofyd_end, ofyd_start, and Crop::SimpleEvent().


The documentation for this class was generated from the following files:
Crop::SimpleEvent
void SimpleEvent(long a_date, int a_todo, bool a_lock)
Adds an event to this crop management.
Definition: farm.cpp:307
ofyd_end
Definition: OFirstYearDanger.h:35
ofyd_start
Definition: OFirstYearDanger.h:34
Crop::m_farm
Farm * m_farm
Definition: farm.h:537
Crop::m_field
LE * m_field
Definition: farm.h:538
FarmEvent::m_todo
int m_todo
Definition: farm.h:469
Crop::m_ev
FarmEvent * m_ev
Definition: farm.h:539