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

Annotation of /trunk/gadget/catchstatistics.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1 - (view) (download)

1 : agomez 1 #ifndef catchstatistics_h
2 :     #define catchstatistics_h
3 :    
4 :     #include "likelihood.h"
5 :     #include "commentstream.h"
6 :     #include "charptrvector.h"
7 :     #include "fleetpreyaggregator.h"
8 :     #include "doublematrixptrvector.h"
9 :     #include "popstatistics.h"
10 :     #include "actionattimes.h"
11 :    
12 :     /**
13 :     * \class CatchStatistics
14 :     * \brief This is the class used to calculate a likelihood score based on statistical data sampled from the stocks caught by fleets
15 :     *
16 :     * This class calculates a likelihood score based on the difference between statistical data sampled from stocks caught according to the model and that caught by fleets, according to the landings data. This is typically used to compare biological data, such as mean length at age or mean weight at age. The model will calculate the mean length (or weight) of the stock that is caught according to the model parameters, and aggregate this into specified age groups. This statistical data is then compared to the corresponding data calculated from a statistical sample of the landings data.
17 :     */
18 :     class CatchStatistics : public Likelihood {
19 :     public:
20 :     /**
21 :     * \brief This is the CatchStatistics constructor
22 :     * \param infile is the CommentStream to read the CatchStatistics data from
23 :     * \param Area is the AreaClass for the current model
24 :     * \param TimeInfo is the TimeClass for the current model
25 :     * \param weight is the weight for the likelihood component
26 :     * \param name is the name for the likelihood component
27 :     */
28 :     CatchStatistics(CommentStream& infile, const AreaClass* const Area,
29 :     const TimeClass* const TimeInfo, double weight, const char* name);
30 :     /**
31 :     * \brief This is the default CatchStatistics destructor
32 :     */
33 :     virtual ~CatchStatistics();
34 :     /**
35 :     * \brief This function will calculate the likelihood score for the CatchStatistics component
36 :     * \param TimeInfo is the TimeClass for the current model
37 :     */
38 :     virtual void addLikelihood(const TimeClass* const TimeInfo);
39 :     /**
40 :     * \brief This function will reset the CatchStatistics likelihood information
41 :     * \param keeper is the Keeper for the current model
42 :     */
43 :     virtual void Reset(const Keeper* const keeper);
44 :     /**
45 :     * \brief This function will print the summary CatchStatistics likelihood information
46 :     * \param outfile is the ofstream that all the model information gets sent to
47 :     */
48 :     virtual void Print(ofstream& outfile) const;
49 :     /**
50 :     * \brief This will select the fleets and stocks required to calculate the CatchStatistics likelihood score
51 :     * \param Fleets is the FleetPtrVector of all the available fleets
52 :     * \param Stocks is the StockPtrVector of all the available stocks
53 :     */
54 :     void setFleetsAndStocks(FleetPtrVector& Fleets, StockPtrVector& Stocks);
55 :     /**
56 :     * \brief This function will print information from each CatchStatistics calculation
57 :     * \param outfile is the ofstream that all the model likelihood information gets sent to
58 :     * \param TimeInfo is the TimeClass for the current model
59 :     */
60 :     virtual void printLikelihood(ofstream& outfile, const TimeClass* const TimeInfo);
61 :     /**
62 :     * \brief This function will print summary information from each CatchStatistics likelihood calculation
63 :     * \param outfile is the ofstream that all the model likelihood information gets sent to
64 :     */
65 :     virtual void printSummary(ofstream& outfile);
66 :     private:
67 :     /**
68 :     * \brief This function will read the CatchStatistics data from the input file
69 :     * \param infile is the CommentStream to read the CatchStatistics data from
70 :     * \param TimeInfo is the TimeClass for the current model
71 :     * \param numarea is the number of areas that the likelihood data covers
72 :     * \param numage is the number of age groups that the likelihood data covers
73 :     */
74 :     void readStatisticsData(CommentStream& infile, const TimeClass* TimeInfo,
75 :     int numarea, int numage);
76 :     /**
77 :     * \brief This function will calculate the likelihood score for the current timestep based on a sum of squares function
78 :     * \return likelihood score
79 :     */
80 :     double calcLikSumSquares();
81 :     /**
82 :     * \brief This is the DoubleMatrixPtrVector used to store number information specified in the input file
83 :     * \note The indices for this object are [time][area][age]
84 :     */
85 :     DoubleMatrixPtrVector numbers;
86 :     /**
87 :     * \brief This is the DoubleMatrixPtrVector used to store the mean length/weight information specified in the input file
88 :     * \note The indices for this object are [time][area][age]
89 :     */
90 :     DoubleMatrixPtrVector obsMean;
91 :     /**
92 :     * \brief This is the DoubleMatrixPtrVector used to store the mean length/weight information calculated in the model
93 :     * \note The indices for this object are [time][area][age]
94 :     */
95 :     DoubleMatrixPtrVector modelMean;
96 :     /**
97 :     * \brief This is the DoubleMatrixPtrVector used to store the standard deviation of the length/weight information specified in the input file
98 :     * \note The indices for this object are [time][area][age]
99 :     */
100 :     DoubleMatrixPtrVector obsStdDev;
101 :     /**
102 :     * \brief This is the DoubleMatrixPtrVector used to store the standard deviation of the length/weight information calculated in the model
103 :     * \note The indices for this object are [time][area][age]
104 :     */
105 :     DoubleMatrixPtrVector modelStdDev;
106 :     /**
107 :     * \brief This is the DoubleMatrix used to store the calculated likelihood information
108 :     * \note The indices for this object are [time][area]
109 :     */
110 :     DoubleMatrix likelihoodValues;
111 :     /**
112 :     * \brief This is the FleetPreyAggregator used to collect information about the fleets
113 :     */
114 :     FleetPreyAggregator* aggregator;
115 :     /**
116 :     * \brief This is the LengthGroupDivision used to store length information about all the stocks that will be used to calculate the likelihood score
117 :     */
118 :     LengthGroupDivision* LgrpDiv;
119 :     /**
120 :     * \brief This is the CharPtrVector of the names of the fleets that will be used to calculate the likelihood score
121 :     */
122 :     CharPtrVector fleetnames;
123 :     /**
124 :     * \brief This is the CharPtrVector of the names of the stocks that will be used to calculate the likelihood score
125 :     */
126 :     CharPtrVector stocknames;
127 :     /**
128 :     * \brief This is the IntMatrix used to store area information
129 :     */
130 :     IntMatrix areas;
131 :     /**
132 :     * \brief This is the IntMatrix used to store age information
133 :     */
134 :     IntMatrix ages;
135 :     /**
136 :     * \brief This is the CharPtrVector of the names of the areas
137 :     */
138 :     CharPtrVector areaindex;
139 :     /**
140 :     * \brief This is the CharPtrVector of the names of the age groups
141 :     */
142 :     CharPtrVector ageindex;
143 :     /**
144 :     * \brief This is the flag to denote whether the likelihood calculation should take overconsumption into account or not
145 :     */
146 :     int overconsumption;
147 :     /**
148 :     * \brief This is the index of the timesteps for the likelihood component data
149 :     */
150 :     int timeindex;
151 :     /**
152 :     * \brief This is the identifier of the function to be used to calculate the likelihood component
153 :     */
154 :     int functionnumber;
155 :     /**
156 :     * \brief This ActionAtTimes stores information about when the likelihood score should be calculated
157 :     */
158 :     ActionAtTimes AAT;
159 :     /**
160 :     * \brief This is the IntVector used to store information about the years when the likelihood score should be calculated
161 :     */
162 :     IntVector Years;
163 :     /**
164 :     * \brief This is the IntVector used to store information about the steps when the likelihood score should be calculated
165 :     */
166 :     IntVector Steps;
167 :     /**
168 :     * \brief This is the name of the function to be used to calculate the likelihood component
169 :     */
170 :     char* functionname;
171 :     /**
172 :     * \brief This is the PopStatistics used to calculate the statistics of the population
173 :     */
174 :     PopStatistics ps;
175 :     /**
176 :     * \brief This is the AgeBandMatrixPtrVector used to temporarily store the information returned from the aggregatation function
177 :     * \note The indices for this object are [area][age][length]
178 :     */
179 :     const AgeBandMatrixPtrVector* alptr;
180 :     };
181 :    
182 :     #endif

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

Powered By FusionForge