Log In | Get Help   
Home My Page Projects Code Snippets Project Openings Mareframe
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files
[mareframe] Annotation of /trunk/gadget/modelvariable.h
[mareframe] / trunk / gadget / modelvariable.h Repository:
ViewVC logotype

Annotation of /trunk/gadget/modelvariable.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1 - (view) (download)

1 : agomez 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 :    
13 :     /**
14 :     * \class ModelVariable
15 :     * \brief This is the base class used to calculate the value of variables used in the model simulation that are based on other values within the model. This can be used to calculate values that can change due to time (using the TimeVariable class) or values that are based on stock population (using the StockVariable class).
16 :     *
17 :     * \note This will always be overridden by the derived classes that actually calculate the model values
18 :     */
19 :     class ModelVariable {
20 :     public:
21 :     /**
22 :     * \brief This is the default ModelVariable constructor
23 :     */
24 :     ModelVariable();
25 :     /**
26 :     * \brief This is the default ModelVariable destructor
27 :     */
28 :     ~ModelVariable() {};
29 :     /**
30 :     * \brief This function will read ModelVariable data from file
31 :     * \param infile is the CommentStream to read the data from
32 :     * \param TimeInfo is the TimeClass for the current model
33 :     * \param keeper is the Keeper for the current model
34 :     */
35 :     virtual void read(CommentStream& infile, const TimeClass* const TimeInfo, Keeper* const keeper);
36 :     /**
37 :     * \brief This operator will return the value of the ModelVariable
38 :     * \return the value of the ModelVariable
39 :     */
40 :     operator double() const { return value; };
41 :     /**
42 :     * \brief This function will swap the ModelVariable value for a new value
43 :     * \param newMV is the new ModelVariable value
44 :     * \param keeper is the Keeper for the current model
45 :     */
46 :     void Interchange(ModelVariable& newMV, Keeper* const keeper) const;
47 :     /**
48 :     * \brief This function will update the ModelVariable value
49 :     * \param newValue is the new value of the ModelVariable value
50 :     */
51 :     void setValue(double newValue);
52 :     /**
53 :     * \brief This function will update the ModelVariable value
54 :     * \param TimeInfo is the TimeClass for the current model
55 :     */
56 :     void Update(const TimeClass* const TimeInfo);
57 :     /**
58 :     * \brief This function will delete a ModelVariable value
59 :     * \param keeper is the Keeper for the current model
60 :     */
61 :     void Delete(Keeper* const keeper) const;
62 :     /**
63 :     * \brief This function will check to see if the ModelVariable value has changed
64 :     * \param TimeInfo is the TimeClass for the current model
65 :     * \return 1 if the values have changed, 0 otherwise
66 :     */
67 :     int didChange(const TimeClass* const TimeInfo);
68 :     /**
69 :     * \brief This will return the type of model variable to be used
70 :     * \return sitype
71 :     */
72 :     MVType getMVType() const { return mvtype; };
73 :     private:
74 :     /**
75 :     * \brief This denotes what type of model variable is to be used
76 :     */
77 :     MVType mvtype;
78 :     /**
79 :     * \brief This is the Formula of the value of the ModelVariable
80 :     */
81 :     Formula init;
82 :     /**
83 :     * \brief This is the TimeVariable of the values of the ModelVariable
84 :     */
85 :     TimeVariable TV;
86 :     /**
87 :     * \brief This is the StockVariable of the values of the ModelVariable
88 :     */
89 :     StockVariable SV;
90 :     /**
91 :     * \brief This is the value of the ModelVariable
92 :     */
93 :     double value;
94 :     };
95 :    
96 :     #endif

root@forge.cesga.es
ViewVC Help
Powered by ViewVC 1.0.0  

Powered By FusionForge