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

Annotation of /trunk/gadget/stray.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1 - (view) (download)

1 : agomez 1 #ifndef stray_h
2 :     #define stray_h
3 :    
4 :     #include "areatime.h"
5 :     #include "formulavector.h"
6 :     #include "commentstream.h"
7 :     #include "agebandmatrix.h"
8 :     #include "intmatrix.h"
9 :     #include "livesonareas.h"
10 :     #include "selectfunc.h"
11 :     #include "stock.h"
12 :    
13 :     /**
14 :     * \class StrayData
15 :     * \brief This is the class used to calculate the movement from one stock to other stocks
16 :     *
17 :     * This class moves a proportion of fish from one stock to the corresponding age-length cell in other stocks. This is an extension to the Transition class, since it can move fish from more than one age group. The length groups of the new stocks are checked, and any fish that haven't yet reached the minimum length of the new stock remain in the original stock.
18 :     */
19 :     class StrayData : public HasName, protected LivesOnAreas {
20 :     public:
21 :     /**
22 :     * \brief This is the StrayData constructor
23 :     * \param infile is the CommentStream to read the straying data from
24 :     * \param LgrpDiv is the LengthGroupDivision that the straying stock will be calculated on
25 :     * \param areas is the IntVector of areas that the straying stock will be calculated on
26 :     * \param Area is the AreaClass for the current model
27 :     * \param givenname is the name of the stock for this StrayData class
28 :     * \param TimeInfo is the TimeClass for the current model
29 :     * \param keeper is the Keeper for the current model
30 :     */
31 :     StrayData(CommentStream& infile, const LengthGroupDivision* const LgrpDiv,
32 :     const IntVector& areas, const AreaClass* const Area, const char* givenname,
33 :     const TimeClass* const TimeInfo, Keeper* const keeper);
34 :     /**
35 :     * \brief This is the default StrayData destructor
36 :     */
37 :     ~StrayData();
38 :     /**
39 :     * \brief This function will print the straying information
40 :     * \param outfile is the ofstream that all the model information gets sent to
41 :     */
42 :     void Print(ofstream& outfile) const;
43 :     /**
44 :     * \brief This will select the stocks required for the straying process
45 :     * \param stockvec is the StockPtrVector of all the available stocks
46 :     */
47 :     void setStock(StockPtrVector& stockvec);
48 :     /**
49 :     * \brief This will move the calculated straying stock from the current stock into the new stock age-length cells
50 :     * \param area is the area that the straying process is being calculated on
51 :     * \param TimeInfo is the TimeClass for the current model
52 :     */
53 :     void addStrayStock(int area, const TimeClass* const TimeInfo);
54 :     /**
55 :     * \brief This will store the part of the current stock that will stray into other stocks
56 :     * \param area is the area that the straying is being calculated on
57 :     * \param Alkeys is the AgeBandMatrix of the stock that fish will move from
58 :     * \param TimeInfo is the TimeClass for the current model
59 :     */
60 :     void storeStrayingStock(int area, AgeBandMatrix& Alkeys, const TimeClass* const TimeInfo);
61 :     /**
62 :     * \brief This will store the part of the current stock that will stray into other stocks
63 :     * \param area is the area that the straying is being calculated on
64 :     * \param Alkeys is the AgeBandMatrix of the stock that fish will move from
65 :     * \param TagAlkeys is the AgeBandMatrixRatio of the tagged stock that fish will move from
66 :     * \param TimeInfo is the TimeClass for the current model
67 :     */
68 :     void storeStrayingStock(int area, AgeBandMatrix& Alkeys,
69 :     AgeBandMatrixRatio& TagAlkeys, const TimeClass* const TimeInfo);
70 :     /**
71 :     * \brief This will check if the straying process will take place on the current timestep
72 :     * \param area is the area that the straying is being calculated on
73 :     * \param TimeInfo is the TimeClass for the current model
74 :     * \return 1 if the straying process will take place, 0 otherwise
75 :     */
76 :     int isStrayStepArea(int area, const TimeClass* const TimeInfo);
77 :     /**
78 :     * \brief This will reset the straying information for the current model run
79 :     * \param TimeInfo is the TimeClass for the current model
80 :     */
81 :     void Reset(const TimeClass* const TimeInfo);
82 :     /**
83 :     * \brief This will calculate the stocks the current stock can stray into
84 :     * \return stray stocks
85 :     */
86 :     const StockPtrVector& getStrayStocks();
87 :     /**
88 :     * \brief This function will initialise the tagging experiments for the straying calculations
89 :     */
90 :     void setTagged();
91 :     /**
92 :     * \brief This will add a tagging experiment to the straying calculations
93 :     * \param tagname is the name of the tagging experiment
94 :     */
95 :     void addStrayTag(const char* tagname);
96 :     /**
97 :     * \brief This will remove a tagging experiment from the straying calculations
98 :     * \param tagname is the name of the tagging experiment
99 :     */
100 :     void deleteStrayTag(const char* tagname);
101 :     protected:
102 :     /**
103 :     * \brief This is the StockPtrVector of the stocks that the straying fish will move to
104 :     */
105 :     StockPtrVector strayStocks;
106 :     /**
107 :     * \brief This is the CharPtrVector of the names of the straying stocks
108 :     */
109 :     CharPtrVector strayStockNames;
110 :     /**
111 :     * \brief This is the FormulaVector of the ratio of the stock that will stray
112 :     */
113 :     FormulaVector strayRatio;
114 :     /**
115 :     * \brief This is used to scale the ratios to ensure that they will always sum to 1
116 :     */
117 :     double ratioscale;
118 :     /**
119 :     * \brief This is the IntVector used as an index for the ratio vector
120 :     */
121 :     IntVector ratioindex;
122 :     /**
123 :     * \brief This is the IntVector of timesteps that the straying will take place on
124 :     */
125 :     IntVector strayStep;
126 :     /**
127 :     * \brief This is the IntVector of areas that the straying will take place on
128 :     */
129 :     IntVector strayArea;
130 :     /**
131 :     * \brief This is the LengthGroupDivision of the stock
132 :     */
133 :     LengthGroupDivision* LgrpDiv;
134 :     /**
135 :     * \brief This is the DoubleVector of the proportion of each length group of the stock that will stray
136 :     */
137 :     DoubleVector strayProportion;
138 :     /**
139 :     * \brief This is the SelectFunc used to calculate of the proportion of each length group of the stock that will stray
140 :     */
141 :     SelectFunc* fnProportion;
142 :     /**
143 :     * \brief This is the AgeBandMatrixPtrVector used to store the calculated straying stocks
144 :     */
145 :     AgeBandMatrixPtrVector Storage;
146 :     /**
147 :     * \brief This is the AgeBandMatrixRatioPtrVector used to store the calculated straying tagged stocks
148 :     */
149 :     AgeBandMatrixRatioPtrVector tagStorage;
150 :     /**
151 :     * \brief This is the ConversionIndexPtrVector used to convert from the current stock lengths to the straying stock lengths
152 :     */
153 :     ConversionIndexPtrVector CI;
154 :     /**
155 :     * \brief This is the minimum length group division of the straying stock
156 :     */
157 :     int minStrayLength;
158 :     /**
159 :     * \brief This is the flag used to denote whether the stock has been included in a tagging experiment or not
160 :     */
161 :     int istagged;
162 :     };
163 :    
164 :     #endif

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

Powered By FusionForge