Gadget
|
This is the class used to calculate the affect of the spawning process on the stock, possibly including the creation of new recruits into the model. More...
#include <spawner.h>
Public Member Functions | |
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. More... | |
~SpawnData () | |
This is the default SpawnData destructor. More... | |
void | setStock (StockPtrVector &stockvec) |
This will select the stocks required for the spawning process. More... | |
void | addSpawnStock (int area, const TimeClass *const TimeInfo) |
This will add the calculated spawned stock into the new stock age-length cells. More... | |
void | Spawn (AgeBandMatrix &Alkeys, int area, const TimeClass *const TimeInfo) |
This will calculate the. More... | |
int | isSpawnStepArea (int area, const TimeClass *const TimeInfo) |
This will check if the spawning process will take place on the current timestep and area. More... | |
void | Print (ofstream &outfile) const |
This function will print the spawning information. More... | |
void | Reset (const TimeClass *const TimeInfo) |
This function will reset the spawning data. More... | |
![]() | |
HasName () | |
This is the default HasName constructor. More... | |
virtual | ~HasName () |
This is the default HasName destructor. More... | |
HasName (const char *givenname) | |
This is the HasName constructor for a specified name. More... | |
const char * | getName () const |
This will return a null terminated text string containing the name of the object. More... | |
Protected Member Functions | |
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 the current timestep, for a given age-length cell of the spawning stock. More... | |
double | calcRecruitNumber (double temp, int inarea) |
This function will calculate the total number of recruits that have been created by the spawning process on the current timestep. More... | |
![]() | |
void | storeAreas (const IntVector &Areas) |
This function will store the internal areas to be used. More... | |
LivesOnAreas () | |
This is the default LivesOnAreas constructor. More... | |
virtual | ~LivesOnAreas () |
This is the default LivesOnAreas destructor. More... | |
LivesOnAreas (const IntVector &Areas) | |
This is the LivesOnAreas constructor for a specified vector of areas. More... | |
int | isInArea (int area) const |
This function will check whether the object is defined on a specified area. More... | |
IntVector & | getAreas () |
This function will return the internal areas that the object is defined on. More... | |
int | areaNum (int area) const |
This function will return the area associated with an internal area. More... | |
Protected Attributes | |
StockPtrVector | spawnStocks |
This is the StockPtrVector of the stocks that will be spawned. More... | |
CharPtrVector | spawnStockNames |
This is the CharPtrVector of the names of the spawned stocks. More... | |
FormulaVector | spawnRatio |
This is the FormulaVector of the ratio of the new stock to move into each spawned stock. More... | |
double | ratioscale |
This is used to scale the ratios to ensure that they will always sum to 1. More... | |
IntVector | ratioindex |
This is the IntVector used as an index for the ratio vector. More... | |
int | spawnFirstYear |
This is the first year of the simulation that the spawning will take place on. More... | |
int | spawnLastYear |
This is the last year of the simulation that the spawning will take place on. More... | |
IntVector | spawnStep |
This is the IntVector used to store information about the steps when the spawning takes place. More... | |
IntVector | spawnArea |
This is the IntVector used to store information about the areas where the spawning takes place. More... | |
LengthGroupDivision * | LgrpDiv |
This is the LengthGroupDivision of the stock. More... | |
DoubleVector | spawnProportion |
This is the DoubleVector of the proportion of each length group of the stock that will spawn. More... | |
DoubleVector | spawnMortality |
This is the DoubleVector of the proportion of each length group of the stock that will die due to the spawning process. More... | |
DoubleVector | spawnWeightLoss |
This is the DoubleVector of the weight loss of each length group of the stock due to the spawning process. More... | |
SelectFunc * | fnProportion |
This is the SelectFunc used to calculate of the proportion of each length group of the stock that will spawn. More... | |
SelectFunc * | fnMortality |
This is the SelectFunc used to calculate of the proportion of each length group of the stock that will die due to the spawning process. More... | |
SelectFunc * | fnWeightLoss |
This is the SelectFunc used to calculate of the weight loss of each length group of the stock due to the spawning process. More... | |
AgeBandMatrixPtrVector | Storage |
This is the AgeBandMatrixPtrVector used to store the calculated spawned stocks. More... | |
ConversionIndexPtrVector | CI |
This is the ConversionIndexPtrVector used to convert to the stock lengths for the spawned stock. More... | |
LengthGroupDivision * | spawnLgrpDiv |
This is the LengthGroupDivision of the spawned stock. More... | |
DoubleMatrixPtrVector | spawnNumbers |
This is the DoubleMatrix used to store the numbers of the recruits, if the spawning process is to include the creation of the recruits. More... | |
ModelVariableVector | spawnParameters |
This is the ModelVariableVector used to store the parameters when calculating the recruitment from the spawning process, if the spawning process is to include the creation of the recruits. More... | |
ModelVariableVector | stockParameters |
This is the ModelVariableVector used to store the parameters when calculating the recruits, if the spawning process is to include the creation of the recruits. More... | |
int | onlyParent |
This is the flag used to denote whether the spawning process should include the creation of the recruits. More... | |
int | spawnAge |
This is the age that the spawned stock will move into the new stocks. More... | |
int | functionnumber |
This is the identifier of the function to be used to calculate the number of recruits. More... | |
char * | functionname |
This is the name of the function to be used to calculate the number of recruits. More... | |
![]() | |
IntVector | areas |
This is the IntVector of internal areas that the object is defined on. More... | |
This is the class used to calculate the affect of the spawning process on the stock, possibly including the creation of new recruits into the model.
This class calculates the proportion of the stock that should be removed from the model due to the spawning process, and the affect that the spawning process has on the remaining stock. This class can optionally add new recruits into the model due to the spawning process, implementing a closed life cycle model. For the 'parent' stock, the spawning process can remove a proportion of the stock due to a spawning mortality, and reduce the weight of those that survive. For the 'child' stock, the spawning process will create a number of recruits based on a recruitment function, and then add these into the model in a similar way to the RenewalData class.
SpawnData::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.
infile | is the CommentStream to read the spawning data from |
maxage | is the maximum age of the spawning stock |
LgrpDiv | is the LengthGroupDivision that the spawning stock will be calculated on |
Areas | is the IntVector of areas that the spawning stock will be calculated on |
Area | is the AreaClass for the current model |
givenname | is the name of the stock for this SpawnData class |
TimeInfo | is the TimeClass for the current model |
keeper | is the Keeper for the current model |
SpawnData::~SpawnData | ( | ) |
This is the default SpawnData destructor.
void SpawnData::addSpawnStock | ( | int | area, |
const TimeClass *const | TimeInfo | ||
) |
This will add the calculated spawned stock into the new stock age-length cells.
area | is the area that the spawning process is being calculated on |
TimeInfo | is the TimeClass for the current model |
|
protected |
This function will calculate the total number of recruits that have been created by the spawning process on the current timestep.
temp | is the current temperature |
inarea | is the current area identifier |
|
protected |
This function will calculate the number of recruits that will be created by the spawning process on the current timestep, for a given age-length cell of the spawning stock.
age | is the age of the spawning stock |
len | is the length of the spawning stock |
number | is the number of the spawning stock in the age-length cell |
weight | is the weight of the spawning stock in the age-length cell |
int SpawnData::isSpawnStepArea | ( | int | area, |
const TimeClass *const | TimeInfo | ||
) |
This will check if the spawning process will take place on the current timestep and area.
area | is the area that the spawning is being calculated on |
TimeInfo | is the TimeClass for the current model |
void SpawnData::Print | ( | ofstream & | outfile | ) | const |
This function will print the spawning information.
outfile | is the ofstream that all the model information gets sent to |
void SpawnData::Reset | ( | const TimeClass *const | TimeInfo | ) |
This function will reset the spawning data.
void SpawnData::setStock | ( | StockPtrVector & | stockvec | ) |
This will select the stocks required for the spawning process.
stockvec | is the StockPtrVector of all the available stocks |
void SpawnData::Spawn | ( | AgeBandMatrix & | Alkeys, |
int | area, | ||
const TimeClass *const | TimeInfo | ||
) |
This will calculate the.
Alkeys | is the AgeBandMatrix of the spawning stock |
area | is the area that the transition is being calculated on |
TimeInfo | is the TimeClass for the current model |
|
protected |
This is the ConversionIndexPtrVector used to convert to the stock lengths for the spawned stock.
|
protected |
This is the SelectFunc used to calculate of the proportion of each length group of the stock that will die due to the spawning process.
|
protected |
This is the SelectFunc used to calculate of the proportion of each length group of the stock that will spawn.
|
protected |
This is the SelectFunc used to calculate of the weight loss of each length group of the stock due to the spawning process.
|
protected |
This is the name of the function to be used to calculate the number of recruits.
|
protected |
This is the identifier of the function to be used to calculate the number of recruits.
|
protected |
This is the LengthGroupDivision of the stock.
|
protected |
This is the flag used to denote whether the spawning process should include the creation of the recruits.
|
protected |
This is the IntVector used as an index for the ratio vector.
|
protected |
This is used to scale the ratios to ensure that they will always sum to 1.
|
protected |
This is the age that the spawned stock will move into the new stocks.
|
protected |
This is the IntVector used to store information about the areas where the spawning takes place.
|
protected |
This is the first year of the simulation that the spawning will take place on.
|
protected |
This is the last year of the simulation that the spawning will take place on.
|
protected |
This is the LengthGroupDivision of the spawned stock.
|
protected |
This is the DoubleVector of the proportion of each length group of the stock that will die due to the spawning process.
|
protected |
This is the DoubleMatrix used to store the numbers of the recruits, if the spawning process is to include the creation of the recruits.
|
protected |
This is the ModelVariableVector used to store the parameters when calculating the recruitment from the spawning process, if the spawning process is to include the creation of the recruits.
|
protected |
This is the DoubleVector of the proportion of each length group of the stock that will spawn.
|
protected |
This is the FormulaVector of the ratio of the new stock to move into each spawned stock.
|
protected |
This is the IntVector used to store information about the steps when the spawning takes place.
|
protected |
This is the CharPtrVector of the names of the spawned stocks.
|
protected |
This is the StockPtrVector of the stocks that will be spawned.
|
protected |
This is the DoubleVector of the weight loss of each length group of the stock due to the spawning process.
|
protected |
This is the ModelVariableVector used to store the parameters when calculating the recruits, if the spawning process is to include the creation of the recruits.
|
protected |
This is the AgeBandMatrixPtrVector used to store the calculated spawned stocks.