Gadget
modelvariable.h
Go to the documentation of this file.
1 #ifndef modelvariable_h
2 #define modelvariable_h
3 
4 #include "formulavector.h"
5 #include "areatime.h"
6 #include "doublematrix.h"
7 #include "commentstream.h"
8 #include "timevariable.h"
9 #include "stockvariable.h"
10 
11 enum MVType { MVFORMULA = 1, MVTIME, MVSTOCK };
12 
20 public:
24  ModelVariable();
35  virtual void read(CommentStream& infile, const TimeClass* const TimeInfo, Keeper* const keeper);
40  operator double() const { return value; };
46  void Interchange(ModelVariable& newMV, Keeper* const keeper) const;
51  void setValue(double newValue);
56  void Update(const TimeClass* const TimeInfo);
61  void Delete(Keeper* const keeper) const;
67  int didChange(const TimeClass* const TimeInfo);
72  MVType getMVType() const { return mvtype; };
73 private:
77  MVType mvtype;
81  Formula init;
85  TimeVariable TV;
89  StockVariable SV;
93  double value;
94 };
95 
96 #endif
This is the class used to strip comments (and whitespace) from any input stream.
Definition: commentstream.h:40
This is the class used to calculate the value of the variables used in the model simulation.
Definition: formula.h:18
This is the class used to store information about the variables that are used in model simulation.
Definition: keeper.h:17
This is the base class used to calculate the value of variables used in the model simulation that are...
Definition: modelvariable.h:19
int didChange(const TimeClass *const TimeInfo)
This function will check to see if the ModelVariable value has changed.
Definition: modelvariable.cc:85
~ModelVariable()
This is the default ModelVariable destructor.
Definition: modelvariable.h:28
void Update(const TimeClass *const TimeInfo)
This function will update the ModelVariable value.
Definition: modelvariable.cc:106
MVType getMVType() const
This will return the type of model variable to be used.
Definition: modelvariable.h:72
virtual void read(CommentStream &infile, const TimeClass *const TimeInfo, Keeper *const keeper)
This function will read ModelVariable data from file.
Definition: modelvariable.cc:20
void Interchange(ModelVariable &newMV, Keeper *const keeper) const
This function will swap the ModelVariable value for a new value.
Definition: modelvariable.cc:136
void setValue(double newValue)
This function will update the ModelVariable value.
Definition: modelvariable.cc:12
ModelVariable()
This is the default ModelVariable constructor.
Definition: modelvariable.cc:7
void Delete(Keeper *const keeper) const
This function will delete a ModelVariable value.
Definition: modelvariable.cc:128
This is the class used to calculate the value of the stock-dependent variables used in the model simu...
Definition: stockvariable.h:14
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
MVType
Definition: modelvariable.h:11
@ MVTIME
Definition: modelvariable.h:11
@ MVFORMULA
Definition: modelvariable.h:11
@ MVSTOCK
Definition: modelvariable.h:11