Gadget
proglikelihood.h
Go to the documentation of this file.
1 #ifndef proglikelihood_h
2 #define proglikelihood_h
3 
4 #include "likelihood.h"
5 #include "areatime.h"
6 #include "commentstream.h"
7 #include "charptrvector.h"
8 #include "intvector.h"
9 #include "stock.h"
10 #include "fleet.h"
11 #include "stockptrvector.h"
12 #include "fleetptrvector.h"
13 #include "doublevector.h"
14 #include "readword.h"
15 #include "formulamatrix.h"
16 #include "modelvariable.h"
17 
23 class ProgLikelihood : public Likelihood {
24 public:
34  ProgLikelihood(CommentStream& infile, const AreaClass* const Area,
35  const TimeClass* const TimeInfo, Keeper* const keeper, double weight, const char* name);
39  virtual ~ProgLikelihood() {};
40  // check if anything is needed in the destructor.
46  virtual void addLikelihood(const TimeClass* const TimeInfo);
47  void setFleetsAndStocks(FleetPtrVector& Fleets, StockPtrVector& Stocks);
48  void Reset(const Keeper* const keeper);
49  void Reset(const TimeClass* const TimeInfo);
50  virtual void PrintLog(ofstream& outfile) const;
51  virtual void Print(ofstream& outfile) const;
52  virtual void printLikelihood(ofstream& outfile,const TimeClass* const TimeInfo);
53 
54 protected:
55  void CalcTac(const TimeClass* const TimeInfo);
56  void AllocateTac(const TimeClass* const TimeInfo);
57  void CalcBiomass(const TimeClass* const TimeInfo);
63 private:
68  CharPtrVector fleetnames;
69  CharPtrVector stocknames; // names of stock for example lingimm lingmat
70  FormulaVector fleetproportions; // Proportion of TAC on each fleet
71  FleetPtrVector fleets;
72  StockPtrVector stocks;
73  FormulaMatrix biocoeffs; // Selection for fishable biomass i.e biomass number 1.
74  FormulaMatrix triggercoeffs; // Selection for trigger biomass i.e biomass number 2.
75  FormulaVector triggervalues; // Triggerpoints in biomass.
76  FormulaVector harvestrates; // Harvest proportions below trigger1, between trigger 2 and 3 trigger 4 and 5 etc
77  IntVector quotasteps; // Steps that the quota is put on 3 4 5 6 means 3-6 timesteps from current timestep
78  DoubleVector quotaproportions; //Proportion of quota on each timestep.
79  int assessmentstep; // The timestep when quota is calculated
80  DoubleVector tachistory; // The tac each year. Refers to the assessment year
81  double lastyearstac; // last Tac
82  Formula weightoflastyearstac; // Weight of last years tac 0.5 in icecod HCR
83  double maxchange; // Maximum change allowed 0.2 means lasttac/(1+0.2) < tac > lasttac*(1+0.2)
84  int functionnumber; // Number of function.
85  DoubleVector bio1; //fishable biomass biocoeffs
86  DoubleVector bio2; // triggerbiomass triggercoeffs
87  DoubleVector bio1werr; //fishable biomass biocoeffs+error
88  DoubleVector bio2werr; // triggerbiomass triggercoeffs+error
89  DoubleVector historicalhr; // Vector of Harvestrates
90  double calculatedtac; // The tac calculated
91  int firsttacyear; // The first year that TAC is compiled.
92  ModelVariable asserr;
93  ModelVariable implerr;
94  int firstyear; // First year of simulations just TimeInfo->getFirstYear()
95 };
96 
97 #endif
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 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 FormulaVector values.
Definition: formulamatrix.h:11
This class implements a dynamic vector of Formula values.
Definition: formulavector.h:10
This is the class used to calculate the value of the variables used in the model simulation.
Definition: formula.h:18
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 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 is the base class used to calculate the value of variables used in the model simulation that are...
Definition: modelvariable.h:19
This is really a prediction class.
Definition: proglikelihood.h:23
void AllocateTac(const TimeClass *const TimeInfo)
Definition: proglikelihood.cc:321
virtual ~ProgLikelihood()
This is the default BoundLikelihood destructor.
Definition: proglikelihood.h:39
void CalcTac(const TimeClass *const TimeInfo)
Definition: proglikelihood.cc:352
virtual void addLikelihood(const TimeClass *const TimeInfo)
This function will calculate the likelihood score for the current model.
Definition: proglikelihood.cc:390
void setFleetsAndStocks(FleetPtrVector &Fleets, StockPtrVector &Stocks)
This will select the fleets and stocks required to calculate the likelihood score.
Definition: proglikelihood.cc:202
virtual void Print(ofstream &outfile) const
This function will print the summary likelihood information.
Definition: proglikelihood.cc:289
void CalcBiomass(const TimeClass *const TimeInfo)
Definition: proglikelihood.cc:337
virtual void printLikelihood(ofstream &outfile, const TimeClass *const TimeInfo)
This function will print information from each likelihood calculation.
Definition: proglikelihood.cc:292
void Reset(const Keeper *const keeper)
This function will reset the likelihood information.
Definition: proglikelihood.cc:314
ProgLikelihood(CommentStream &infile, const AreaClass *const Area, const TimeClass *const TimeInfo, Keeper *const keeper, double weight, const char *name)
This is the default BoundLikelihood contructor.
Definition: proglikelihood.cc:11
virtual void PrintLog(ofstream &outfile) const
Definition: proglikelihood.cc:231
This class implements a dynamic vector of Stock values.
Definition: stockptrvector.h:10
This is the class used to store information about the timesteps used for the current model.
Definition: areatime.h:87