Gadget
|
This is the class used to calculate, and implement, the affect of growth on the stock. More...
#include <grower.h>
Public Member Functions | |
Grower (CommentStream &infile, const LengthGroupDivision *const OtherLgrpDiv, const LengthGroupDivision *const GivenLgrpDiv, const IntVector &Areas, const TimeClass *const TimeInfo, Keeper *const keeper, const char *refWeight, const char *givenname, const AreaClass *const Area, const CharPtrVector &lenindex) | |
This is the Grower constructor. More... | |
~Grower () | |
This is the default Grower destructor. More... | |
void | calcGrowth (int area, const AreaClass *const Area, const TimeClass *const TimeInfo, const DoubleVector &FeedingLevel, const DoubleVector &Consumption) |
This will calculate the growth of the stock for the current timestep on a given area. More... | |
void | calcGrowth (int area, const AreaClass *const Area, const TimeClass *const TimeInfo) |
This will calculate the growth of the stock for the current timestep on a given area. More... | |
void | implementGrowth (int area, const PopInfoVector &NumberInArea, const LengthGroupDivision *const Lengths) |
This will implement the calculated changes due to growth of the stock. More... | |
void | implementGrowth (int area, const LengthGroupDivision *const Lengths) |
This will implement the calculated changes due to growth of the stock. More... | |
void | Sum (const PopInfoVector &NumberInArea, int area) |
This will calculate the amount of the stock that is on a given area and timestep. More... | |
void | Reset () |
This will reset the growth information for the current model run. More... | |
void | Print (ofstream &outfile) const |
This function will print the growth data. More... | |
const DoubleMatrix & | getLengthIncrease (int area) const |
This function will return the calculated length increase due to growth on an area. More... | |
const DoubleMatrix & | getWeightIncrease (int area) const |
This function will return the calculated weight increase due to growth on an area. More... | |
const DoubleVector & | getWeight (int area) const |
This function will return the fixed weight increase due to growth on an area. More... | |
int | getFixedWeights () |
This will return the flag used to denote whether the weights have been fixed or not. 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... | |
Protected Attributes | |
PopInfoMatrix | numGrow |
This is the PopInfoMatrix used to store information about the current population of the stock that is to grow according to the growth calculations. More... | |
LengthGroupDivision * | LgrpDiv |
This is the LengthGroupDivision used to store length information. More... | |
ConversionIndex * | CI |
This is the ConversionIndex used to convert from the stock LengthGroupDivision to the LengthGroupDivision used for the growth calculation. More... | |
DoubleMatrix | interpLengthGrowth |
This is the DoubleMatrix used to store the increase in length on the current timestep. More... | |
DoubleMatrix | interpWeightGrowth |
This is the DoubleMatrix used to store the increase in weight on the current timestep. More... | |
DoubleMatrix | calcLengthGrowth |
This is the DoubleMatrix used to store the calculated increase in length on the current timestep. More... | |
DoubleMatrix | calcWeightGrowth |
This is the DoubleMatrix used to store the calculated increase in weight on the current timestep. More... | |
DoubleMatrixPtrVector | lgrowth |
This is the DoubleMatrixPtrVector used to store the calculated increase in length for each length group on the current timestep. More... | |
DoubleMatrixPtrVector | wgrowth |
This is the DoubleMatrixPtrVector used to store the calculated increase in weight for each length group on the current timestep. More... | |
DoubleVector | dummyfphi |
This is the dummy DoubleVector used during the growth calculation. More... | |
GrowthCalcBase * | growthcalc |
This is the GrowthCalcBase used to calculate the growth information. More... | |
int | functionnumber |
This is the identifier of the function to be used to calculate the growth. More... | |
int | fixedweights |
This is the flag used to denote whether the change is weight is to be calculated, or fixed to values specified in the input files. More... | |
int | maxlengthgroupgrowth |
This is the maximum number of length groups that an individual fish from the stock can grow on one timestep. More... | |
double | growth |
This is the mean growth, as calculated for this length group by the GrowthCalc function. More... | |
double | alpha |
This is the value of alpha in the beta binomial distribution. More... | |
Formula | beta |
This is the value of beta in the beta binomial distribution. More... | |
DoubleVector | part1 |
This is a DoubleVector used when calculating the beta binomial distribution. More... | |
DoubleVector | part2 |
This is a DoubleVector used when calculating the beta binomial distribution. More... | |
double | part3 |
This is a double used when calculating the beta binomial distribution. More... | |
DoubleVector | part4 |
This is a DoubleVector used when calculating the beta binomial distribution. 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... | |
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... | |
This is the class used to calculate, and implement, the affect of growth on the stock.
This class calculates the growth of the stock, according to the different growth functions derived from the GrowthCalcBase class. Since the growth calculations can take place on a coarser scale than the stock is defined on, the calculated growth is then interpolated to take the length group of the stock into account. This growth is then implemented by moving the fish up from the old length groups to the new length groups, taking care to ensure that the fish that would move to beyond the largest length group are kept in the plus group.
Grower::Grower | ( | CommentStream & | infile, |
const LengthGroupDivision *const | OtherLgrpDiv, | ||
const LengthGroupDivision *const | GivenLgrpDiv, | ||
const IntVector & | Areas, | ||
const TimeClass *const | TimeInfo, | ||
Keeper *const | keeper, | ||
const char * | refWeight, | ||
const char * | givenname, | ||
const AreaClass *const | Area, | ||
const CharPtrVector & | lenindex | ||
) |
This is the Grower constructor.
infile | is the CommentStream to read the growth data from |
OtherLgrpDiv | is the LengthGroupDivision of the stock |
GivenLgrpDiv | is the LengthGroupDivision that the growth will be calculated on |
Areas | is the IntVector of areas that the stock lives on |
TimeInfo | is the TimeClass for the current model |
keeper | is the Keeper for the current model |
refWeight | is the name of the file containing the reference weight information for the stock |
givenname | is the name of the stock for this Grower class |
Area | is the AreaClass for the current model |
lenindex | is the CharPtrVector of the lengths used for the growth of the stock |
Grower::~Grower | ( | ) |
This is the default Grower destructor.
void Grower::calcGrowth | ( | int | area, |
const AreaClass *const | Area, | ||
const TimeClass *const | TimeInfo, | ||
const DoubleVector & | FeedingLevel, | ||
const DoubleVector & | Consumption | ||
) |
This will calculate the growth of the stock for the current timestep on a given area.
area | is the area that the growth is being calculated on |
Area | is the AreaClass for the current model |
TimeInfo | is the TimeClass for the current model |
FeedingLevel | is the DoubleVector of the feeding level of the stock |
Consumption | is the DoubleVector of the maximum consumption of the stock |
|
inline |
This will return the flag used to denote whether the weights have been fixed or not.
|
inline |
This function will return the calculated length increase due to growth on an area.
area | is the area that the growth is being calculated on |
|
inline |
This function will return the fixed weight increase due to growth on an area.
area | is the area that the growth is being calculated on |
|
inline |
This function will return the calculated weight increase due to growth on an area.
area | is the area that the growth is being calculated on |
void Grower::implementGrowth | ( | int | area, |
const LengthGroupDivision *const | Lengths | ||
) |
This will implement the calculated changes due to growth of the stock.
area | is the area that the growth is being calculated on |
Lengths | is the LengthGroupDivision of the stock |
void Grower::implementGrowth | ( | int | area, |
const PopInfoVector & | NumberInArea, | ||
const LengthGroupDivision *const | Lengths | ||
) |
This will implement the calculated changes due to growth of the stock.
area | is the area that the growth is being calculated on |
NumberInArea | is the PopInfoVector giving the current population of the stock |
Lengths | is the LengthGroupDivision of the stock |
void Grower::Print | ( | ofstream & | outfile | ) | const |
This function will print the growth data.
outfile | is the ofstream that all the model information gets sent to |
void Grower::Reset | ( | ) |
This will reset the growth information for the current model run.
void Grower::Sum | ( | const PopInfoVector & | NumberInArea, |
int | area | ||
) |
This will calculate the amount of the stock that is on a given area and timestep.
NumberInArea | is the PopInfoVector giving the amount of the stock in the area |
area | is the area that the growth is being calculated on |
|
protected |
This is the value of alpha in the beta binomial distribution.
|
protected |
This is the value of beta in the beta binomial distribution.
|
protected |
This is the DoubleMatrix used to store the calculated increase in length on the current timestep.
|
protected |
This is the DoubleMatrix used to store the calculated increase in weight on the current timestep.
|
protected |
This is the ConversionIndex used to convert from the stock LengthGroupDivision to the LengthGroupDivision used for the growth calculation.
|
protected |
This is the dummy DoubleVector used during the growth calculation.
|
protected |
This is the flag used to denote whether the change is weight is to be calculated, or fixed to values specified in the input files.
|
protected |
This is the identifier of the function to be used to calculate the growth.
|
protected |
This is the mean growth, as calculated for this length group by the GrowthCalc function.
|
protected |
This is the GrowthCalcBase used to calculate the growth information.
|
protected |
This is the DoubleMatrix used to store the increase in length on the current timestep.
|
protected |
This is the DoubleMatrix used to store the increase in weight on the current timestep.
|
protected |
This is the DoubleMatrixPtrVector used to store the calculated increase in length for each length group on the current timestep.
|
protected |
This is the LengthGroupDivision used to store length information.
|
protected |
This is the maximum number of length groups that an individual fish from the stock can grow on one timestep.
|
protected |
This is the PopInfoMatrix used to store information about the current population of the stock that is to grow according to the growth calculations.
|
protected |
This is a DoubleVector used when calculating the beta binomial distribution.
|
protected |
This is a DoubleVector used when calculating the beta binomial distribution.
|
protected |
This is a double used when calculating the beta binomial distribution.
|
protected |
This is a DoubleVector used when calculating the beta binomial distribution.
|
protected |
This is the DoubleMatrixPtrVector used to store the calculated increase in weight for each length group on the current timestep.