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

This is the class used to calculate the initial population of a stock. More...

#include <initialcond.h>

Inheritance diagram for InitialCond:
Inheritance graph
Collaboration diagram for InitialCond:
Collaboration graph

Public Member Functions

 InitialCond (CommentStream &infile, const IntVector &areas, Keeper *const keeper, const char *refWeightFile, const char *givenname, const AreaClass *const Area, double DL)
 This is the InitialCond constructor. More...
 
 ~InitialCond ()
 This is the default InitialCond destructor. More...
 
void Initialise (AgeBandMatrixPtrVector &Alkeys)
 This function will set the initial population of the stock to that specified in the initial conditions file. More...
 
void setCI (const LengthGroupDivision *const GivenLDiv)
 This will set the ConversionIndex required for to calculate the initial conditions. More...
 
void Print (ofstream &outfile) const
 This function will print the initial population. 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

void readNormalConditionData (CommentStream &infile, Keeper *const keeper, int numage, int minage, const AreaClass *const Area)
 This is the function used to read the normal distribution and condition factor for the initial condtion data. More...
 
void readNormalParameterData (CommentStream &infile, Keeper *const keeper, int numage, int minage, const AreaClass *const Area)
 This is the function used to read the normal distribution for the initial condtion data. More...
 
void readNumberData (CommentStream &infile, Keeper *const keeper, int numage, int minage, const AreaClass *const Area)
 This is the function used to read the numbers of the initial population. 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

LengthGroupDivisionLgrpDiv
 This is the LengthGroupDivision of the initial population of the stock. More...
 
ConversionIndexCI
 This is the ConversionIndex used to convert from the initial population LengthGroupDivision to the stock LengthGroupDivision. More...
 
AgeBandMatrixPtrVector initialPop
 This is the AgeBandMatrixPtrVector used to store the initial population. More...
 
FormulaMatrixPtrVector initialNumber
 This is the FormulaMatrixPtrVector that contains the number (from the input file) of the initial population. More...
 
FormulaMatrix areaFactor
 This is the FormulaMatrix of the area factor used to calculate the initial population. More...
 
FormulaMatrix ageFactor
 This is the FormulaMatrix of the age factor used to calculate the initial population. More...
 
FormulaMatrix relCond
 This is the FormulaMatrix of the condition factor used to calculate the weight of the initial population. More...
 
FormulaMatrix meanLength
 This is the FormulaMatrix of the mean length at age used to calculate the initial population. More...
 
FormulaMatrix sdevLength
 This is the FormulaMatrix of the standard deviation of the length at age used to calculate the initial population. More...
 
FormulaMatrix alpha
 This is the FormulaMatrix of the alpha parameter used when calculating the length weight relationship. More...
 
FormulaMatrix beta
 This is the FormulaMatrix of the beta parameter used when calculating the length weight relationship. More...
 
Formula sdevMult
 This is the optional factor used when calculating the standard deviation of the length. More...
 
DoubleVector refWeight
 This is the DoubleVector of the reference weight values. More...
 
int readoption
 This is the identifier of the function to be used to read the initial population 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...
 

Detailed Description

This is the class used to calculate the initial population of a stock.

This class calculates the initial population for a model run. There are 2 ways to do this - either by specifying a normal distribution or by specifying the actual population to be used.

For the normal distribution, Gadget will calculate a length distribution for a population of 10,000 fish for each age group, which will then be multiplied by age and area factors to give the initial population.

For the numbers, Gadget will read a list of the population in each age-length cell for each area.

The initial weight for each age-length cell will be set to the reference weight, multiplied by a conditioning factor.

Constructor & Destructor Documentation

◆ InitialCond()

InitialCond::InitialCond ( CommentStream infile,
const IntVector areas,
Keeper *const  keeper,
const char *  refWeightFile,
const char *  givenname,
const AreaClass *const  Area,
double  DL 
)

This is the InitialCond constructor.

Parameters
infileis the CommentStream to read the initial conditions data from
areasis the IntVector of areas that the initial population will be calculated on
keeperis the Keeper for the current model
refWeightFileis the name of the reference weight file
givennameis the name of the stock for this InitialCond class
Areais the AreaClass for the current model
DLis the step length of the length groups of the stock

◆ ~InitialCond()

InitialCond::~InitialCond ( )

This is the default InitialCond destructor.

Member Function Documentation

◆ Initialise()

void InitialCond::Initialise ( AgeBandMatrixPtrVector Alkeys)

This function will set the initial population of the stock to that specified in the initial conditions file.

Parameters
Alkeysis the AgeBandMatrixPtrVector that will contain the initial population of the stock

◆ Print()

void InitialCond::Print ( ofstream &  outfile) const

This function will print the initial population.

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

◆ readNormalConditionData()

void InitialCond::readNormalConditionData ( CommentStream infile,
Keeper *const  keeper,
int  numage,
int  minage,
const AreaClass *const  Area 
)
protected

This is the function used to read the normal distribution and condition factor for the initial condtion data.

Parameters
infileis the CommentStream to read the initial conditions data from
keeperis the Keeper for the current model
numageis the number of age groups for the initial population
minageis the minimum age for the initial population
Areais the AreaClass for the current model

◆ readNormalParameterData()

void InitialCond::readNormalParameterData ( CommentStream infile,
Keeper *const  keeper,
int  numage,
int  minage,
const AreaClass *const  Area 
)
protected

This is the function used to read the normal distribution for the initial condtion data.

Parameters
infileis the CommentStream to read the initial conditions data from
keeperis the Keeper for the current model
numageis the number of age groups for the initial population
minageis the minimum age for the initial population
Areais the AreaClass for the current model

◆ readNumberData()

void InitialCond::readNumberData ( CommentStream infile,
Keeper *const  keeper,
int  numage,
int  minage,
const AreaClass *const  Area 
)
protected

This is the function used to read the numbers of the initial population.

Parameters
infileis the CommentStream to read the initial conditions data from
keeperis the Keeper for the current model
numageis the number of age groups for the initial population
minageis the minimum age for the initial population
Areais the AreaClass for the current model

◆ setCI()

void InitialCond::setCI ( const LengthGroupDivision *const  GivenLDiv)

This will set the ConversionIndex required for to calculate the initial conditions.

Parameters
GivenLDivis the LengthGroupDivision for the stock

Member Data Documentation

◆ ageFactor

FormulaMatrix InitialCond::ageFactor
protected

This is the FormulaMatrix of the age factor used to calculate the initial population.

◆ alpha

FormulaMatrix InitialCond::alpha
protected

This is the FormulaMatrix of the alpha parameter used when calculating the length weight relationship.

◆ areaFactor

FormulaMatrix InitialCond::areaFactor
protected

This is the FormulaMatrix of the area factor used to calculate the initial population.

◆ beta

FormulaMatrix InitialCond::beta
protected

This is the FormulaMatrix of the beta parameter used when calculating the length weight relationship.

◆ CI

ConversionIndex* InitialCond::CI
protected

This is the ConversionIndex used to convert from the initial population LengthGroupDivision to the stock LengthGroupDivision.

◆ initialNumber

FormulaMatrixPtrVector InitialCond::initialNumber
protected

This is the FormulaMatrixPtrVector that contains the number (from the input file) of the initial population.

◆ initialPop

AgeBandMatrixPtrVector InitialCond::initialPop
protected

This is the AgeBandMatrixPtrVector used to store the initial population.

◆ LgrpDiv

LengthGroupDivision* InitialCond::LgrpDiv
protected

This is the LengthGroupDivision of the initial population of the stock.

◆ meanLength

FormulaMatrix InitialCond::meanLength
protected

This is the FormulaMatrix of the mean length at age used to calculate the initial population.

◆ readoption

int InitialCond::readoption
protected

This is the identifier of the function to be used to read the initial population data from file.

◆ refWeight

DoubleVector InitialCond::refWeight
protected

This is the DoubleVector of the reference weight values.

◆ relCond

FormulaMatrix InitialCond::relCond
protected

This is the FormulaMatrix of the condition factor used to calculate the weight of the initial population.

◆ sdevLength

FormulaMatrix InitialCond::sdevLength
protected

This is the FormulaMatrix of the standard deviation of the length at age used to calculate the initial population.

◆ sdevMult

Formula InitialCond::sdevMult
protected

This is the optional factor used when calculating the standard deviation of the length.


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