#include <ClimateChange.h>
Public Member Functions | |
clClimateChange (clSimManager *p_oSimManager) | |
Constructor. | |
void | GetData (xercesc::DOMDocument *p_oDoc) |
Destructor - not needed. | |
void | Action () |
Updates the plot temperature or precipitation according to the function above. | |
void | SetNameData (char *cNameString) |
Captures the namestring passed to this behavior. | |
Protected Attributes | |
float | m_fTimeElapsed |
Time, in years, elapsed since the beginning of the run. | |
float | m_fTimestepLength |
Length of timestep, in years. | |
float | m_fB |
B parameter. | |
float | m_fC |
C parameter. | |
float | m_fStartingValue |
Starting value, either temperature or precipitation. | |
float | m_fMin |
Lower bound. | |
float | m_fMax |
Upper bound. | |
bool | m_bIsTemp |
Whether this is for temperature (True) or precipitation (False). |
This changes plot temperature or precipitation over time. There can be two versions of this behavior, one doing temperature and one doing precipitation, in the same run.
Temperature or precipitation at time t is: P = P1 + b * t^c where P1 is the starting value, c and b are parameters, and t is time elapsed, in years, since the beginning of the run.
The user can set upper and lower bounds on the climate variable.
This class's namestring is "climate change". The parameter file call string for the temperature version is "Temperature climate change". For precipitation, it's "Precipitation climate change".
Copyright 2010 Charles D. Canham.
clClimateChange::clClimateChange | ( | clSimManager * | p_oSimManager | ) |
Constructor.
p_oSimManager | Sim Manager object. |
void clClimateChange::GetData | ( | xercesc::DOMDocument * | p_oDoc | ) | [virtual] |
Destructor - not needed.
Reads in values from the parameter file.
p_oDoc | DOM tree of parsed input file. |
Implements clWorkerBase.
void clClimateChange::Action | ( | ) | [virtual] |
Updates the plot temperature or precipitation according to the function above.
Reimplemented from clBehaviorBase.
void clClimateChange::SetNameData | ( | char * | cNameString | ) | [virtual] |
Captures the namestring passed to this behavior.
This is overridden from clBehaviorBase so we can capture the namestring passed. Since this class can create multiple kinds of behaviors that function differently, this will capture what kind of behavior this is supposed to be.
cNameString | Behavior's namestring. |
Reimplemented from clBehaviorBase.
float clClimateChange::m_fTimeElapsed [protected] |
Time, in years, elapsed since the beginning of the run.
float clClimateChange::m_fTimestepLength [protected] |
Length of timestep, in years.
float clClimateChange::m_fB [protected] |
B parameter.
float clClimateChange::m_fC [protected] |
C parameter.
float clClimateChange::m_fStartingValue [protected] |
Starting value, either temperature or precipitation.
float clClimateChange::m_fMin [protected] |
Lower bound.
float clClimateChange::m_fMax [protected] |
Upper bound.
bool clClimateChange::m_bIsTemp [protected] |
Whether this is for temperature (True) or precipitation (False).