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

Annotation of /trunk/gadget/naturalm.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1 - (view) (download)

1 : agomez 1 #ifndef naturalm_h
2 :     #define naturalm_h
3 :    
4 :     #include "areatime.h"
5 :     #include "commentstream.h"
6 :     #include "selectfunc.h"
7 :     #include "livesonareas.h"
8 :     #include "modelvariablevector.h"
9 :     #include "keeper.h"
10 :    
11 :     /**
12 :     * \class NaturalMortality
13 :     * \brief This is the class used to calculate the affect of natural mortality on the stock
14 :     *
15 :     * This class calculates the proportion of the stock that should be removed from the model due to natural mortality (ie. any mortality that is not due to predation, either by another stock or by a fleet). The number that is stored after this calculation contains the proportion of each area/age group that will survive (ie. is not removed due to the natural mortality).
16 :     *
17 :     * \note This is currently an age-based calculation, and it would be much better to replace this with a length-based calculation, by re-implementing this as a simple predator with a new suitability function to allow for higher levels of 'predation' on both the young/short fish and the old/long fish
18 :     */
19 :     class NaturalMortality : public HasName, public LivesOnAreas {
20 :     public:
21 :     /**
22 :     * \brief This is the NaturalMortality constructor
23 :     * \param infile is the CommentStream to read the NaturalMortality information from
24 :     * \param minage is the minimum age of the stock
25 :     * \param numage is the number of age groups for the stock
26 :     * \param givenname is the name of the stock for this NaturalMortality class
27 :     * \param Areas is the IntVector of the areas that the stock lives on
28 :     * \param TimeInfo is the TimeClass for the current model
29 :     * \param keeper is the Keeper for the current model
30 :     */
31 :     NaturalMortality(CommentStream& infile, int minage, int numage, const char* givenname,
32 :     const IntVector& Areas, const TimeClass* const TimeInfo, Keeper* const keeper);
33 :     /**
34 :     * \brief This is the default NaturalMortality destructor
35 :     */
36 :     ~NaturalMortality();
37 :     /**
38 :     * \brief This function will return the DoubleVector of the proportion of each age group that will survive on the current timestep
39 :     * \param area is the area that the natural mortality is being calculated on
40 :     * \return proportion surviving from each age group
41 :     */
42 :     const DoubleVector& getProportion(int area) const { return proportion[this->areaNum(area)]; };
43 :     /**
44 :     * \brief This function will reset the NaturalMortality information
45 :     * \param TimeInfo is the TimeClass for the current model
46 :     */
47 :     void Reset(const TimeClass* const TimeInfo);
48 :     /**
49 :     * \brief This function will print the summary NaturalMortality information
50 :     * \param outfile is the ofstream that all the model information gets sent to
51 :     */
52 :     void Print(ofstream& outfile);
53 :     protected:
54 :     /**
55 :     * \brief This is the ModelVariableVector used to store the mortality of each age group
56 :     */
57 :     ModelVariableVector mortality;
58 :     /**
59 :     * \brief This is the SelectFunc used to calculate of the proportion of each age group of the stock that will die due to natural mortality
60 :     */
61 :     SelectFunc* fnMortality;
62 :     /**
63 :     * \brief This is the DoubleMatrix used to store the proportion of each age group that will survive (ie. will not die out due to natural mortality)
64 :     */
65 :     DoubleMatrix proportion;
66 :     /**
67 :     * \brief This is the minimum age of the stock, used as an index when calculating proportion
68 :     */
69 :     int minStockAge;
70 :     /**
71 :     * \brief This is the identifier of the function to be used to read the natural mortality data from file
72 :     */
73 :     int readoption;
74 :     };
75 :    
76 :     #endif

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

Powered By FusionForge