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

Annotation of /trunk/gadget/transition.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1 - (view) (download)

1 : agomez 1 #ifndef transition_h
2 :     #define transition_h
3 :    
4 :     #include "areatime.h"
5 :     #include "formulavector.h"
6 :     #include "conversionindex.h"
7 :     #include "commentstream.h"
8 :     #include "agebandmatrixptrvector.h"
9 :     #include "agebandmatrixratioptrvector.h"
10 :     #include "stock.h"
11 :    
12 :     /**
13 :     * \class Transition
14 :     * \brief This is the class used to calculate the movement from a young stock to older stocks
15 :     *
16 :     * This class moves the oldest age group of a young stock up to older stocks. This is a simpler method than the Maturity classes of moving fish between stocks, and is used to move the fish that haven't matured according to the maturation functions. The length groups of the older stocks are checked, and any fish that haven't yet reached the minimum length of the older stock remain in the younger stock, effectively as an age-plus group.
17 :     */
18 :     class Transition : public HasName, protected LivesOnAreas {
19 :     public:
20 :     /**
21 :     * \brief This is the Transition constructor
22 :     * \param infile is the CommentStream to read the transition data from
23 :     * \param areas is the IntVector of areas that the movements will be calculated on
24 :     * \param age is the maximum age for the (young) stock
25 :     * \param lgrpdiv is the LengthGroupDivision for the stock
26 :     * \param givenname is the name of the stock for this Transition class
27 :     * \param TimeInfo is the TimeClass for the current model
28 :     * \param keeper is the Keeper for the current model
29 :     */
30 :     Transition(CommentStream& infile, const IntVector& areas, int age,
31 :     const LengthGroupDivision* const lgrpdiv, const char* givenname,
32 :     const TimeClass* const TimeInfo, Keeper* const keeper);
33 :     /**
34 :     * \brief This is the default Transition destructor
35 :     */
36 :     ~Transition();
37 :     /**
38 :     * \brief This will select the stocks required for the movement between stocks
39 :     * \param stockvec is the StockPtrVector of all the available stocks
40 :     */
41 :     void setStock(StockPtrVector& stockvec);
42 :     /**
43 :     * \brief This will store the part of the younger stock that will move into the older stocks
44 :     * \param area is the area that the transition is being calculated on
45 :     * \param Alkeys is the AgeBandMatrix of the stock that fish will move from
46 :     * \param TimeInfo is the TimeClass for the current model
47 :     */
48 :     void storeTransitionStock(int area, AgeBandMatrix& Alkeys, const TimeClass* const TimeInfo);
49 :     /**
50 :     * \brief This will store the part of the younger stock that will move into the older stocks
51 :     * \param area is the area that the transition is being calculated on
52 :     * \param Alkeys is the AgeBandMatrix of the stock that fish will move from
53 :     * \param TagAlkeys is the AgeBandMatrixRatio of the tagged stock that fish will move from
54 :     * \param TimeInfo is the TimeClass for the current model
55 :     */
56 :     void storeTransitionStock(int area, AgeBandMatrix& Alkeys,
57 :     AgeBandMatrixRatio& TagAlkeys, const TimeClass* const TimeInfo);
58 :     /**
59 :     * \brief This will move the younger stock into the older stock age-length cells
60 :     * \param area is the area that the movement is being calculated on
61 :     * \param TimeInfo is the TimeClass for the current model
62 :     */
63 :     void Move(int area, const TimeClass* const TimeInfo);
64 :     /**
65 :     * \brief This function will print the transition information
66 :     * \param outfile is the ofstream that all the model information gets sent to
67 :     */
68 :     void Print(ofstream& outfile) const;
69 :     /**
70 :     * \brief This will calculate the stocks the young stock can move into
71 :     * \return transition stocks
72 :     */
73 :     const StockPtrVector& getTransitionStocks();
74 :     /**
75 :     * \brief This function will initialise the tagging experiments for the transition calculations
76 :     */
77 :     void setTagged();
78 :     /**
79 :     * \brief This will add a tagging experiment to the transition calculations
80 :     * \param tagname is the name of the tagging experiment
81 :     */
82 :     void addTransitionTag(const char* tagname);
83 :     /**
84 :     * \brief This will remove a tagging experiment from the transition calculations
85 :     * \param tagname is the name of the tagging experiment
86 :     */
87 :     void deleteTransitionTag(const char* tagname);
88 :     /**
89 :     * \brief This function will reset the transition data
90 :     */
91 :     void Reset();
92 :     /**
93 :     * \brief This will check if the transition process will take place on the current timestep
94 :     * \param TimeInfo is the TimeClass for the current model
95 :     * \return 1 if the transition process will take place, 0 otherwise
96 :     */
97 :     virtual int isTransitionStep(const TimeClass* const TimeInfo);
98 :     protected:
99 :     /**
100 :     * \brief This is the StockPtrVector of the stocks that the young stock will move to
101 :     */
102 :     StockPtrVector transitionStocks;
103 :     /**
104 :     * \brief This is the CharPtrVector of the names of the transition stocks
105 :     */
106 :     CharPtrVector transitionStockNames;
107 :     /**
108 :     * \brief This is the FormulaVector of the ratio of the young stock to move into each older stock
109 :     */
110 :     FormulaVector transitionRatio;
111 :     /**
112 :     * \brief This is used to scale the ratios to ensure that they will always sum to 1
113 :     */
114 :     double ratioscale;
115 :     /**
116 :     * \brief This is the IntVector used as an index for the ratio vector
117 :     */
118 :     IntVector ratioindex;
119 :     /**
120 :     * \brief This is the ConversionIndexPtrVector used to convert from the young stock lengths to the old stock lengths
121 :     */
122 :     ConversionIndexPtrVector CI;
123 :     /**
124 :     * \brief This is the LengthGroupDivision of the stock
125 :     */
126 :     LengthGroupDivision* LgrpDiv;
127 :     /**
128 :     * \brief This is the timestep that the movement between stocks will occur on
129 :     */
130 :     int transitionStep;
131 :     /**
132 :     * \brief This is the AgeBandMatrixPtrVector used to store the calculated old stocks
133 :     */
134 :     AgeBandMatrixPtrVector Storage;
135 :     /**
136 :     * \brief This is the AgeBandMatrixRatioPtrVector used to store the calculated tagged stocks
137 :     */
138 :     AgeBandMatrixRatioPtrVector tagStorage;
139 :     /**
140 :     * \brief This is the age that the younger stock will move into the older stocks
141 :     */
142 :     int age;
143 :     /**
144 :     * \brief This is the minimum length group of the younger stock that exists in the older stock
145 :     */
146 :     int minTransitionLength;
147 :     /**
148 :     * \brief This is the flag used to denote whether the stock has been included in a tagging experiment or not
149 :     */
150 :     int istagged;
151 :     };
152 :    
153 :     #endif

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

Powered By FusionForge