Gadget
Public Member Functions | Protected Attributes | List of all members
Maturity Class Referenceabstract

This is the base class used to calculate the maturity of a stock within the model. More...

#include <maturity.h>

Inheritance diagram for Maturity:
Inheritance graph
Collaboration diagram for Maturity:
Collaboration graph

Public Member Functions

 Maturity ()
 This is the default Maturity constructor. More...
 
 Maturity (const IntVector &areas, int minage, int numage, const LengthGroupDivision *const LgrpDiv, const char *givenname)
 This is the Maturity constructor. More...
 
virtual ~Maturity ()
 This is the default Maturity destructor. More...
 
virtual void setStock (StockPtrVector &stockvec)
 This will select the stocks required for the maturation process. More...
 
virtual void Print (ofstream &outfile) const
 This function will print the maturation information. More...
 
virtual void Reset (const TimeClass *const TimeInfo)
 This will reset the maturation information for the current model run. More...
 
virtual int isMaturationStep (const TimeClass *const TimeInfo)=0
 This will check if the maturation process will take place on the current timestep. More...
 
virtual double calcMaturation (int age, int length, int growth, double weight)=0
 This will calculate the probability of maturation for a given age and length of the immature stock. More...
 
void storeMatureStock (int area, int age, int length, double number, double weight)
 This will store the calculated mature stock. More...
 
void storeMatureTagStock (int area, int age, int length, double number, int id)
 This will store the calculated mature tagged stock. More...
 
void Move (int area, const TimeClass *const TimeInfo)
 This will move the calculated mature stock into the mature stock age-length cells. More...
 
const StockPtrVectorgetMatureStocks ()
 This will calculate the mature stocks the immature stock can mature into. More...
 
void setTagged ()
 This function will initialise the tagging experiments for the maturation calculations. More...
 
void addMaturityTag (const char *tagname)
 This will add a tagging experiment to the maturation calculations. More...
 
void deleteMaturityTag (const char *tagname)
 This will remove a tagging experiment from the maturation calculations. 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 Attributes

double tmpratio
 This is used to temporarily store the maturation ratio. More...
 
StockPtrVector matureStocks
 This is the StockPtrVector of the mature stocks. More...
 
CharPtrVector matureStockNames
 This is the CharPtrVector of the names of the mature stocks. More...
 
FormulaVector matureRatio
 This is the FormulaVector of the ratio of the immature stock to mature into each mature 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...
 
ConversionIndexPtrVector CI
 This is the ConversionIndexPtrVector used to convert from the immature stock lengths to the mature stock lengths. More...
 
LengthGroupDivisionLgrpDiv
 This is the LengthGroupDivision of the stock. More...
 
- Protected Attributes inherited from LivesOnAreas
IntVector areas
 This is the IntVector of internal areas that the object is defined on. More...
 

Additional Inherited Members

- 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...
 

Detailed Description

This is the base class used to calculate the maturity of a stock within the model.

This class moves fish from an immature stock to matures stocks within the model. The proportion of those fish in the immature stock that mature is calulated according to the different maturity functions of the derived classes, and then that propotion is moved into the mature stocks. The length and age groups of the mature stocks are checked, and any fish that haven't yet reached the minimum length or age of the mature stock remain in the immature stock.

Note
This will always be overridden by the derived classes that actually calculate the maturity

Constructor & Destructor Documentation

◆ Maturity() [1/2]

Maturity::Maturity ( )

This is the default Maturity constructor.

◆ Maturity() [2/2]

Maturity::Maturity ( const IntVector areas,
int  minage,
int  numage,
const LengthGroupDivision *const  LgrpDiv,
const char *  givenname 
)

This is the Maturity constructor.

Parameters
areasis the IntVector of areas that the maturity calculation can take place on
minageis the minimum age of the stock that can mature
numageis the number of age groups for the stock that can mature
LgrpDivis the LengthGroupDivision for the stock
givennameis the name of the stock for this Maturity class

◆ ~Maturity()

Maturity::~Maturity ( )
virtual

This is the default Maturity destructor.

Member Function Documentation

◆ addMaturityTag()

void Maturity::addMaturityTag ( const char *  tagname)

This will add a tagging experiment to the maturation calculations.

Parameters
tagnameis the name of the tagging experiment

◆ calcMaturation()

virtual double Maturity::calcMaturation ( int  age,
int  length,
int  growth,
double  weight 
)
pure virtual

This will calculate the probability of maturation for a given age and length of the immature stock.

Parameters
ageis the age of the age-length cell that the maturation is being calculated on
lengthis the length of the age-length cell that the maturation is being calculated on
growthis the length of the age-length cell that the mature stock will grow into
weightis the weight of the fish of the age-length cell that are maturing
Returns
0 (will be overridden in derived classes)

Implemented in MaturityD, MaturityC, MaturityB, and MaturityA.

◆ deleteMaturityTag()

void Maturity::deleteMaturityTag ( const char *  tagname)

This will remove a tagging experiment from the maturation calculations.

Parameters
tagnameis the name of the tagging experiment

◆ getMatureStocks()

const StockPtrVector & Maturity::getMatureStocks ( )

This will calculate the mature stocks the immature stock can mature into.

Returns
mature stocks

◆ isMaturationStep()

virtual int Maturity::isMaturationStep ( const TimeClass *const  TimeInfo)
pure virtual

This will check if the maturation process will take place on the current timestep.

Parameters
TimeInfois the TimeClass for the current model
Returns
0 (will be overridden in derived classes)

Implemented in MaturityD, MaturityC, MaturityB, and MaturityA.

◆ Move()

void Maturity::Move ( int  area,
const TimeClass *const  TimeInfo 
)

This will move the calculated mature stock into the mature stock age-length cells.

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

◆ Print()

void Maturity::Print ( ofstream &  outfile) const
virtual

This function will print the maturation information.

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

Reimplemented in MaturityD, MaturityC, MaturityB, and MaturityA.

◆ Reset()

void Maturity::Reset ( const TimeClass *const  TimeInfo)
virtual

This will reset the maturation information for the current model run.

Parameters
TimeInfois the TimeClass for the current model

Reimplemented in MaturityD, MaturityC, MaturityB, and MaturityA.

◆ setStock()

void Maturity::setStock ( StockPtrVector stockvec)
virtual

This will select the stocks required for the maturation process.

Parameters
stockvecis the StockPtrVector of all the available stocks

Reimplemented in MaturityD, MaturityC, MaturityB, and MaturityA.

◆ setTagged()

void Maturity::setTagged ( )

This function will initialise the tagging experiments for the maturation calculations.

◆ storeMatureStock()

void Maturity::storeMatureStock ( int  area,
int  age,
int  length,
double  number,
double  weight 
)

This will store the calculated mature stock.

Parameters
areais the area that the maturation is being calculated on
ageis the age of the calculated mature stock
lengthis the length of the calculated mature stock
numberis the number of the calculated mature stock
weightis the weight of the calculated mature stock

◆ storeMatureTagStock()

void Maturity::storeMatureTagStock ( int  area,
int  age,
int  length,
double  number,
int  id 
)

This will store the calculated mature tagged stock.

Parameters
areais the area that the maturation is being calculated on
ageis the age of the calculated mature stock
lengthis the length of the calculated mature stock
numberis the number of the calculated mature stock
idis the tagging identifier of the mature stock

Member Data Documentation

◆ CI

ConversionIndexPtrVector Maturity::CI
protected

This is the ConversionIndexPtrVector used to convert from the immature stock lengths to the mature stock lengths.

◆ LgrpDiv

LengthGroupDivision* Maturity::LgrpDiv
protected

This is the LengthGroupDivision of the stock.

◆ matureRatio

FormulaVector Maturity::matureRatio
protected

This is the FormulaVector of the ratio of the immature stock to mature into each mature stock.

◆ matureStockNames

CharPtrVector Maturity::matureStockNames
protected

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

◆ matureStocks

StockPtrVector Maturity::matureStocks
protected

This is the StockPtrVector of the mature stocks.

◆ ratioindex

IntVector Maturity::ratioindex
protected

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

◆ ratioscale

double Maturity::ratioscale
protected

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

◆ tmpratio

double Maturity::tmpratio
protected

This is used to temporarily store the maturation ratio.


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