1 : |
agomez |
1 |
#ifndef otherfood_h
|
2 : |
|
|
#define otherfood_h
|
3 : |
|
|
|
4 : |
|
|
#include "formulamatrix.h" |
5 : |
|
|
#include "lengthprey.h" |
6 : |
|
|
#include "base.h" |
7 : |
|
|
|
8 : |
|
|
/**
|
9 : |
|
|
* \class OtherFood
|
10 : |
|
|
* \brief This is the class used to model the available prey that is not modelled dynamically
|
11 : |
|
|
*
|
12 : |
|
|
* This class calculates the amount of available non-dynamic prey for stocks to eat. This is to account for the consumption of prey species that are not being modelled in the current simulation
|
13 : |
|
|
*
|
14 : |
|
|
* \note other food is defined as the \b density of other prey available
|
15 : |
|
|
*/
|
16 : |
|
|
class OtherFood : public BaseClass {
|
17 : |
|
|
public:
|
18 : |
|
|
/**
|
19 : |
|
|
* \brief This is the OtherFood constructor
|
20 : |
|
|
* \param infile is the CommentStream to read the other food parameters from
|
21 : |
|
|
* \param givenname is the name of the other food
|
22 : |
|
|
* \param Area is the AreaClass for the current model
|
23 : |
|
|
* \param TimeInfo is the TimeClass for the current model
|
24 : |
|
|
* \param keeper is the Keeper for the current model
|
25 : |
|
|
*/
|
26 : |
|
|
OtherFood(CommentStream& infile, const char* givenname,
|
27 : |
|
|
const AreaClass* const Area, const TimeClass* const TimeInfo, Keeper* const keeper);
|
28 : |
|
|
/**
|
29 : |
|
|
* \brief This is the default OtherFood destructor
|
30 : |
|
|
*/
|
31 : |
|
|
virtual ~OtherFood();
|
32 : |
|
|
/**
|
33 : |
|
|
* \brief This function will calculate the modelled consumption for an area in the model
|
34 : |
|
|
* \param area is an integer to denote the internal area of interest
|
35 : |
|
|
* \param Area is the AreaClass for the current model
|
36 : |
|
|
* \param TimeInfo is the TimeClass for the current model
|
37 : |
|
|
*/
|
38 : |
|
|
virtual void calcEat(int area, const AreaClass* const Area, const TimeClass* const TimeInfo) {};
|
39 : |
|
|
/**
|
40 : |
|
|
* \brief This function will check the modelled consumption for an area in the model
|
41 : |
|
|
* \param area is an integer to denote the internal area of interest
|
42 : |
|
|
* \param TimeInfo is the TimeClass for the current model
|
43 : |
|
|
*/
|
44 : |
|
|
virtual void checkEat(int area, const TimeClass* const TimeInfo);
|
45 : |
|
|
/**
|
46 : |
|
|
* \brief This function will adjust the modelled consumption for an area in the model
|
47 : |
|
|
* \param area is an integer to denote the internal area of interest
|
48 : |
|
|
* \param TimeInfo is the TimeClass for the current model
|
49 : |
|
|
*/
|
50 : |
|
|
virtual void adjustEat(int area, const TimeClass* const TimeInfo) {};
|
51 : |
|
|
/**
|
52 : |
|
|
* \brief This function will reduce the model population for an area in the model
|
53 : |
|
|
* \param area is an integer to denote the internal area of interest
|
54 : |
|
|
* \param TimeInfo is the TimeClass for the current model
|
55 : |
|
|
*/
|
56 : |
|
|
virtual void reducePop(int area, const TimeClass* const TimeInfo) {};
|
57 : |
|
|
/**
|
58 : |
|
|
* \brief This function will calculate the growth of the model population for an area in the model
|
59 : |
|
|
* \param area is an integer to denote the internal area of interest
|
60 : |
|
|
* \param Area is the AreaClass for the current model
|
61 : |
|
|
* \param TimeInfo is the TimeClass for the current model
|
62 : |
|
|
*/
|
63 : |
|
|
virtual void Grow(int area, const AreaClass* const Area, const TimeClass* const TimeInfo) {};
|
64 : |
|
|
/**
|
65 : |
|
|
* \brief This function will calculate any transition 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 TimeInfo is the TimeClass for the current model
|
68 : |
|
|
*/
|
69 : |
|
|
virtual void updateAgePart1(int area, const TimeClass* const TimeInfo) {};
|
70 : |
|
|
/**
|
71 : |
|
|
* \brief This function will calculate the age increase of the model population for an area in the model
|
72 : |
|
|
* \param area is an integer to denote the internal area of interest
|
73 : |
|
|
* \param TimeInfo is the TimeClass for the current model
|
74 : |
|
|
*/
|
75 : |
|
|
virtual void updateAgePart2(int area, const TimeClass* const TimeInfo) {};
|
76 : |
|
|
/**
|
77 : |
|
|
* \brief This function will implement the transiton of the model population for an area in the model
|
78 : |
|
|
* \param area is an integer to denote the internal area of interest
|
79 : |
|
|
* \param TimeInfo is the TimeClass for the current model
|
80 : |
|
|
*/
|
81 : |
|
|
virtual void updateAgePart3(int area, const TimeClass* const TimeInfo) {};
|
82 : |
|
|
/**
|
83 : |
|
|
* \brief This function will calculate the spawning of the model population for an area in the model
|
84 : |
|
|
* \param area is an integer to denote the internal area of interest
|
85 : |
|
|
* \param TimeInfo is the TimeClass for the current model
|
86 : |
|
|
*/
|
87 : |
|
|
virtual void updatePopulationPart1(int area, const TimeClass* const TimeInfo) {};
|
88 : |
|
|
/**
|
89 : |
|
|
* \brief This function will calculate add the newly matured stock into the model population for an area in the model
|
90 : |
|
|
* \param area is an integer to denote the internal area of interest
|
91 : |
|
|
* \param TimeInfo is the TimeClass for the current model
|
92 : |
|
|
*/
|
93 : |
|
|
virtual void updatePopulationPart2(int area, const TimeClass* const TimeInfo) {};
|
94 : |
|
|
/**
|
95 : |
|
|
* \brief This function will calculate add the new recruits into the model population for an area in the model
|
96 : |
|
|
* \param area is an integer to denote the internal area of interest
|
97 : |
|
|
* \param TimeInfo is the TimeClass for the current model
|
98 : |
|
|
*/
|
99 : |
|
|
virtual void updatePopulationPart3(int area, const TimeClass* const TimeInfo) {};
|
100 : |
|
|
/**
|
101 : |
|
|
* \brief This function will calculate calculate the straying of the model population for an area in the model
|
102 : |
|
|
* \param area is an integer to denote the internal area of interest
|
103 : |
|
|
* \param TimeInfo is the TimeClass for the current model
|
104 : |
|
|
*/
|
105 : |
|
|
virtual void updatePopulationPart4(int area, const TimeClass* const TimeInfo) {};
|
106 : |
|
|
/**
|
107 : |
|
|
* \brief This function will calculate add the strayed stock into the model population for an area in the model
|
108 : |
|
|
* \param area is an integer to denote the internal area of interest
|
109 : |
|
|
* \param TimeInfo is the TimeClass for the current model
|
110 : |
|
|
*/
|
111 : |
|
|
virtual void updatePopulationPart5(int area, const TimeClass* const TimeInfo) {};
|
112 : |
|
|
/**
|
113 : |
|
|
* \brief This function will update the model population for an area in the model
|
114 : |
|
|
* \param area is an integer to denote the internal area of interest
|
115 : |
|
|
* \param TimeInfo is the TimeClass for the current model
|
116 : |
|
|
*/
|
117 : |
|
|
virtual void calcNumbers(int area, const TimeClass* const TimeInfo);
|
118 : |
|
|
/**
|
119 : |
|
|
* \brief This function will implement the migration of the model population for the model
|
120 : |
|
|
* \param TimeInfo is the TimeClass for the current model
|
121 : |
|
|
*/
|
122 : |
|
|
virtual void Migrate(const TimeClass* const TimeInfo) {};
|
123 : |
|
|
/**
|
124 : |
|
|
* \brief This function will reset the model population
|
125 : |
|
|
* \param TimeInfo is the TimeClass for the current model
|
126 : |
|
|
*/
|
127 : |
|
|
virtual void Reset(const TimeClass* const TimeInfo);
|
128 : |
|
|
/**
|
129 : |
|
|
* \brief This will check if there is otherfood available on the current timestep
|
130 : |
|
|
* \param area is the area that the otherfood will be consumed on
|
131 : |
|
|
* \param TimeInfo is the TimeClass for the current model
|
132 : |
|
|
* \return 1 if there is otherfood available, 0 otherwise
|
133 : |
|
|
*/
|
134 : |
|
|
int isOtherFoodStepArea(int area, const TimeClass* const TimeInfo);
|
135 : |
|
|
/**
|
136 : |
|
|
* \brief This will return the otherfood, as a prey type, for use in other functions
|
137 : |
|
|
* \return prey
|
138 : |
|
|
*/
|
139 : |
|
|
LengthPrey* getPrey() const { return prey; };
|
140 : |
|
|
/**
|
141 : |
|
|
* \brief This function will print the model population
|
142 : |
|
|
* \param outfile is the ofstream that all the model information gets sent to
|
143 : |
|
|
*/
|
144 : |
|
|
void Print(ofstream& outfile) const;
|
145 : |
|
|
protected:
|
146 : |
|
|
/**
|
147 : |
|
|
* \brief This is the amount of the otherfood that is available for the predators to consume
|
148 : |
|
|
*/
|
149 : |
|
|
FormulaMatrix amount;
|
150 : |
|
|
/**
|
151 : |
|
|
* \brief This is the otherfood, as a prey in the current model
|
152 : |
|
|
*/
|
153 : |
|
|
LengthPrey* prey;
|
154 : |
|
|
/**
|
155 : |
|
|
* \brief This is the PopInfoMatrix used to temporarily store the amount of food available
|
156 : |
|
|
*/
|
157 : |
|
|
PopInfoMatrix tmpPopulation;
|
158 : |
|
|
};
|
159 : |
|
|
|
160 : |
|
|
#endif
|