Gadget
surveydistribution.h
Go to the documentation of this file.
1 #ifndef surveydistribution_h
2 #define surveydistribution_h
3 
4 #include "likelihood.h"
5 #include "stockaggregator.h"
7 #include "actionattimes.h"
8 #include "formulavector.h"
9 #include "modelvariablevector.h"
10 #include "suitfunc.h"
11 
22 public:
32  SurveyDistribution(CommentStream& infile, const AreaClass* const Area,
33  const TimeClass* const TimeInfo, Keeper* const keeper, double weight, const char* name);
37  virtual ~SurveyDistribution();
42  virtual void addLikelihood(const TimeClass* const TimeInfo);
47  virtual void Reset(const Keeper* const keeper);
52  virtual void Print(ofstream& outfile) const;
58  void setFleetsAndStocks(FleetPtrVector& Fleets, StockPtrVector& Stocks);
64  virtual void printLikelihood(ofstream& outfile, const TimeClass* const TimeInfo);
69  virtual void printSummary(ofstream& outfile);
70 private:
79  void readDistributionData(CommentStream& infile, const TimeClass* TimeInfo,
80  int numarea, int numage, int numlen);
85  void calcIndex(const TimeClass* const TimeInfo);
90  double calcLikMultinomial();
95  double calcLikPearson();
100  double calcLikGamma();
105  double calcLikLog();
109  StockAggregator* aggregator;
113  CharPtrVector stocknames;
117  IntMatrix areas;
121  IntMatrix ages;
125  DoubleVector lengths;
129  CharPtrVector areaindex;
133  CharPtrVector ageindex;
137  CharPtrVector lenindex;
141  LengthGroupDivision* LgrpDiv;
145  char* fittype;
149  int fitnumber;
153  char* liketype;
157  int likenumber;
161  ActionAtTimes AAT;
165  IntVector Years;
169  IntVector Steps;
174  DoubleMatrixPtrMatrix obsDistribution;
179  DoubleMatrixPtrMatrix modelDistribution;
183  DoubleMatrix likelihoodValues;
187  int timeindex;
191  double epsilon;
195  SuitFunc* suitfunction;
199  DoubleVector suit;
203  ModelVariableVector parameters;
207  const AgeBandMatrixPtrVector* alptr;
208 };
209 
210 #endif
This is the class used to associate actions with specific timesteps within the model.
Definition: actionattimes.h:14
This class implements a dynamic vector of AgeBandMatrix values.
Definition: agebandmatrixptrvector.h:12
This is the class used to store information about the areas used for the current model.
Definition: areatime.h:18
This class implements a dynamic vector of char values.
Definition: charptrvector.h:8
This is the class used to strip comments (and whitespace) from any input stream.
Definition: commentstream.h:40
This class implements a dynamic vector of DoubleMatrixPtrVector values.
Definition: doublematrixptrmatrix.h:13
This class implements a dynamic vector of DoubleVector values.
Definition: doublematrix.h:11
This class implements a dynamic vector of double values.
Definition: doublevector.h:11
This class implements a dynamic vector of Fleet values.
Definition: fleetptrvector.h:10
This class implements a dynamic vector of IntVector values.
Definition: intmatrix.h:10
This class implements a dynamic vector of int values.
Definition: intvector.h:11
This is the class used to store information about the variables that are used in model simulation.
Definition: keeper.h:17
This is the class used to store information about the length groups of the modelled stock population.
Definition: lengthgroup.h:10
This is the base class used to calculate the likelihood scores used to compare the modelled data in t...
Definition: likelihood.h:24
double weight
This stores the weight to be applied to the likelihood component.
Definition: likelihood.h:112
This class implements a dynamic vector of ModelVariable values.
Definition: modelvariablevector.h:10
This is the class used to aggregate stock information.
Definition: stockaggregator.h:14
This class implements a dynamic vector of Stock values.
Definition: stockptrvector.h:10
This is the base class used to calculate the predator prey suitability value.
Definition: suitfunc.h:14
This is the class used to calculate a likelihood score based on survey data compiled from the stocks ...
Definition: surveydistribution.h:21
virtual void Print(ofstream &outfile) const
This function will print the summary SurveyDistribution likelihood information.
Definition: surveydistribution.cc:323
virtual void printSummary(ofstream &outfile)
This function will print summary information from each SurveyDistribution likelihood calculation.
Definition: surveydistribution.cc:627
SurveyDistribution(CommentStream &infile, const AreaClass *const Area, const TimeClass *const TimeInfo, Keeper *const keeper, double weight, const char *name)
This is the SurveyDistribution constructor.
Definition: surveydistribution.cc:13
virtual void addLikelihood(const TimeClass *const TimeInfo)
This function will calculate the likelihood score for the SurveyDistribution component.
Definition: surveydistribution.cc:479
virtual void printLikelihood(ofstream &outfile, const TimeClass *const TimeInfo)
This function will print information from each SurveyDistribution calculation.
Definition: surveydistribution.cc:334
void setFleetsAndStocks(FleetPtrVector &Fleets, StockPtrVector &Stocks)
This will select the fleets and stocks required to calculate the SurveyDistribution likelihood score.
Definition: surveydistribution.cc:365
virtual void Reset(const Keeper *const keeper)
This function will reset the SurveyDistribution likelihood information.
Definition: surveydistribution.cc:311
virtual ~SurveyDistribution()
This is the default SurveyDistribution destructor.
Definition: surveydistribution.cc:282
This is the class used to store information about the timesteps used for the current model.
Definition: areatime.h:87