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

Annotation of /trunk/gadget/fleet.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1 - (view) (download)

1 : agomez 1 #ifndef fleet_h
2 :     #define fleet_h
3 :    
4 :     #include "base.h"
5 :     #include "formulamatrix.h"
6 :     #include "lengthpredator.h"
7 :     #include "keeper.h"
8 :    
9 :     enum FleetType { TOTALFLEET = 1, LINEARFLEET, NUMBERFLEET, EFFORTFLEET, QUOTAFLEET };
10 :    
11 :     /**
12 :     * \class Fleet
13 :     * \brief This is the class used to model the predation that is due to the action of a fleet in the Gadget model
14 :     *
15 :     * This class calculates the catch of the fleets that are to be modelled within the simulation. The fleets are treated as (non-dynamic) predators that ''eat'' the stock that is defined as the prey of the fleet. The amount of the stock that is eaten is calculated by the predator that is associated with the fleet. There are 5 types of fleet, each with a different predator class to calculate the level of predation. A fleet that has been declared as a TOTALFLEET uses the TotalPredator class to calculate the predation, a LINEARFLEET uses the LinearPredator class to calculate the predation, a NUMBERFLEET uses the NumberPredator class to calculate the predation by number, a EFFORTFLEET uses the EffortPredator class to calculate the predation based on effort data and a QUOTAFLEET uses the QuotaPredator class to calculate the fishing quota based on the biomass of stock available, and then uses this calculated fishing level to calculate the predation of the stock.
16 :     */
17 :     class Fleet : public BaseClass {
18 :     public:
19 :     /**
20 :     * \brief This is the Fleet constructor
21 :     * \param infile is the CommentStream to read the fleet parameters from
22 :     * \param givenname is the name of the fleet
23 :     * \param Area is the AreaClass for the current model
24 :     * \param TimeInfo is the TimeClass for the current model
25 :     * \param keeper is the Keeper for the current model
26 :     * \param ftype is the FleetType of the fleet
27 :     */
28 :     Fleet(CommentStream& infile, const char* givenname, const AreaClass* const Area,
29 :     const TimeClass* const TimeInfo, Keeper* const keeper, FleetType ftype);
30 :     /**
31 :     * \brief This is the default Fleet destructor
32 :     */
33 :     virtual ~Fleet();
34 :     /**
35 :     * \brief This function will print the model population
36 :     * \param outfile is the ofstream that all the model information gets sent to
37 :     */
38 :     void Print(ofstream& outfile) const;
39 :     /**
40 :     * \brief This function will calculate the modelled consumption for an area in the model
41 :     * \param area is an integer to denote the internal area of interest
42 :     * \param Area is the AreaClass for the current model
43 :     * \param TimeInfo is the TimeClass for the current model
44 :     */
45 :     virtual void calcEat(int area, const AreaClass* const Area, const TimeClass* const TimeInfo);
46 :     /**
47 :     * \brief This function will check the modelled consumption for an area in the model
48 :     * \param area is an integer to denote the internal area of interest
49 :     * \param TimeInfo is the TimeClass for the current model
50 :     */
51 :     virtual void checkEat(int area, const TimeClass* const TimeInfo) {};
52 :     /**
53 :     * \brief This function will adjust the modelled consumption for an area in the model
54 :     * \param area is an integer to denote the internal area of interest
55 :     * \param TimeInfo is the TimeClass for the current model
56 :     */
57 :     virtual void adjustEat(int area, const TimeClass* const TimeInfo);
58 :     /**
59 :     * \brief This function will reduce the model population for an area in the model
60 :     * \param area is an integer to denote the internal area of interest
61 :     * \param TimeInfo is the TimeClass for the current model
62 :     */
63 :     virtual void reducePop(int area, const TimeClass* const TimeInfo) {};
64 :     /**
65 :     * \brief This function will calculate the growth of the model population for an area in the model
66 :     * \param area is an integer to denote the internal area of interest
67 :     * \param Area is the AreaClass for the current model
68 :     * \param TimeInfo is the TimeClass for the current model
69 :     */
70 :     virtual void Grow(int area, const AreaClass* const Area, const TimeClass* const TimeInfo) {};
71 :     /**
72 :     * \brief This function will calculate any transition of the model population for an area in the model
73 :     * \param area is an integer to denote the internal area of interest
74 :     * \param TimeInfo is the TimeClass for the current model
75 :     */
76 :     virtual void updateAgePart1(int area, const TimeClass* const TimeInfo) {};
77 :     /**
78 :     * \brief This function will calculate the age increase of the model population for an area in the model
79 :     * \param area is an integer to denote the internal area of interest
80 :     * \param TimeInfo is the TimeClass for the current model
81 :     */
82 :     virtual void updateAgePart2(int area, const TimeClass* const TimeInfo) {};
83 :     /**
84 :     * \brief This function will implement the transiton of the model population for an area in the model
85 :     * \param area is an integer to denote the internal area of interest
86 :     * \param TimeInfo is the TimeClass for the current model
87 :     */
88 :     virtual void updateAgePart3(int area, const TimeClass* const TimeInfo) {};
89 :     /**
90 :     * \brief This function will calculate the spawning of the model population for an area in the model
91 :     * \param area is an integer to denote the internal area of interest
92 :     * \param TimeInfo is the TimeClass for the current model
93 :     */
94 :     virtual void updatePopulationPart1(int area, const TimeClass* const TimeInfo) {};
95 :     /**
96 :     * \brief This function will calculate add the newly matured stock into the model population for an area in the model
97 :     * \param area is an integer to denote the internal area of interest
98 :     * \param TimeInfo is the TimeClass for the current model
99 :     */
100 :     virtual void updatePopulationPart2(int area, const TimeClass* const TimeInfo) {};
101 :     /**
102 :     * \brief This function will calculate add the new recruits into the model population for an area in the model
103 :     * \param area is an integer to denote the internal area of interest
104 :     * \param TimeInfo is the TimeClass for the current model
105 :     */
106 :     virtual void updatePopulationPart3(int area, const TimeClass* const TimeInfo) {};
107 :     /**
108 :     * \brief This function will calculate calculate the straying of the model population for an area in the model
109 :     * \param area is an integer to denote the internal area of interest
110 :     * \param TimeInfo is the TimeClass for the current model
111 :     */
112 :     virtual void updatePopulationPart4(int area, const TimeClass* const TimeInfo) {};
113 :     /**
114 :     * \brief This function will calculate add the strayed stock into the model population for an area in the model
115 :     * \param area is an integer to denote the internal area of interest
116 :     * \param TimeInfo is the TimeClass for the current model
117 :     */
118 :     virtual void updatePopulationPart5(int area, const TimeClass* const TimeInfo) {};
119 :     /**
120 :     * \brief This function will update the model population for an area in the model
121 :     * \param area is an integer to denote the internal area of interest
122 :     * \param TimeInfo is the TimeClass for the current model
123 :     */
124 :     virtual void calcNumbers(int area, const TimeClass* const TimeInfo);
125 :     /**
126 :     * \brief This function will implement the migration of the model population for the model
127 :     * \param TimeInfo is the TimeClass for the current model
128 :     */
129 :     virtual void Migrate(const TimeClass* const TimeInfo) {};
130 :     /**
131 :     * \brief This function will reset the model population
132 :     * \param TimeInfo is the TimeClass for the current model
133 :     */
134 :     virtual void Reset(const TimeClass* const TimeInfo);
135 :     /**
136 :     * \brief This will return the fleet, as a predator type, for use in other functions
137 :     * \return predator
138 :     */
139 :     LengthPredator* getPredator() const { return predator; };
140 :     /**
141 :     * \brief This will check if the fleet will operate on the current timestep
142 :     * \param area is the area that the fleet will operate on
143 :     * \param TimeInfo is the TimeClass for the current model
144 :     * \return 1 if the fleet will operate, 0 otherwise
145 :     */
146 :     int isFleetStepArea(int area, const TimeClass* const TimeInfo);
147 :     /**
148 :     * \brief This will return the type of fleet class
149 :     * \return type
150 :     */
151 :     FleetType getType() const { return type; };
152 :     protected:
153 :     /**
154 :     * \brief This is the fleet, as a predator in the current model
155 :     */
156 :     LengthPredator* predator;
157 :     /**
158 :     * \brief This is the amount of the preys that the fleet has consumed
159 :     */
160 :     FormulaMatrix amount;
161 :     /**
162 :     * \brief This is the PopInfoMatrix used to temporarily store the amount consumed
163 :     */
164 :     PopInfoMatrix tmpPopulation;
165 :     private:
166 :     /**
167 :     * \brief This denotes what type of fleet class has been created
168 :     */
169 :     FleetType type;
170 :     };
171 :    
172 :     #endif

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

Powered By FusionForge