Gadget
spawner.h
Go to the documentation of this file.
1 #ifndef spawner_h
2 #define spawner_h
3 
4 #include "areatime.h"
5 #include "formulavector.h"
6 #include "modelvariablevector.h"
7 #include "commentstream.h"
8 #include "agebandmatrix.h"
9 #include "intmatrix.h"
10 #include "livesonareas.h"
11 #include "selectfunc.h"
12 #include "stock.h"
13 
20 class SpawnData : public HasName, protected LivesOnAreas {
21 public:
33  SpawnData(CommentStream& infile, int maxage, const LengthGroupDivision* const LgrpDiv,
34  const IntVector& Areas, const AreaClass* const Area, const char* givenname,
35  const TimeClass* const TimeInfo, Keeper* const keeper);
39  ~SpawnData();
44  void setStock(StockPtrVector& stockvec);
50  void addSpawnStock(int area, const TimeClass* const TimeInfo);
57  void Spawn(AgeBandMatrix& Alkeys, int area, const TimeClass* const TimeInfo);
64  int isSpawnStepArea(int area, const TimeClass* const TimeInfo);
69  void Print(ofstream& outfile) const;
73  void Reset(const TimeClass* const TimeInfo);
74 protected:
83  double calcSpawnNumber(int age, int len, double number, double weight);
90  double calcRecruitNumber(double temp, int inarea);
106  double ratioscale;
188  int spawnAge;
197 };
198 
199 #endif
This class implements a dynamic vector of AgeBandMatrix values.
Definition: agebandmatrixptrvector.h:12
This class implements a vector of PopInfoIndexVector values, indexed from minage not 0.
Definition: agebandmatrix.h:15
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 ConversionIndex values.
Definition: conversionindexptrvector.h:10
This class implements a dynamic vector of DoubleMatrix values.
Definition: doublematrixptrvector.h:10
This class implements a dynamic vector of double values.
Definition: doublevector.h:11
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
This class implements a dynamic vector of ModelVariable values.
Definition: modelvariablevector.h:10
This is the base class used to calculate the selection level as a function of length.
Definition: selectfunc.h:14
This is the class used to calculate the affect of the spawning process on the stock,...
Definition: spawner.h:20
ModelVariableVector stockParameters
This is the ModelVariableVector used to store the parameters when calculating the recruits,...
Definition: spawner.h:180
CharPtrVector spawnStockNames
This is the CharPtrVector of the names of the spawned stocks.
Definition: spawner.h:98
AgeBandMatrixPtrVector Storage
This is the AgeBandMatrixPtrVector used to store the calculated spawned stocks.
Definition: spawner.h:160
LengthGroupDivision * LgrpDiv
This is the LengthGroupDivision of the stock.
Definition: spawner.h:132
void Reset(const TimeClass *const TimeInfo)
This function will reset the spawning data.
Definition: spawner.cc:362
SpawnData(CommentStream &infile, int maxage, const LengthGroupDivision *const LgrpDiv, const IntVector &Areas, const AreaClass *const Area, const char *givenname, const TimeClass *const TimeInfo, Keeper *const keeper)
This is the SpawnData constructor.
Definition: spawner.cc:12
int isSpawnStepArea(int area, const TimeClass *const TimeInfo)
This will check if the spawning process will take place on the current timestep and area.
Definition: spawner.cc:349
void addSpawnStock(int area, const TimeClass *const TimeInfo)
This will add the calculated spawned stock into the new stock age-length cells.
Definition: spawner.cc:295
DoubleVector spawnProportion
This is the DoubleVector of the proportion of each length group of the stock that will spawn.
Definition: spawner.h:136
int spawnLastYear
This is the last year of the simulation that the spawning will take place on.
Definition: spawner.h:120
void Print(ofstream &outfile) const
This function will print the spawning information.
Definition: spawner.cc:498
double ratioscale
This is used to scale the ratios to ensure that they will always sum to 1.
Definition: spawner.h:106
FormulaVector spawnRatio
This is the FormulaVector of the ratio of the new stock to move into each spawned stock.
Definition: spawner.h:102
double calcRecruitNumber(double temp, int inarea)
This function will calculate the total number of recruits that have been created by the spawning proc...
Definition: spawner.cc:449
int onlyParent
This is the flag used to denote whether the spawning process should include the creation of the recru...
Definition: spawner.h:184
IntVector spawnArea
This is the IntVector used to store information about the areas where the spawning takes place.
Definition: spawner.h:128
double calcSpawnNumber(int age, int len, double number, double weight)
This function will calculate the number of recruits that will be created by the spawning process on t...
Definition: spawner.cc:425
int spawnAge
This is the age that the spawned stock will move into the new stocks.
Definition: spawner.h:188
void setStock(StockPtrVector &stockvec)
This will select the stocks required for the spawning process.
Definition: spawner.cc:205
SelectFunc * fnMortality
This is the SelectFunc used to calculate of the proportion of each length group of the stock that wil...
Definition: spawner.h:152
LengthGroupDivision * spawnLgrpDiv
This is the LengthGroupDivision of the spawned stock.
Definition: spawner.h:168
void Spawn(AgeBandMatrix &Alkeys, int area, const TimeClass *const TimeInfo)
This will calculate the.
Definition: spawner.cc:268
ConversionIndexPtrVector CI
This is the ConversionIndexPtrVector used to convert to the stock lengths for the spawned stock.
Definition: spawner.h:164
DoubleVector spawnWeightLoss
This is the DoubleVector of the weight loss of each length group of the stock due to the spawning pro...
Definition: spawner.h:144
DoubleMatrixPtrVector spawnNumbers
This is the DoubleMatrix used to store the numbers of the recruits, if the spawning process is to inc...
Definition: spawner.h:172
IntVector ratioindex
This is the IntVector used as an index for the ratio vector.
Definition: spawner.h:110
SelectFunc * fnProportion
This is the SelectFunc used to calculate of the proportion of each length group of the stock that wil...
Definition: spawner.h:148
StockPtrVector spawnStocks
This is the StockPtrVector of the stocks that will be spawned.
Definition: spawner.h:94
ModelVariableVector spawnParameters
This is the ModelVariableVector used to store the parameters when calculating the recruitment from th...
Definition: spawner.h:176
char * functionname
This is the name of the function to be used to calculate the number of recruits.
Definition: spawner.h:196
int functionnumber
This is the identifier of the function to be used to calculate the number of recruits.
Definition: spawner.h:192
~SpawnData()
This is the default SpawnData destructor.
Definition: spawner.cc:189
IntVector spawnStep
This is the IntVector used to store information about the steps when the spawning takes place.
Definition: spawner.h:124
int spawnFirstYear
This is the first year of the simulation that the spawning will take place on.
Definition: spawner.h:115
SelectFunc * fnWeightLoss
This is the SelectFunc used to calculate of the weight loss of each length group of the stock due to ...
Definition: spawner.h:156
DoubleVector spawnMortality
This is the DoubleVector of the proportion of each length group of the stock that will die due to the...
Definition: spawner.h:140
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