Gadget
timevariable.h
Go to the documentation of this file.
1 #ifndef timevariable_h
2 #define timevariable_h
3 
4 #include "formulavector.h"
5 #include "areatime.h"
6 #include "commentstream.h"
7 
12 class TimeVariable {
13 public:
17  TimeVariable() { value = 0.0; lastvalue = -1.0; };
28  void read(CommentStream& infile, const TimeClass* const TimeInfo, Keeper* const keeper);
33  double getValue() const { return value; };
39  void Interchange(TimeVariable& newTV, Keeper* const keeper) const;
44  void Update(const TimeClass* const TimeInfo);
49  void Delete(Keeper* const keeper) const;
55  int didChange(const TimeClass* const TimeInfo);
56 private:
60  int timeid;
64  int time;
68  IntVector years;
72  IntVector steps;
76  FormulaVector values;
80  double lastvalue;
84  double value;
85 };
86 
87 #endif
This is the class used to strip comments (and whitespace) from any input stream.
Definition: commentstream.h:40
This class implements a dynamic vector of Formula values.
Definition: formulavector.h:10
This class implements a dynamic vector of int values.
Definition: intvector.h:11
This is the class used to store information about the variables that are used in model simulation.
Definition: keeper.h:17
This is the class used to store information about the timesteps used for the current model.
Definition: areatime.h:87
This is the class used to calculate the value of the time-dependent variables used in the model simul...
Definition: timevariable.h:12
void Delete(Keeper *const keeper) const
This function will delete a TimeVariable value.
Definition: timevariable.cc:76
void Update(const TimeClass *const TimeInfo)
This function will update the TimeVariable value.
Definition: timevariable.cc:59
int didChange(const TimeClass *const TimeInfo)
This function will check to see if the TimeVariable value has changed.
Definition: timevariable.cc:52
double getValue() const
This function will return the value of the TimeVariable.
Definition: timevariable.h:33
~TimeVariable()
This is the default TimeVariable destructor.
Definition: timevariable.h:21
void Interchange(TimeVariable &newTV, Keeper *const keeper) const
This function will swap the TimeVariable value for a new value.
Definition: timevariable.cc:82
void read(CommentStream &infile, const TimeClass *const TimeInfo, Keeper *const keeper)
This function will read TimeVariable data from file.
Definition: timevariable.cc:7
TimeVariable()
This is the default TimeVariable constructor.
Definition: timevariable.h:17