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/actionattimes.h
[mareframe] / trunk / gadget / actionattimes.h Repository:
ViewVC logotype

Annotation of /trunk/gadget/actionattimes.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1 - (view) (download)

1 : agomez 1 #ifndef actionattimes_h
2 :     #define actionattimes_h
3 :    
4 :     #include "commentstream.h"
5 :     #include "areatime.h"
6 :     #include "intvector.h"
7 :    
8 :     /**
9 :     * \class ActionAtTimes
10 :     * \brief This is the class used to associate actions with specific timesteps within the model
11 :     *
12 :     * This class is used to determine whether an action should take place on the current timestep in the model. The actions include changing the population of the stock (either by fishing from the stock or adding to the stock) calculating the score from a likelihood component or printing output from the model. This is done by storing a list of timesteps when the action takes place, and comparing it to the current timestep in the model.
13 :     */
14 :     class ActionAtTimes {
15 :     public:
16 :     /**
17 :     * \brief This is the ActionAtTimes constructor
18 :     */
19 :     ActionAtTimes() { everyStep = 0; };
20 :     /**
21 :     * \brief This is the ActionAtTimes destructor
22 :     */
23 :     ~ActionAtTimes() {};
24 :     /**
25 :     * \brief This is the function used to read in the action at times parameters
26 :     * \param infile is the CommentStream to read the actionattimes parameters from
27 :     * \param TimeInfo is the TimeClass for the current model
28 :     * \return 1 if the read from file was successful, 0 otherwise
29 :     */
30 :     int readFromFile(CommentStream& infile, const TimeClass* const TimeInfo);
31 :     /**
32 :     * \brief This is the function used to add the action for a set of steps and years
33 :     * \param steps is the IntVector of all the steps that have the action taking place
34 :     * \param years is the IntVector of all the years that have the action taking place
35 :     * \param TimeInfo is the TimeClass for the current model
36 :     */
37 :     void addActions(const IntVector& years, const IntVector& steps, const TimeClass* const TimeInfo);
38 :     /**
39 :     * \brief This is the function used to add the action on all years for a set of steps
40 :     * \param steps is the IntVector of all the steps that have the action taking place
41 :     * \param TimeInfo is the TimeClass for the current model
42 :     */
43 :     void addActionsAllYears(const IntVector& steps, const TimeClass* const TimeInfo);
44 :     /**
45 :     * \brief This is the function used to add the action on all steps for a set of years
46 :     * \param years is the IntVector of all the years that have the action taking place
47 :     * \param TimeInfo is the TimeClass for the current model
48 :     */
49 :     void addActionsAllSteps(const IntVector& years, const TimeClass* const TimeInfo);
50 :     /**
51 :     * \brief This is the function used to check whether an action takes place on the current timestep
52 :     * \param TimeInfo is the TimeClass for the current model
53 :     * \return 1 if action takes place, 0 otherwise
54 :     */
55 :     int atCurrentTime(const TimeClass* const TimeInfo) const;
56 :     protected:
57 :     /**
58 :     * \brief This is the flag if the action takes place on every timestep
59 :     */
60 :     int everyStep;
61 :     /**
62 :     * \brief This is the IntVector of the timesteps on which the action takes place
63 :     */
64 :     IntVector TimeSteps;
65 :     /**
66 :     * \brief This is the IntVector of the years on which the action takes place
67 :     */
68 :     IntVector Years;
69 :     /**
70 :     * \brief This is the IntVector of the steps on which the action takes place
71 :     */
72 :     IntVector Steps;
73 :     };
74 :    
75 :     #endif

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

Powered By FusionForge