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

This is the class used to calculate the movement from one stock to other stocks. More...

#include <stray.h>

Inheritance diagram for StrayData:
Inheritance graph
Collaboration diagram for StrayData:
Collaboration graph

Public Member Functions

 StrayData (CommentStream &infile, const LengthGroupDivision *const LgrpDiv, const IntVector &areas, const AreaClass *const Area, const char *givenname, const TimeClass *const TimeInfo, Keeper *const keeper)
 This is the StrayData constructor. More...
 
 ~StrayData ()
 This is the default StrayData destructor. More...
 
void Print (ofstream &outfile) const
 This function will print the straying information. More...
 
void setStock (StockPtrVector &stockvec)
 This will select the stocks required for the straying process. More...
 
void addStrayStock (int area, const TimeClass *const TimeInfo)
 This will move the calculated straying stock from the current stock into the new stock age-length cells. More...
 
void storeStrayingStock (int area, AgeBandMatrix &Alkeys, const TimeClass *const TimeInfo)
 This will store the part of the current stock that will stray into other stocks. More...
 
void storeStrayingStock (int area, AgeBandMatrix &Alkeys, AgeBandMatrixRatio &TagAlkeys, const TimeClass *const TimeInfo)
 This will store the part of the current stock that will stray into other stocks. More...
 
int isStrayStepArea (int area, const TimeClass *const TimeInfo)
 This will check if the straying process will take place on the current timestep. More...
 
void Reset (const TimeClass *const TimeInfo)
 This will reset the straying information for the current model run. More...
 
const StockPtrVectorgetStrayStocks ()
 This will calculate the stocks the current stock can stray into. More...
 
void setTagged ()
 This function will initialise the tagging experiments for the straying calculations. More...
 
void addStrayTag (const char *tagname)
 This will add a tagging experiment to the straying calculations. More...
 
void deleteStrayTag (const char *tagname)
 This will remove a tagging experiment from the straying 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

StockPtrVector strayStocks
 This is the StockPtrVector of the stocks that the straying fish will move to. More...
 
CharPtrVector strayStockNames
 This is the CharPtrVector of the names of the straying stocks. More...
 
FormulaVector strayRatio
 This is the FormulaVector of the ratio of the stock that will stray. 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...
 
IntVector strayStep
 This is the IntVector of timesteps that the straying will take place on. More...
 
IntVector strayArea
 This is the IntVector of areas that the straying will take place on. More...
 
LengthGroupDivisionLgrpDiv
 This is the LengthGroupDivision of the stock. More...
 
DoubleVector strayProportion
 This is the DoubleVector of the proportion of each length group of the stock that will stray. More...
 
SelectFuncfnProportion
 This is the SelectFunc used to calculate of the proportion of each length group of the stock that will stray. More...
 
AgeBandMatrixPtrVector Storage
 This is the AgeBandMatrixPtrVector used to store the calculated straying stocks. More...
 
AgeBandMatrixRatioPtrVector tagStorage
 This is the AgeBandMatrixRatioPtrVector used to store the calculated straying tagged stocks. More...
 
ConversionIndexPtrVector CI
 This is the ConversionIndexPtrVector used to convert from the current stock lengths to the straying stock lengths. More...
 
int minStrayLength
 This is the minimum length group division of the straying stock. More...
 
int istagged
 This is the flag used to denote whether the stock has been included in a tagging experiment or not. 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 class used to calculate the movement from one stock to other stocks.

This class moves a proportion of fish from one stock to the corresponding age-length cell in other stocks. This is an extension to the Transition class, since it can move fish from more than one age group. The length groups of the new stocks are checked, and any fish that haven't yet reached the minimum length of the new stock remain in the original stock.

Constructor & Destructor Documentation

◆ StrayData()

StrayData::StrayData ( CommentStream infile,
const LengthGroupDivision *const  LgrpDiv,
const IntVector areas,
const AreaClass *const  Area,
const char *  givenname,
const TimeClass *const  TimeInfo,
Keeper *const  keeper 
)

This is the StrayData constructor.

Parameters
infileis the CommentStream to read the straying data from
LgrpDivis the LengthGroupDivision that the straying stock will be calculated on
areasis the IntVector of areas that the straying stock will be calculated on
Areais the AreaClass for the current model
givennameis the name of the stock for this StrayData class
TimeInfois the TimeClass for the current model
keeperis the Keeper for the current model

◆ ~StrayData()

StrayData::~StrayData ( )

This is the default StrayData destructor.

Member Function Documentation

◆ addStrayStock()

void StrayData::addStrayStock ( int  area,
const TimeClass *const  TimeInfo 
)

This will move the calculated straying stock from the current stock into the new stock age-length cells.

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

◆ addStrayTag()

void StrayData::addStrayTag ( const char *  tagname)

This will add a tagging experiment to the straying calculations.

Parameters
tagnameis the name of the tagging experiment

◆ deleteStrayTag()

void StrayData::deleteStrayTag ( const char *  tagname)

This will remove a tagging experiment from the straying calculations.

Parameters
tagnameis the name of the tagging experiment

◆ getStrayStocks()

const StockPtrVector & StrayData::getStrayStocks ( )

This will calculate the stocks the current stock can stray into.

Returns
stray stocks

◆ isStrayStepArea()

int StrayData::isStrayStepArea ( int  area,
const TimeClass *const  TimeInfo 
)

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

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

◆ Print()

void StrayData::Print ( ofstream &  outfile) const

This function will print the straying information.

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

◆ Reset()

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

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

Parameters
TimeInfois the TimeClass for the current model

◆ setStock()

void StrayData::setStock ( StockPtrVector stockvec)

This will select the stocks required for the straying process.

Parameters
stockvecis the StockPtrVector of all the available stocks

◆ setTagged()

void StrayData::setTagged ( )

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

◆ storeStrayingStock() [1/2]

void StrayData::storeStrayingStock ( int  area,
AgeBandMatrix Alkeys,
AgeBandMatrixRatio TagAlkeys,
const TimeClass *const  TimeInfo 
)

This will store the part of the current stock that will stray into other stocks.

Parameters
areais the area that the straying is being calculated on
Alkeysis the AgeBandMatrix of the stock that fish will move from
TagAlkeysis the AgeBandMatrixRatio of the tagged stock that fish will move from
TimeInfois the TimeClass for the current model

◆ storeStrayingStock() [2/2]

void StrayData::storeStrayingStock ( int  area,
AgeBandMatrix Alkeys,
const TimeClass *const  TimeInfo 
)

This will store the part of the current stock that will stray into other stocks.

Parameters
areais the area that the straying is being calculated on
Alkeysis the AgeBandMatrix of the stock that fish will move from
TimeInfois the TimeClass for the current model

Member Data Documentation

◆ CI

ConversionIndexPtrVector StrayData::CI
protected

This is the ConversionIndexPtrVector used to convert from the current stock lengths to the straying stock lengths.

◆ fnProportion

SelectFunc* StrayData::fnProportion
protected

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

◆ istagged

int StrayData::istagged
protected

This is the flag used to denote whether the stock has been included in a tagging experiment or not.

◆ LgrpDiv

LengthGroupDivision* StrayData::LgrpDiv
protected

This is the LengthGroupDivision of the stock.

◆ minStrayLength

int StrayData::minStrayLength
protected

This is the minimum length group division of the straying stock.

◆ ratioindex

IntVector StrayData::ratioindex
protected

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

◆ ratioscale

double StrayData::ratioscale
protected

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

◆ Storage

AgeBandMatrixPtrVector StrayData::Storage
protected

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

◆ strayArea

IntVector StrayData::strayArea
protected

This is the IntVector of areas that the straying will take place on.

◆ strayProportion

DoubleVector StrayData::strayProportion
protected

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

◆ strayRatio

FormulaVector StrayData::strayRatio
protected

This is the FormulaVector of the ratio of the stock that will stray.

◆ strayStep

IntVector StrayData::strayStep
protected

This is the IntVector of timesteps that the straying will take place on.

◆ strayStockNames

CharPtrVector StrayData::strayStockNames
protected

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

◆ strayStocks

StockPtrVector StrayData::strayStocks
protected

This is the StockPtrVector of the stocks that the straying fish will move to.

◆ tagStorage

AgeBandMatrixRatioPtrVector StrayData::tagStorage
protected

This is the AgeBandMatrixRatioPtrVector used to store the calculated straying tagged stocks.


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