Gadget
|
This is the base class used to model the consumption of a prey. More...
#include <prey.h>
Public Member Functions | |
Prey (CommentStream &infile, const IntVector &areas, const char *givenname, const TimeClass *const TimeInfo, Keeper *const keeper) | |
This is the Prey constructor to create a prey by reading data from a file. More... | |
Prey (CommentStream &infile, const char *givenname, const IntVector &areas, const TimeClass *const TimeInfo, Keeper *const keeper) | |
This is the Prey constructor for a prey with a given length group. More... | |
virtual | ~Prey ()=0 |
This is the default Prey destructor. More... | |
virtual void | Sum (const AgeBandMatrix &Alkeys, int area) |
This will calculate the amount of prey that is consumed for a given area and timestep. More... | |
virtual void | Sum (const PopInfoVector &NumberInArea, int area) |
This will calculate the amount of prey that is consumed for a given area and timestep. More... | |
virtual void | Reset (const TimeClass *const TimeInfo) |
This will reset the consumption information for the current model run. More... | |
virtual void | Print (ofstream &outfile) const |
This function will print the consumption data. More... | |
virtual void | setCI (const LengthGroupDivision *const GivenLDiv) |
This will set the ConversionIndex required for to calculate the consumption. More... | |
virtual void | Subtract (AgeBandMatrix &Alkeys, int area) |
This function will subtract the prey that is consumed from the stock. More... | |
void | addBiomassConsumption (int area, const DoubleVector &predcons) |
This function will add predation (by biomass) to the amount of the prey that is consumed. More... | |
void | addNumbersConsumption (int area, const DoubleVector &predcons) |
This function will add predation (by numbers) to the amount of the prey that is consumed. More... | |
virtual void | checkConsumption (int area, const TimeClass *const TimeInfo) |
This function will check for overconsumption of the prey. More... | |
double | getBiomass (int area, int length) const |
This will return the biomass of prey that is available for consumption by predators. More... | |
double | getNumber (int area, int length) const |
This will return the number of prey that is available for consumption by predators. More... | |
double | getTotalBiomass (int area) const |
This will return the total biomass of prey that is available for consumption. More... | |
int | isOverConsumption (int area) |
This will return the flag that denotes if the prey has been overconsumed on a given area. More... | |
const DoubleVector & | getRatio (int area) const |
This will return the ratio of the prey that has been consumed on a given area. More... | |
const DoubleVector & | getUseRatio (int area) const |
This will return the ratio of the prey that has been consumed on a given area. More... | |
const DoubleVector & | getConsumption (int area) const |
This will return the amount of the prey that has been consumed on a given area. More... | |
const DoubleVector & | getOverConsumption (int area) const |
This will return the amount of the prey that has been overconsumed on a given area. More... | |
double | getTotalOverConsumption (int area) const |
This will return the total amount of the prey that has been overconsumed on a given area. More... | |
const LengthGroupDivision * | getLengthGroupDiv () const |
This will return the length group information for the prey. More... | |
const PopInfoVector & | getConsumptionPopInfo (int area) const |
This will return the amount of prey on a given area prior to any consumption by the predators. More... | |
double | getEnergy () const |
This will return the energy content of the prey. More... | |
int | isPreyArea (int area) |
This will check if there is any prey to consume on a given area. More... | |
PreyType | getType () const |
This will return the type of prey class. 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 | |
ConversionIndex * | CI |
This is the ConversionIndex used to convert from the stock LengthGroupDivision to the LengthGroupDivision used for the consumption calculation. More... | |
LengthGroupDivision * | LgrpDiv |
This is the LengthGroupDivision used to store length information. More... | |
PopInfoMatrix | preynumber |
This is the PopInfoMatrix used to store information on the number of preys for the current timestep. More... | |
ModelVariable | energy |
This is the ModelVariable used to store the energy content of the prey (in kilojoules per kilogramme) More... | |
DoubleMatrix | biomass |
This is the DoubleMatrix used to store information on the biomass of the prey that is available for the predators to consume on the current timestep. More... | |
DoubleVector | total |
This is the DoubleVector used to store information on the total biomass of the prey that is available for the predators to consume on the current timestep. More... | |
DoubleMatrix | ratio |
This is the DoubleMatrix used to store information on the ratio of the available biomass of the prey that is available for the predators to consume has been consumed on the current timestep. More... | |
DoubleMatrix | useratio |
This is the DoubleMatrix used to store information on the ratio of the available biomass of the prey that is available for the predators to consume has been consumed on the current timestep, adjusted to MaxRatio whenever overconsumption has occured. More... | |
DoubleMatrix | consumption |
This is the DoubleMatrix used to store information on the consumption of the prey on the current timestep. More... | |
DoubleMatrix | cons |
This is the DoubleMatrix used to store information on the consumption of the prey on the current substep of the current timestep. More... | |
DoubleMatrix | overconsumption |
This is the DoubleMatrix used to store information on the overconsumption of the prey on the current timestep. More... | |
IntVector | isoverconsumption |
This is the IntVector used to store information on whether any overconsumption has occured on the current timestep. More... | |
DoubleMatrix | consratio |
This is the DoubleMatrix used to store information on the ratio of the prey to subtract on the current timestep. More... | |
PreyType | type |
This denotes what type of prey class has been created. 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 base class used to model the consumption of a prey.
This class is used to remove fish from the model due to predation, either by a fleet or through consumption by another stock. The proportion of the fish that are to be removed is calculated, based on the required consumption by all the various predators that will consume the prey. This ''target consumption'' is then checked to ensure that no more than 95% of the prey species is to be consumed, and the consumption is adjusted if this is the case. The population of the prey species is then reduced by the total amount that the various predators consume.
Prey::Prey | ( | CommentStream & | infile, |
const IntVector & | areas, | ||
const char * | givenname, | ||
const TimeClass *const | TimeInfo, | ||
Keeper *const | keeper | ||
) |
This is the Prey constructor to create a prey by reading data from a file.
infile | is the CommentStream to read the Prey data from |
areas | is the IntVector of areas that the prey lives on |
givenname | is the name of the prey |
TimeInfo | is the TimeClass for the current model |
keeper | is the Keeper for the current model |
Prey::Prey | ( | CommentStream & | infile, |
const char * | givenname, | ||
const IntVector & | areas, | ||
const TimeClass *const | TimeInfo, | ||
Keeper *const | keeper | ||
) |
This is the Prey constructor for a prey with a given length group.
infile | is the CommentStream to read the Prey data from |
givenname | is the name of the prey |
areas | is the IntVector of areas that the prey lives on |
TimeInfo | is the TimeClass for the current model |
keeper | is the Keeper for the current model |
|
pure virtual |
This is the default Prey destructor.
void Prey::addBiomassConsumption | ( | int | area, |
const DoubleVector & | predcons | ||
) |
This function will add predation (by biomass) to the amount of the prey that is consumed.
area | is the area that the consumption is being calculated on |
predcons | is the DoubleVector containing the predation data |
void Prey::addNumbersConsumption | ( | int | area, |
const DoubleVector & | predcons | ||
) |
This function will add predation (by numbers) to the amount of the prey that is consumed.
area | is the area that the consumption is being calculated on |
predcons | is the DoubleVector containing the predation data |
|
virtual |
This function will check for overconsumption of the prey.
area | is the area that the consumption is being calculated on |
TimeInfo | is the TimeClass for the current model |
|
inline |
This will return the biomass of prey that is available for consumption by predators.
area | is the area that the consumption is being calculated on |
length | is the length group of the prey |
|
inline |
This will return the amount of the prey that has been consumed on a given area.
area | is the area that the consumption is being calculated on |
|
inline |
This will return the amount of prey on a given area prior to any consumption by the predators.
area | is the area that the consumption is being calculated on |
|
inline |
This will return the energy content of the prey.
|
inline |
This will return the length group information for the prey.
|
inline |
This will return the number of prey that is available for consumption by predators.
area | is the area that the consumption is being calculated on |
length | is the length group of the prey |
|
inline |
This will return the amount of the prey that has been overconsumed on a given area.
area | is the area that the consumption is being calculated on |
|
inline |
This will return the ratio of the prey that has been consumed on a given area.
area | is the area that the consumption is being calculated on |
|
inline |
This will return the total biomass of prey that is available for consumption.
area | is the area that the consumption is being calculated on |
double Prey::getTotalOverConsumption | ( | int | area | ) | const |
This will return the total amount of the prey that has been overconsumed on a given area.
area | is the area that the consumption is being calculated on |
|
inline |
This will return the type of prey class.
|
inline |
This will return the ratio of the prey that has been consumed on a given area.
area | is the area that the consumption is being calculated on |
int Prey::isOverConsumption | ( | int | area | ) |
This will return the flag that denotes if the prey has been overconsumed on a given area.
area | is the area that the consumption is being calculated on |
int Prey::isPreyArea | ( | int | area | ) |
This will check if there is any prey to consume on a given area.
area | is the area that the prey will be consumed on |
|
virtual |
This function will print the consumption data.
outfile | is the ofstream that all the model information gets sent to |
Reimplemented in StockPrey.
|
virtual |
This will reset the consumption information for the current model run.
TimeInfo | is the TimeClass for the current model |
|
virtual |
This will set the ConversionIndex required for to calculate the consumption.
GivenLDiv | is the LengthGroupDivision for the stock |
|
virtual |
This function will subtract the prey that is consumed from the stock.
Alkeys | is the AgeBandMatrix containing the population of the stock |
area | is the area that the consumption is being calculated on |
|
inlinevirtual |
This will calculate the amount of prey that is consumed for a given area and timestep.
Alkeys | is the AgeBandMatrix giving the amount of prey in the area |
area | is the area that the prey consumption is being calculated on |
Reimplemented in StockPrey.
|
inlinevirtual |
This will calculate the amount of prey that is consumed for a given area and timestep.
NumberInArea | is the PopInfoVector giving the amount of prey in the area |
area | is the area that the prey consumption is being calculated on |
Reimplemented in LengthPrey.
|
protected |
This is the DoubleMatrix used to store information on the biomass of the prey that is available for the predators to consume on the current timestep.
|
protected |
This is the ConversionIndex used to convert from the stock LengthGroupDivision to the LengthGroupDivision used for the consumption calculation.
|
protected |
This is the DoubleMatrix used to store information on the consumption of the prey on the current substep of the current timestep.
|
protected |
This is the DoubleMatrix used to store information on the ratio of the prey to subtract on the current timestep.
|
protected |
This is the DoubleMatrix used to store information on the consumption of the prey on the current timestep.
|
protected |
This is the ModelVariable used to store the energy content of the prey (in kilojoules per kilogramme)
|
protected |
This is the IntVector used to store information on whether any overconsumption has occured on the current timestep.
|
protected |
This is the LengthGroupDivision used to store length information.
|
protected |
This is the DoubleMatrix used to store information on the overconsumption of the prey on the current timestep.
|
protected |
This is the PopInfoMatrix used to store information on the number of preys for the current timestep.
|
protected |
This is the DoubleMatrix used to store information on the ratio of the available biomass of the prey that is available for the predators to consume has been consumed on the current timestep.
|
protected |
This is the DoubleVector used to store information on the total biomass of the prey that is available for the predators to consume on the current timestep.
|
protected |
This denotes what type of prey class has been created.
|
protected |
This is the DoubleMatrix used to store information on the ratio of the available biomass of the prey that is available for the predators to consume has been consumed on the current timestep, adjusted to MaxRatio whenever overconsumption has occured.