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

Annotation of /trunk/gadget/renewal.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1 - (view) (download)

1 : agomez 1 #ifndef renewal_h
2 :     #define renewal_h
3 :    
4 :     #include "formulamatrixptrvector.h"
5 :     #include "conversionindex.h"
6 :     #include "commentstream.h"
7 :     #include "stock.h"
8 :     #include "livesonareas.h"
9 :    
10 :     /**
11 :     * \class RenewalData
12 :     * \brief This is the class used to calculate the renewal to a stock
13 :     *
14 :     * This class adds new fish into a stock, usually into the youngest age group. The total number of the recruits (in units of 10,000 fish) for each specified timestep is given in the input file. The lengths of the recruits are calculated from a Normal distribution, from a given mean and standard deviation. The mean weights of these length groups are then calculated from a specified length-weight relationship.
15 :     */
16 :     class RenewalData : public HasName, protected LivesOnAreas {
17 :     public:
18 :     /**
19 :     * \brief This is the RenewalData constructor
20 :     * \param infile is the CommentStream to read the renewal data from
21 :     * \param areas is the IntVector of areas that the renewal data will be calculated on
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 :     * \param refWeightFile is the name of the reference weight file
26 :     * \param givenname is the name of the stock for this RenewalData class
27 :     * \param minage is the minimum age of the stock the renewals will be added to
28 :     * \param maxage is the maximum age of the stock the renewals will be added to
29 :     * \param DL is the step length of the length groups of the stock that the renewals will be added to
30 :     */
31 :     RenewalData(CommentStream& infile, const IntVector& areas, const AreaClass* const Area,
32 :     const TimeClass* const TimeInfo, Keeper* const keeper, const char* refWeightFile,
33 :     const char* givenname, int minage, int maxage, double DL);
34 :     /**
35 :     * \brief This is the default RenewalData destructor
36 :     */
37 :     ~RenewalData();
38 :     /**
39 :     * \brief This is the function used to add the renewal to the model
40 :     * \param Alkeys is the AgeBandMatrix for the stock to which the renewal will be added
41 :     * \param area is the internal area identifier for the renewal is taking place on
42 :     * \param TimeInfo is the TimeClass for the current model
43 :     */
44 :     void addRenewal(AgeBandMatrix& Alkeys, int area, const TimeClass* const TimeInfo);
45 :     /**
46 :     * \brief This will set the ConversionIndex required for to calculate the renewal
47 :     * \param GivenLDiv is the LengthGroupDivision for the stock
48 :     */
49 :     void setCI(const LengthGroupDivision* const GivenLDiv);
50 :     /**
51 :     * \brief This function will print the renewal data
52 :     * \param outfile is the ofstream that all the model information gets sent to
53 :     */
54 :     void Print(ofstream& outfile) const;
55 :     /**
56 :     * \brief This function will reset the renewal data
57 :     */
58 :     void Reset();
59 :     /**
60 :     * \brief This will check if the renewal process will take place on the current timestep and area
61 :     * \param area is the internal area identifier for the renewal is taking place on
62 :     * \param TimeInfo is the TimeClass for the current model
63 :     * \return 1 if renewal data will be added to the model, 0 otherwise
64 :     */
65 :     int isRenewalStepArea(int area, const TimeClass* const TimeInfo);
66 :     protected:
67 :     /**
68 :     * \brief This is the function used to read the normal distribution and condition factor for the renewal data
69 :     * \param infile is the CommentStream to read the initial conditions data from
70 :     * \param keeper is the Keeper for the current model
71 :     * \param TimeInfo is the TimeClass for the current model
72 :     * \param Area is the AreaClass for the current model
73 :     * \param minage is the minimum age of the renewals
74 :     * \param maxage is the maximum age of the renewals
75 :     */
76 :     void readNormalConditionData(CommentStream& infile, Keeper* const keeper,
77 :     const TimeClass* const TimeInfo, const AreaClass* const Area, int minage, int maxage);
78 :     /**
79 :     * \brief This is the function used to read the normal distribution for the renewal data
80 :     * \param infile is the CommentStream to read the initial conditions data from
81 :     * \param keeper is the Keeper for the current model
82 :     * \param TimeInfo is the TimeClass for the current model
83 :     * \param Area is the AreaClass for the current model
84 :     * \param minage is the minimum age of the renewals
85 :     * \param maxage is the maximum age of the renewals
86 :     */
87 :     void readNormalParameterData(CommentStream& infile, Keeper* const keeper,
88 :     const TimeClass* const TimeInfo, const AreaClass* const Area, int minage, int maxage);
89 :     /**
90 :     * \brief This is the function used to read the numbers of the renewal data
91 :     * \param infile is the CommentStream to read the initial conditions data from
92 :     * \param keeper is the Keeper for the current model
93 :     * \param TimeInfo is the TimeClass for the current model
94 :     * \param Area is the AreaClass for the current model
95 :     * \param minage is the minimum age of the renewals
96 :     * \param maxage is the maximum age of the renewals
97 :     */
98 :     void readNumberData(CommentStream& infile, Keeper* const keeper,
99 :     const TimeClass* const TimeInfo, const AreaClass* const Area, int minage, int maxage);
100 :     /**
101 :     * \brief This is the identifier of the function to be used to read the renewal data from file
102 :     */
103 :     int readoption;
104 :     /**
105 :     * \brief This is used as the index for the vectors of renewal data
106 :     */
107 :     int index;
108 :     /**
109 :     * \brief This is the IntVector of timesteps that the renewal will take place on
110 :     */
111 :     IntVector renewalTime;
112 :     /**
113 :     * \brief This is the IntVector of areas that the renewal will take place on
114 :     */
115 :     IntVector renewalArea;
116 :     /**
117 :     * \brief This is the IntVector of ages that the renewal will take place on
118 :     */
119 :     IntVector renewalAge;
120 :     /**
121 :     * \brief This is the AgeBandMatrixPtrVector that contains the number and weight of the renewal population
122 :     */
123 :     AgeBandMatrixPtrVector renewalDistribution;
124 :     /**
125 :     * \brief This is the FormulaMatrixPtrVector that contains the number (from the input file) of the renewal population
126 :     */
127 :     FormulaMatrixPtrVector renewalNumber;
128 :     /**
129 :     * \brief This is the FormulaVector of the multiplier used to calculate the renewal population
130 :     */
131 :     FormulaVector renewalMult;
132 :     /**
133 :     * \brief This is the FormulaVector of mean lengths of the stock used to calculate the renewal population
134 :     */
135 :     FormulaVector meanLength;
136 :     /**
137 :     * \brief This is the FormulaVector of the standard deviation of the lengths of the stock used to calculate the renewal population
138 :     */
139 :     FormulaVector sdevLength;
140 :     /**
141 :     * \brief This is the FormulaVector of the condition factor used to calculate the weight of the renewal population
142 :     */
143 :     FormulaVector relCond;
144 :     /**
145 :     * \brief This is the FormulaVector of the multipliers used to calculate the length-weight relationship for the renewal
146 :     */
147 :     FormulaVector alpha;
148 :     /**
149 :     * \brief This is the FormulaVector of the powers used to calculate the length-weight relationship for the renewal
150 :     */
151 :     FormulaVector beta;
152 :     /**
153 :     * \brief This is the DoubleVector of the reference weight values
154 :     */
155 :     DoubleVector refWeight;
156 :     /**
157 :     * \brief This is the ConversionIndex used to convert from the renewal LengthGroupDivision to the stock LengthGroupDivision
158 :     */
159 :     ConversionIndex* CI;
160 :     /**
161 :     * \brief This is the LengthGroupDivision of the renewal of the stock
162 :     */
163 :     LengthGroupDivision* LgrpDiv;
164 :     };
165 :    
166 :     #endif

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

Powered By FusionForge