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

Annotation of /trunk/gadget/recapture.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1 - (view) (download)

1 : agomez 1 #ifndef recapture_h
2 :     #define recapture_h
3 :    
4 :     #include "likelihood.h"
5 :     #include "commentstream.h"
6 :     #include "recaggregator.h"
7 :     #include "doublematrixptrmatrix.h"
8 :     #include "tagptrvector.h"
9 :    
10 :     /**
11 :     * \class Recaptures
12 :     * \brief This is the class used to calculate a likelihood score based on returns data from tagging experiments
13 :     *
14 :     * This class calculates a likelihood score based on the difference between recaptures data from tagging experiments within the model with recaptures data obtained from returns from tagging experiments. The model will calculate the expected number of recaptures for the tagging experiments according to the model parameters, and aggregate this into specified length groups. This recaptures data is then compared to the corresponding data obtained from the returns data from tagging experiments.
15 :     */
16 :     class Recaptures : public Likelihood {
17 :     public:
18 :     /**
19 :     * \brief This is the Recaptures constructor
20 :     * \param infile is the CommentStream to read the Recaptures data from
21 :     * \param Area is the AreaClass for the current model
22 :     * \param TimeInfo is the TimeClass for the current model
23 :     * \param weight is the weight for the likelihood component
24 :     * \param Tag is the TagPtrVector of tagging experiments for the current model
25 :     * \param name is the name for the likelihood component
26 :     */
27 :     Recaptures(CommentStream& infile, const AreaClass* const Area,
28 :     const TimeClass* const TimeInfo, double weight, TagPtrVector Tag, const char* name);
29 :     /**
30 :     * \brief This is the default Recaptures destructor
31 :     */
32 :     virtual ~Recaptures();
33 :     /**
34 :     * \brief This function will calculate the likelihood score for the Recaptures component
35 :     * \param TimeInfo is the TimeClass for the current model
36 :     */
37 :     virtual void addLikelihood(const TimeClass* const TimeInfo);
38 :     /**
39 :     * \brief This function will reset the Recaptures likelihood information
40 :     * \param keeper is the Keeper for the current model
41 :     */
42 :     virtual void Reset(const Keeper* const keeper);
43 :     /**
44 :     * \brief This function will print the summary Recaptures likelihood information
45 :     * \param outfile is the ofstream that all the model information gets sent to
46 :     */
47 :     virtual void Print(ofstream& outfile) const;
48 :     /**
49 :     * \brief This will select the fleets and stocks required to calculate the Recaptures likelihood score
50 :     * \param Fleets is the FleetPtrVector of all the available fleets
51 :     * \param Stocks is the StockPtrVector of all the available stocks
52 :     */
53 :     virtual void setFleetsAndStocks(FleetPtrVector& Fleets, StockPtrVector& Stocks);
54 :     /**
55 :     * \brief This function will print summary information from the Recaptures likelihood calculation
56 :     * \param outfile is the ofstream that all the model likelihood information gets sent to
57 :     */
58 :     virtual void printSummary(ofstream& outfile);
59 :     /**
60 :     * \brief This function will print information from each Recaptures calculation
61 :     * \param outfile is the ofstream that all the model likelihood information gets sent to
62 :     * \param TimeInfo is the TimeClass for the current model
63 :     */
64 :     virtual void printLikelihood(ofstream& outfile, const TimeClass* const TimeInfo);
65 :     private:
66 :     /**
67 :     * \brief This function will read the Recaptures data from the input file
68 :     * \param infile is the CommentStream to read the Recaptures data from
69 :     * \param TimeInfo is the TimeClass for the current model
70 :     * \param numarea is the number of areas that the likelihood data covers
71 :     * \param numlen is the number of length groups that the likelihood data covers
72 :     */
73 :     void readRecaptureData(CommentStream& infile,
74 :     const TimeClass* const TimeInfo, int numarea, int numlen);
75 :     /**
76 :     * \brief This function will calculate the likelihood score for the current timestep based on a Poisson function
77 :     * \param TimeInfo is the TimeClass for the current model
78 :     * \return likelihood score
79 :     */
80 :     double calcLikPoisson(const TimeClass* const TimeInfo);
81 :     /**
82 :     * \brief This is the RecAggregator used to collect information about the racptured tagged fish
83 :     */
84 :     RecAggregator** aggregator;
85 :     /**
86 :     * \brief This is the CharPtrVector of the names of the tagging experiments that will be used to calculate the likelihood score
87 :     */
88 :     CharPtrVector tagnames;
89 :     /**
90 :     * \brief This is the CharPtrVector of the names of the fleets that will be used to calculate the likelihood score
91 :     */
92 :     CharPtrVector fleetnames;
93 :     /**
94 :     * \brief This is the CharPtrVector of the names of the areas
95 :     */
96 :     CharPtrVector areaindex;
97 :     /**
98 :     * \brief This is the CharPtrVector of the names of the length groups
99 :     */
100 :     CharPtrVector lenindex;
101 :     /**
102 :     * \brief This is the IntMatrix used to store area information
103 :     */
104 :     IntMatrix areas;
105 :     /**
106 :     * \brief This is the DoubleVector used to store length information
107 :     */
108 :     DoubleVector lengths;
109 :     /**
110 :     * \brief This is the IntMatrix used to store information about the years when recapture data is available
111 :     */
112 :     IntMatrix obsYears;
113 :     /**
114 :     * \brief This is the IntMatrix used to store information about the steps when recapture data is available
115 :     */
116 :     IntMatrix obsSteps;
117 :     /**
118 :     * \brief This is the IntMatrix used to store information about the years when recapture data is not available but modelled recaptures occur
119 :     */
120 :     IntMatrix modYears;
121 :     /**
122 :     * \brief This is the IntMatrix used to store information about the steps when recapture data is not available but modelled recaptures occur
123 :     */
124 :     IntMatrix modSteps;
125 :     /**
126 :     * \brief This is the DoubleMatrixPtrMatrix used to store length distribution information specified in the input file
127 :     * \note The indices for this object are [tag][time][area][length]
128 :     */
129 :     DoubleMatrixPtrMatrix obsDistribution;
130 :     /**
131 :     * \brief This is the DoubleMatrixPtrMatrix used to store length distribution information calculated in the model for the timesteps that there were observed recaptures
132 :     * \note The indices for this object are [tag][time][area][length]
133 :     */
134 :     DoubleMatrixPtrMatrix modelDistribution;
135 :     /**
136 :     * \brief This is the DoubleMatrixPtrMatrix used to store length distribution information calculated in the model for the timesteps that there were no observed recaptures, but there were still modelled recaptures
137 :     * \note The indices for this object are [tag][time][area][length]
138 :     */
139 :     DoubleMatrixPtrMatrix newDistribution;
140 :     /**
141 :     * \brief This is the TagPtrVector of the relevant tagging experiments
142 :     */
143 :     TagPtrVector tagvec;
144 :     /**
145 :     * \brief This is the identifier of the function to be used to calculate the likelihood component
146 :     */
147 :     int functionnumber;
148 :     /**
149 :     * \brief This is the name of the function to be used to calculate the likelihood component
150 :     */
151 :     char* functionname;
152 :     /**
153 :     * \brief This is the AgeBandMatrixPtrVector used to temporarily store the information returned from the aggregatation function
154 :     */
155 :     const AgeBandMatrixPtrVector* alptr;
156 :     };
157 :    
158 :     #endif

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

Powered By FusionForge