Gadget
transition.h
Go to the documentation of this file.
1 #ifndef transition_h
2 #define transition_h
3 
4 #include "areatime.h"
5 #include "formulavector.h"
6 #include "conversionindex.h"
7 #include "commentstream.h"
10 #include "stock.h"
11 
18 class Transition : public HasName, protected LivesOnAreas {
19 public:
30  Transition(CommentStream& infile, const IntVector& areas, int age,
31  const LengthGroupDivision* const lgrpdiv, const char* givenname,
32  const TimeClass* const TimeInfo, Keeper* const keeper);
36  ~Transition();
41  void setStock(StockPtrVector& stockvec);
48  void storeTransitionStock(int area, AgeBandMatrix& Alkeys, const TimeClass* const TimeInfo);
56  void storeTransitionStock(int area, AgeBandMatrix& Alkeys,
57  AgeBandMatrixRatio& TagAlkeys, const TimeClass* const TimeInfo);
63  void Move(int area, const TimeClass* const TimeInfo);
68  void Print(ofstream& outfile) const;
77  void setTagged();
82  void addTransitionTag(const char* tagname);
87  void deleteTransitionTag(const char* tagname);
91  void Reset();
97  virtual int isTransitionStep(const TimeClass* const TimeInfo);
98 protected:
114  double ratioscale;
142  int age;
150  int istagged;
151 };
152 
153 #endif
This class implements a dynamic vector of AgeBandMatrix values.
Definition: agebandmatrixptrvector.h:12
Definition: agebandmatrixratioptrvector.h:16
Definition: agebandmatrixratio.h:15
This class implements a vector of PopInfoIndexVector values, indexed from minage not 0.
Definition: agebandmatrix.h:15
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 ConversionIndex values.
Definition: conversionindexptrvector.h:10
This class implements a dynamic vector of Formula values.
Definition: formulavector.h:10
This is the base class for any object that has a name.
Definition: hasname.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 class used to store information about the areas an object is defined on for the current m...
Definition: livesonareas.h:10
IntVector areas
This is the IntVector of internal areas that the object is defined on.
Definition: livesonareas.h:51
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
This is the class used to calculate the movement from a young stock to older stocks.
Definition: transition.h:18
int minTransitionLength
This is the minimum length group of the younger stock that exists in the older stock.
Definition: transition.h:146
void Reset()
This function will reset the transition data.
Definition: transition.cc:193
int transitionStep
This is the timestep that the movement between stocks will occur on.
Definition: transition.h:130
FormulaVector transitionRatio
This is the FormulaVector of the ratio of the young stock to move into each older stock.
Definition: transition.h:110
void setTagged()
This function will initialise the tagging experiments for the transition calculations.
Definition: transition.cc:219
AgeBandMatrixPtrVector Storage
This is the AgeBandMatrixPtrVector used to store the calculated old stocks.
Definition: transition.h:134
void storeTransitionStock(int area, AgeBandMatrix &Alkeys, const TimeClass *const TimeInfo)
This will store the part of the younger stock that will move into the older stocks.
Definition: transition.cc:123
void deleteTransitionTag(const char *tagname)
This will remove a tagging experiment from the transition calculations.
Definition: transition.cc:236
CharPtrVector transitionStockNames
This is the CharPtrVector of the names of the transition stocks.
Definition: transition.h:106
double ratioscale
This is used to scale the ratios to ensure that they will always sum to 1.
Definition: transition.h:114
LengthGroupDivision * LgrpDiv
This is the LengthGroupDivision of the stock.
Definition: transition.h:126
void Move(int area, const TimeClass *const TimeInfo)
This will move the younger stock into the older stock age-length cells.
Definition: transition.cc:168
int age
This is the age that the younger stock will move into the older stocks.
Definition: transition.h:142
Transition(CommentStream &infile, const IntVector &areas, int age, const LengthGroupDivision *const lgrpdiv, const char *givenname, const TimeClass *const TimeInfo, Keeper *const keeper)
This is the Transition constructor.
Definition: transition.cc:8
void setStock(StockPtrVector &stockvec)
This will select the stocks required for the movement between stocks.
Definition: transition.cc:58
StockPtrVector transitionStocks
This is the StockPtrVector of the stocks that the young stock will move to.
Definition: transition.h:102
AgeBandMatrixRatioPtrVector tagStorage
This is the AgeBandMatrixRatioPtrVector used to store the calculated tagged stocks.
Definition: transition.h:138
~Transition()
This is the default Transition destructor.
Definition: transition.cc:49
virtual int isTransitionStep(const TimeClass *const TimeInfo)
This will check if the transition process will take place on the current timestep.
Definition: transition.cc:261
IntVector ratioindex
This is the IntVector used as an index for the ratio vector.
Definition: transition.h:118
int istagged
This is the flag used to denote whether the stock has been included in a tagging experiment or not.
Definition: transition.h:150
ConversionIndexPtrVector CI
This is the ConversionIndexPtrVector used to convert from the young stock lengths to the old stock le...
Definition: transition.h:122
void addTransitionTag(const char *tagname)
This will add a tagging experiment to the transition calculations.
Definition: transition.cc:230
void Print(ofstream &outfile) const
This function will print the transition information.
Definition: transition.cc:112
const StockPtrVector & getTransitionStocks()
This will calculate the stocks the young stock can move into.
Definition: transition.cc:215