Gadget
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
SpawnData Class Reference

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>

Inheritance diagram for SpawnData:
Inheritance graph
Collaboration diagram for SpawnData:
Collaboration graph

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...
 
- Public Member Functions inherited from HasName
 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...
 
- Protected Member Functions inherited from LivesOnAreas
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...
 
IntVectorgetAreas ()
 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...
 
LengthGroupDivisionLgrpDiv
 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...
 
SelectFuncfnProportion
 This is the SelectFunc used to calculate of the proportion of each length group of the stock that will spawn. More...
 
SelectFuncfnMortality
 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...
 
SelectFuncfnWeightLoss
 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...
 
LengthGroupDivisionspawnLgrpDiv
 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...
 
- Protected Attributes inherited from LivesOnAreas
IntVector areas
 This is the IntVector of internal areas that the object is defined on. More...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ SpawnData()

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.

Parameters
infileis the CommentStream to read the spawning data from
maxageis the maximum age of the spawning stock
LgrpDivis the LengthGroupDivision that the spawning stock will be calculated on
Areasis the IntVector of areas that the spawning stock will be calculated on
Areais the AreaClass for the current model
givennameis the name of the stock for this SpawnData class
TimeInfois the TimeClass for the current model
keeperis the Keeper for the current model

◆ ~SpawnData()

SpawnData::~SpawnData ( )

This is the default SpawnData destructor.

Member Function Documentation

◆ addSpawnStock()

void SpawnData::addSpawnStock ( int  area,
const TimeClass *const  TimeInfo 
)

This will add the calculated spawned stock into the new stock age-length cells.

Parameters
areais the area that the spawning process is being calculated on
TimeInfois the TimeClass for the current model

◆ calcRecruitNumber()

double SpawnData::calcRecruitNumber ( double  temp,
int  inarea 
)
protected

This function will calculate the total number of recruits that have been created by the spawning process on the current timestep.

Parameters
tempis the current temperature
inareais the current area identifier
Returns
total number of recruits

◆ calcSpawnNumber()

double SpawnData::calcSpawnNumber ( int  age,
int  len,
double  number,
double  weight 
)
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.

Parameters
ageis the age of the spawning stock
lenis the length of the spawning stock
numberis the number of the spawning stock in the age-length cell
weightis the weight of the spawning stock in the age-length cell
Returns
number of recruits

◆ isSpawnStepArea()

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.

Parameters
areais the area that the spawning is being calculated on
TimeInfois the TimeClass for the current model
Returns
1 if the spawning process will take place, 0 otherwise

◆ Print()

void SpawnData::Print ( ofstream &  outfile) const

This function will print the spawning information.

Parameters
outfileis the ofstream that all the model information gets sent to

◆ Reset()

void SpawnData::Reset ( const TimeClass *const  TimeInfo)

This function will reset the spawning data.

◆ setStock()

void SpawnData::setStock ( StockPtrVector stockvec)

This will select the stocks required for the spawning process.

Parameters
stockvecis the StockPtrVector of all the available stocks

◆ Spawn()

void SpawnData::Spawn ( AgeBandMatrix Alkeys,
int  area,
const TimeClass *const  TimeInfo 
)

This will calculate the.

Parameters
Alkeysis the AgeBandMatrix of the spawning stock
areais the area that the transition is being calculated on
TimeInfois the TimeClass for the current model

Member Data Documentation

◆ CI

ConversionIndexPtrVector SpawnData::CI
protected

This is the ConversionIndexPtrVector used to convert to the stock lengths for the spawned stock.

◆ fnMortality

SelectFunc* SpawnData::fnMortality
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.

◆ fnProportion

SelectFunc* SpawnData::fnProportion
protected

This is the SelectFunc used to calculate of the proportion of each length group of the stock that will spawn.

◆ fnWeightLoss

SelectFunc* SpawnData::fnWeightLoss
protected

This is the SelectFunc used to calculate of the weight loss of each length group of the stock due to the spawning process.

◆ functionname

char* SpawnData::functionname
protected

This is the name of the function to be used to calculate the number of recruits.

◆ functionnumber

int SpawnData::functionnumber
protected

This is the identifier of the function to be used to calculate the number of recruits.

◆ LgrpDiv

LengthGroupDivision* SpawnData::LgrpDiv
protected

This is the LengthGroupDivision of the stock.

◆ onlyParent

int SpawnData::onlyParent
protected

This is the flag used to denote whether the spawning process should include the creation of the recruits.

◆ ratioindex

IntVector SpawnData::ratioindex
protected

This is the IntVector used as an index for the ratio vector.

◆ ratioscale

double SpawnData::ratioscale
protected

This is used to scale the ratios to ensure that they will always sum to 1.

◆ spawnAge

int SpawnData::spawnAge
protected

This is the age that the spawned stock will move into the new stocks.

◆ spawnArea

IntVector SpawnData::spawnArea
protected

This is the IntVector used to store information about the areas where the spawning takes place.

◆ spawnFirstYear

int SpawnData::spawnFirstYear
protected

This is the first year of the simulation that the spawning will take place on.

Note
This is optional, and will default to the first year of the simulation if it is not specified

◆ spawnLastYear

int SpawnData::spawnLastYear
protected

This is the last year of the simulation that the spawning will take place on.

Note
This is optional, and will default to the last year of the simulation if it is not specified

◆ spawnLgrpDiv

LengthGroupDivision* SpawnData::spawnLgrpDiv
protected

This is the LengthGroupDivision of the spawned stock.

◆ spawnMortality

DoubleVector SpawnData::spawnMortality
protected

This is the DoubleVector of the proportion of each length group of the stock that will die due to the spawning process.

◆ spawnNumbers

DoubleMatrixPtrVector SpawnData::spawnNumbers
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.

◆ spawnParameters

ModelVariableVector SpawnData::spawnParameters
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.

◆ spawnProportion

DoubleVector SpawnData::spawnProportion
protected

This is the DoubleVector of the proportion of each length group of the stock that will spawn.

◆ spawnRatio

FormulaVector SpawnData::spawnRatio
protected

This is the FormulaVector of the ratio of the new stock to move into each spawned stock.

◆ spawnStep

IntVector SpawnData::spawnStep
protected

This is the IntVector used to store information about the steps when the spawning takes place.

◆ spawnStockNames

CharPtrVector SpawnData::spawnStockNames
protected

This is the CharPtrVector of the names of the spawned stocks.

◆ spawnStocks

StockPtrVector SpawnData::spawnStocks
protected

This is the StockPtrVector of the stocks that will be spawned.

◆ spawnWeightLoss

DoubleVector SpawnData::spawnWeightLoss
protected

This is the DoubleVector of the weight loss of each length group of the stock due to the spawning process.

◆ stockParameters

ModelVariableVector SpawnData::stockParameters
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.

◆ Storage

AgeBandMatrixPtrVector SpawnData::Storage
protected

This is the AgeBandMatrixPtrVector used to store the calculated spawned stocks.


The documentation for this class was generated from the following files: