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

This is the class used to calculate the affect of natural mortality on the stock. More...

#include <naturalm.h>

Inheritance diagram for NaturalMortality:
Inheritance graph
Collaboration diagram for NaturalMortality:
Collaboration graph

Public Member Functions

 NaturalMortality (CommentStream &infile, int minage, int numage, const char *givenname, const IntVector &Areas, const TimeClass *const TimeInfo, Keeper *const keeper)
 This is the NaturalMortality constructor. More...
 
 ~NaturalMortality ()
 This is the default NaturalMortality destructor. More...
 
const DoubleVectorgetProportion (int area) const
 This function will return the DoubleVector of the proportion of each age group that will survive on the current timestep. More...
 
void Reset (const TimeClass *const TimeInfo)
 This function will reset the NaturalMortality information. More...
 
void Print (ofstream &outfile)
 This function will print the summary NaturalMortality information. 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...
 
- Public Member Functions inherited from LivesOnAreas
 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

ModelVariableVector mortality
 This is the ModelVariableVector used to store the mortality of each age group. More...
 
SelectFuncfnMortality
 This is the SelectFunc used to calculate of the proportion of each age group of the stock that will die due to natural mortality. More...
 
DoubleMatrix proportion
 This is the DoubleMatrix used to store the proportion of each age group that will survive (ie. will not die out due to natural mortality) More...
 
int minStockAge
 This is the minimum age of the stock, used as an index when calculating proportion. More...
 
int readoption
 This is the identifier of the function to be used to read the natural mortality data from file. 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...
 

Detailed Description

This is the class used to calculate the affect of natural mortality on the stock.

This class calculates the proportion of the stock that should be removed from the model due to natural mortality (ie. any mortality that is not due to predation, either by another stock or by a fleet). The number that is stored after this calculation contains the proportion of each area/age group that will survive (ie. is not removed due to the natural mortality).

Note
This is currently an age-based calculation, and it would be much better to replace this with a length-based calculation, by re-implementing this as a simple predator with a new suitability function to allow for higher levels of 'predation' on both the young/short fish and the old/long fish

Constructor & Destructor Documentation

◆ NaturalMortality()

NaturalMortality::NaturalMortality ( CommentStream infile,
int  minage,
int  numage,
const char *  givenname,
const IntVector Areas,
const TimeClass *const  TimeInfo,
Keeper *const  keeper 
)

This is the NaturalMortality constructor.

Parameters
infileis the CommentStream to read the NaturalMortality information from
minageis the minimum age of the stock
numageis the number of age groups for the stock
givennameis the name of the stock for this NaturalMortality class
Areasis the IntVector of the areas that the stock lives on
TimeInfois the TimeClass for the current model
keeperis the Keeper for the current model

◆ ~NaturalMortality()

NaturalMortality::~NaturalMortality ( )

This is the default NaturalMortality destructor.

Member Function Documentation

◆ getProportion()

const DoubleVector& NaturalMortality::getProportion ( int  area) const
inline

This function will return the DoubleVector of the proportion of each age group that will survive on the current timestep.

Parameters
areais the area that the natural mortality is being calculated on
Returns
proportion surviving from each age group

◆ Print()

void NaturalMortality::Print ( ofstream &  outfile)

This function will print the summary NaturalMortality information.

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

◆ Reset()

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

This function will reset the NaturalMortality information.

Parameters
TimeInfois the TimeClass for the current model

Member Data Documentation

◆ fnMortality

SelectFunc* NaturalMortality::fnMortality
protected

This is the SelectFunc used to calculate of the proportion of each age group of the stock that will die due to natural mortality.

◆ minStockAge

int NaturalMortality::minStockAge
protected

This is the minimum age of the stock, used as an index when calculating proportion.

◆ mortality

ModelVariableVector NaturalMortality::mortality
protected

This is the ModelVariableVector used to store the mortality of each age group.

◆ proportion

DoubleMatrix NaturalMortality::proportion
protected

This is the DoubleMatrix used to store the proportion of each age group that will survive (ie. will not die out due to natural mortality)

◆ readoption

int NaturalMortality::readoption
protected

This is the identifier of the function to be used to read the natural mortality data from file.


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