Gadget
|
This is the class used to model a stock within the Gadget model. More...
#include <stock.h>
Public Member Functions | |
Stock (CommentStream &infile, const char *givenname, const AreaClass *const Area, const TimeClass *const TimeInfo, Keeper *const keeper) | |
This is the Stock constructor. More... | |
Stock (const char *givenname) | |
This is the default Stock constructor. More... | |
virtual | ~Stock () |
This is the default Stock destructor. More... | |
virtual void | calcNumbers (int area, const TimeClass *const TimeInfo) |
This function will update the model population for an area in the model. More... | |
virtual void | reducePop (int area, const TimeClass *const TimeInfo) |
This function will reduce the model population for an area in the model. More... | |
virtual void | Grow (int area, const AreaClass *const Area, const TimeClass *const TimeInfo) |
This function will calculate the growth of the model population for an area in the model. More... | |
virtual void | updateAgePart1 (int area, const TimeClass *const TimeInfo) |
This function will calculate any transition of the model population for an area in the model. More... | |
virtual void | updateAgePart2 (int area, const TimeClass *const TimeInfo) |
This function will calculate the age increase of the model population for an area in the model. More... | |
virtual void | updateAgePart3 (int area, const TimeClass *const TimeInfo) |
This function will implement the transiton of the model population for an area in the model. More... | |
virtual void | updatePopulationPart1 (int area, const TimeClass *const TimeInfo) |
This function will calculate the spawning of the model population for an area in the model. More... | |
virtual void | updatePopulationPart2 (int area, const TimeClass *const TimeInfo) |
This function will calculate add the newly matured stock into the model population for an area in the model. More... | |
virtual void | updatePopulationPart3 (int area, const TimeClass *const TimeInfo) |
This function will calculate add the new recruits into the model population for an area in the model. More... | |
virtual void | updatePopulationPart4 (int area, const TimeClass *const TimeInfo) |
This function will calculate calculate the straying of the model population for an area in the model. More... | |
virtual void | updatePopulationPart5 (int area, const TimeClass *const TimeInfo) |
This function will calculate add the strayed stock into the model population for an area in the model. More... | |
virtual void | calcEat (int area, const AreaClass *const Area, const TimeClass *const TimeInfo) |
This function will calculate the modelled consumption for an area in the model. More... | |
virtual void | checkEat (int area, const TimeClass *const TimeInfo) |
This function will check the modelled consumption for an area in the model. More... | |
virtual void | adjustEat (int area, const TimeClass *const TimeInfo) |
This function will adjust the modelled consumption for an area in the model. More... | |
virtual void | Reset (const TimeClass *const TimeInfo) |
This function will reset the model population. More... | |
void | Print (ofstream &outfile) const |
This function will print the model population. More... | |
virtual void | Migrate (const TimeClass *const TimeInfo) |
This function will implement the migration of the model population for the model. More... | |
void | Add (const AgeBandMatrix &Addition, const ConversionIndex *const CI, int area, double ratio) |
This function will add a AgeBandMatrix to the current stock population. More... | |
void | Add (const AgeBandMatrixRatioPtrVector &Addition, const ConversionIndex *const CI, int area, double ratio) |
This function will add a AgeBandMatrixRatioPtrVector to the current tagged stock population. More... | |
StockPrey * | getPrey () const |
This will return the prey information for the stock. More... | |
Migration * | getMigration () const |
This will return the migration information for the stock. More... | |
PopPredator * | getPredator () const |
This will return the predation information for the stock. More... | |
AgeBandMatrix & | getCurrentALK (int area) |
This will return the current population of the stock on a given area. More... | |
AgeBandMatrix & | getConsumptionALK (int area) |
This will return the population of the stock on a given area at the start of the current timestep. More... | |
const LengthGroupDivision * | getLengthGroupDiv () const |
This will return the length group information for the stock. More... | |
void | setStock (StockPtrVector &stockvec) |
This function will initialise the stock and set-up links to any related stocks. More... | |
int | isBirthday (const TimeClass *const TimeInfo) const |
This function will check to see if the age of the stock should be increased on the current timestep or not. More... | |
int | isEaten () const |
This function will return the flag used to denote whether the stock is eaten or not. More... | |
int | doesSpawn () const |
This function will return the flag used to denote whether the stock will spawn or not. More... | |
int | doesStray () const |
This function will return the flag used to denote whether the stock will stray or not. More... | |
int | doesMove () const |
This function will return the flag used to denote whether the stock will move or not. More... | |
int | doesEat () const |
This function will return the flag used to denote whether the stock will eat or not. More... | |
int | doesMature () const |
This function will return the flag used to denote whether the stock will mature or not. More... | |
int | doesRenew () const |
This function will return the flag used to denote whether the stock will renew or not. More... | |
int | doesGrow () const |
This function will return the flag used to denote whether the stock will grow or not. More... | |
int | doesMigrate () const |
This function will return the flag used to denote whether the stock will migrate or not. More... | |
int | isTagged () const |
This function will return the flag used to denote whether the stock has been tagged or not. More... | |
void | setTaggedStock () |
This function will set the flag to denote that the stock has been tagged. More... | |
void | setTagged () |
This function will initialise the tagging experiments for the stock and any related stocks. More... | |
int | minAge () const |
This will return the minimum age of the stock. More... | |
int | maxAge () const |
This will return the maximum age of the stock. More... | |
double | getTotalStockNumber (int area) const |
This will return the total population size (in numbers) of the stock on a given area. More... | |
double | getTotalStockNumberAllAreas () const |
This will return the total population size (in numbers) of the stock across all areas. More... | |
double | getTotalStockBiomass (int area) const |
This will return the total population biomass of the stock on a given area. More... | |
double | getTotalStockBiomassAllAreas () const |
This will return the total population biomass of the stock across all areas. More... | |
double | getWeightedStockBiomass (int area, const FormulaVector ¶meters) const |
This will return the selection weighted population biomass \of the stock in one area return population biomass. More... | |
double | getWeightedStockBiomassAllAreas (const FormulaVector ¶meters) const |
This will return the selection weighted population biomass \of the stock in allareas return population biomass. More... | |
const StockPtrVector & | getMatureStocks () |
This will return the stocks that this stock will mature in to. More... | |
const StockPtrVector & | getTransitionStocks () |
This will return the stocks that this stock will move in to. More... | |
const StockPtrVector & | getStrayStocks () |
This will return the stocks that this stock will stray in to. More... | |
void | addTags (AgeBandMatrixPtrVector *tagbyagelength, Tags *newtag, double tagloss) |
This function will add details for a new tagging experiment on the current stock. More... | |
void | deleteTags (const char *tagname) |
This function will remove a tagging experiment from the current tagged stock population. More... | |
![]() | |
BaseClass () | |
This is the default BaseClass constructor. More... | |
BaseClass (const char *givenname) | |
This is the BaseClass constructor for an object with a name. More... | |
BaseClass (const char *givenname, const IntVector &Areas) | |
This is the BaseClass constructor for an object with a name and an area. More... | |
virtual | ~BaseClass () |
This is the default BaseClass destructor. 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... | |
![]() | |
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 | |
AgeBandMatrixPtrVector | Alkeys |
This is the AgeBandMatrixPtrVector used to store information about the stock population. More... | |
AgeBandMatrixRatioPtrVector | tagAlkeys |
This is the AgeBandMatrixRatioPtrVector used to store information about the tagged population from any tagging experiments performed on the stock. More... | |
TagPtrVector | allTags |
This is the TagPtrVector used to store information about the tagging experiments. More... | |
TagPtrVector | matureTags |
This is the TagPtrVector used to store information about how the tagging experiments affect the population that mature. More... | |
TagPtrVector | transitionTags |
This is the TagPtrVector used to store information about how the tagging experiments affect the population that move. More... | |
TagPtrVector | strayTags |
This is the TagPtrVector used to store information about how the tagging experiments affect the population that stray. More... | |
StrayData * | stray |
This is the StrayData used to calculate information about the straying of the stock. More... | |
SpawnData * | spawner |
This is the SpawnData used to calculate information about the spawning of the stock. More... | |
RenewalData * | renewal |
This is the RenewalData used to calculate information about the renewal of the stock. More... | |
Maturity * | maturity |
This is the Maturity used to calculate information about the maturation of the stock. More... | |
Transition * | transition |
This is the Transition used to calculate information about the movement of the stock. More... | |
Migration * | migration |
This is the Migration used to calculate information about the migration of the stock. More... | |
StockPrey * | prey |
This is the Prey used to calculate information about the consumption of the stock. More... | |
PopPredator * | predator |
This is the PopPredator used to calculate information about the consumption by the stock. More... | |
InitialCond * | initial |
This is the InitialCond used to calculate information about the initial conditions of the stock. More... | |
LengthGroupDivision * | LgrpDiv |
This is the LengthGroupDivision used to store length information. More... | |
Grower * | grower |
This is the Grower used to calculate information about the growth of the stock. More... | |
NaturalMortality * | naturalm |
This is the NaturalMortality used to calculate information about the natural mortality of the stock. More... | |
int | doeseat |
This is the flag used to denote whether the stock will eat (ie. is a Predator) or not. More... | |
int | doesmove |
This is the flag used to denote whether the stock will move or not. More... | |
int | iseaten |
This is the flag used to denote whether the stock is eaten (ie. is a Prey) or not. More... | |
int | doesspawn |
This is the flag used to denote whether the stock will spawn or not. More... | |
int | doesmature |
This is the flag used to denote whether the stock will mature or not. More... | |
int | doesrenew |
This is the flag used to denote whether the stock will renew or not. More... | |
int | doesgrow |
This is the flag used to denote whether the stock will grow or not. More... | |
int | doesmigrate |
This is the flag used to denote whether the stock will migrate or not. More... | |
int | doesstray |
This is the flag used to denote whether the stock will stray or not. More... | |
int | birthdate |
This is the timestep that the population will increase in age in the simulation. More... | |
int | istagged |
This is the flag used to denote whether the stock has been included in a tagging experiment or not. More... | |
PopInfoMatrix | tmpPopulation |
This is the PopInfoMatrix used to temporarily store the population during the growth calculation. More... | |
PopInfoVector | tmpMigrate |
This is the PopInfoVector used to temporarily store the population during the migration calculation. More... | |
![]() | |
IntVector | areas |
This is the IntVector of internal areas that the object is defined on. More... | |
Additional Inherited Members | |
![]() | |
void | storeAreas (const IntVector &Areas) |
This function will store the internal areas to be used. More... | |
This is the class used to model a stock within the Gadget model.
This class is used to model the population of a stock during a model simulation.
Stock::Stock | ( | CommentStream & | infile, |
const char * | givenname, | ||
const AreaClass *const | Area, | ||
const TimeClass *const | TimeInfo, | ||
Keeper *const | keeper | ||
) |
This is the Stock constructor.
infile | is the CommentStream to read the stock parameters from |
givenname | is the name of the stock |
Area | is the AreaClass for the current model |
TimeInfo | is the TimeClass for the current model |
keeper | is the Keeper for the current model |
Stock::Stock | ( | const char * | givenname | ) |
This is the default Stock constructor.
givenname | is the name of the stock |
|
virtual |
This is the default Stock destructor.
void Stock::Add | ( | const AgeBandMatrix & | Addition, |
const ConversionIndex *const | CI, | ||
int | area, | ||
double | ratio | ||
) |
This function will add a AgeBandMatrix to the current stock population.
Addition | is the AgeBandMatrix that will be added to the population |
CI | is the ConversionIndex that will convert between the length groups |
area | is an integer to denote the internal area of interest |
ratio | is a multiplicative constant applied |
void Stock::Add | ( | const AgeBandMatrixRatioPtrVector & | Addition, |
const ConversionIndex *const | CI, | ||
int | area, | ||
double | ratio | ||
) |
This function will add a AgeBandMatrixRatioPtrVector to the current tagged stock population.
Addition | is the AgeBandMatrixRatioPtrVector that will be added to the tagged population |
CI | is the ConversionIndex that will convert between the length groups |
area | is an integer to denote the internal area of interest |
ratio | is a multiplicative constant applied |
void Stock::addTags | ( | AgeBandMatrixPtrVector * | tagbyagelength, |
Tags * | newtag, | ||
double | tagloss | ||
) |
This function will add details for a new tagging experiment on the current stock.
tagbyagelength | is the AgeBandMatrixPtrVector of the new tagged population |
newtag | is the Tags for the new tagging experiment |
tagloss | is the proportion of tags that are lost for the new tagging experiment |
|
virtual |
|
virtual |
|
virtual |
void Stock::deleteTags | ( | const char * | tagname | ) |
This function will remove a tagging experiment from the current tagged stock population.
tagname | is the name of the tagging experiment to be removed |
|
inline |
This function will return the flag used to denote whether the stock will eat or not.
|
inline |
This function will return the flag used to denote whether the stock will grow or not.
|
inline |
This function will return the flag used to denote whether the stock will mature or not.
|
inline |
This function will return the flag used to denote whether the stock will migrate or not.
|
inline |
This function will return the flag used to denote whether the stock will move or not.
|
inline |
This function will return the flag used to denote whether the stock will renew or not.
|
inline |
This function will return the flag used to denote whether the stock will spawn or not.
|
inline |
This function will return the flag used to denote whether the stock will stray or not.
AgeBandMatrix & Stock::getConsumptionALK | ( | int | area | ) |
This will return the population of the stock on a given area at the start of the current timestep.
area | is the area identifier |
|
inline |
This will return the current population of the stock on a given area.
area | is the area identifier |
|
inline |
This will return the length group information for the stock.
const StockPtrVector & Stock::getMatureStocks | ( | ) |
This will return the stocks that this stock will mature in to.
Migration * Stock::getMigration | ( | ) | const |
This will return the migration information for the stock.
PopPredator * Stock::getPredator | ( | ) | const |
This will return the predation information for the stock.
StockPrey * Stock::getPrey | ( | ) | const |
This will return the prey information for the stock.
const StockPtrVector & Stock::getStrayStocks | ( | ) |
This will return the stocks that this stock will stray in to.
double Stock::getTotalStockBiomass | ( | int | area | ) | const |
This will return the total population biomass of the stock on a given area.
area | is the area identifier |
double Stock::getTotalStockBiomassAllAreas | ( | ) | const |
This will return the total population biomass of the stock across all areas.
double Stock::getTotalStockNumber | ( | int | area | ) | const |
This will return the total population size (in numbers) of the stock on a given area.
area | is the area identifier |
double Stock::getTotalStockNumberAllAreas | ( | ) | const |
This will return the total population size (in numbers) of the stock across all areas.
const StockPtrVector & Stock::getTransitionStocks | ( | ) |
This will return the stocks that this stock will move in to.
double Stock::getWeightedStockBiomass | ( | int | area, |
const FormulaVector & | parameters | ||
) | const |
This will return the selection weighted population biomass \of the stock in one area return population biomass.
double Stock::getWeightedStockBiomassAllAreas | ( | const FormulaVector & | parameters | ) | const |
This will return the selection weighted population biomass \of the stock in allareas return population biomass.
int Stock::isBirthday | ( | const TimeClass *const | TimeInfo | ) | const |
This function will check to see if the age of the stock should be increased on the current timestep or not.
TimeInfo | is the TimeClass for the current model |
|
inline |
This function will return the flag used to denote whether the stock is eaten or not.
|
inline |
This function will return the flag used to denote whether the stock has been tagged or not.
|
inline |
This will return the maximum age of the stock.
|
virtual |
|
inline |
This will return the minimum age of the stock.
|
virtual |
This function will print the model population.
outfile | is the ofstream that all the model information gets sent to |
Implements BaseClass.
|
virtual |
|
virtual |
void Stock::setStock | ( | StockPtrVector & | stockvec | ) |
This function will initialise the stock and set-up links to any related stocks.
stockvec | is the StockPtrVector of all the available stocks |
void Stock::setTagged | ( | ) |
This function will initialise the tagging experiments for the stock and any related stocks.
|
inline |
This function will set the flag to denote that the stock has been tagged.
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
protected |
This is the AgeBandMatrixPtrVector used to store information about the stock population.
|
protected |
This is the TagPtrVector used to store information about the tagging experiments.
|
protected |
This is the timestep that the population will increase in age in the simulation.
|
protected |
This is the flag used to denote whether the stock will eat (ie. is a Predator) or not.
|
protected |
This is the flag used to denote whether the stock will grow or not.
|
protected |
This is the flag used to denote whether the stock will mature or not.
|
protected |
This is the flag used to denote whether the stock will migrate or not.
|
protected |
This is the flag used to denote whether the stock will move or not.
|
protected |
This is the flag used to denote whether the stock will renew or not.
|
protected |
This is the flag used to denote whether the stock will spawn or not.
|
protected |
This is the flag used to denote whether the stock will stray or not.
|
protected |
This is the Grower used to calculate information about the growth of the stock.
|
protected |
This is the InitialCond used to calculate information about the initial conditions of the stock.
|
protected |
This is the flag used to denote whether the stock is eaten (ie. is a Prey) or not.
|
protected |
This is the flag used to denote whether the stock has been included in a tagging experiment or not.
|
protected |
This is the LengthGroupDivision used to store length information.
|
protected |
This is the TagPtrVector used to store information about how the tagging experiments affect the population that mature.
|
protected |
This is the Maturity used to calculate information about the maturation of the stock.
|
protected |
This is the Migration used to calculate information about the migration of the stock.
|
protected |
This is the NaturalMortality used to calculate information about the natural mortality of the stock.
|
protected |
This is the PopPredator used to calculate information about the consumption by the stock.
|
protected |
This is the Prey used to calculate information about the consumption of the stock.
|
protected |
This is the RenewalData used to calculate information about the renewal of the stock.
|
protected |
This is the SpawnData used to calculate information about the spawning of the stock.
|
protected |
This is the StrayData used to calculate information about the straying of the stock.
|
protected |
This is the TagPtrVector used to store information about how the tagging experiments affect the population that stray.
|
protected |
This is the AgeBandMatrixRatioPtrVector used to store information about the tagged population from any tagging experiments performed on the stock.
|
protected |
This is the PopInfoVector used to temporarily store the population during the migration calculation.
|
protected |
This is the PopInfoMatrix used to temporarily store the population during the growth calculation.
|
protected |
This is the Transition used to calculate information about the movement of the stock.
|
protected |
This is the TagPtrVector used to store information about how the tagging experiments affect the population that move.