Gadget
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
SC Class Referenceabstract

This is the base class used to calculate the stomach content likelihood score based on the consumption of the preys in the model and the stomach content data specified in the input files. More...

#include <stomachcontent.h>

Inheritance diagram for SC:
Inheritance graph
Collaboration diagram for SC:
Collaboration graph

Public Member Functions

 SC (CommentStream &infile, const AreaClass *const Area, const TimeClass *const TimeInfo, Keeper *const keeper, const char *datafilename, const char *givenname)
 This is the SC constructor. More...
 
virtual ~SC ()
 This is the default SC destructor. More...
 
virtual double calcLikelihood (const TimeClass *const TimeInfo)
 This function will calculate the likelihood score from the SC information. More...
 
virtual void Reset ()
 This function will reset the SC information. More...
 
virtual void Print (ofstream &outfile) const
 This function will print the summary SC information. More...
 
virtual void setPredatorsAndPreys (PredatorPtrVector &Predators, PreyPtrVector &Preys)
 This will select the predators and preys required to calculate the SC likelihood score. More...
 
virtual void printSummary (ofstream &outfile, double weight)
 This function will print summary information from each StomachContent likelihood calculation. More...
 
virtual void printLikelihood (ofstream &outfile, const TimeClass *const TimeInfo)
 This function will print information from each StomachContent calculation. More...
 
virtual void aggregate (int i)
 This function will aggregate consumption information for each StomachContent calculation. 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

virtual double calcLikelihood ()=0
 This function will calculate the likelihood score from the SC information. More...
 

Protected Attributes

DoubleMatrixPtrMatrix obsConsumption
 This is the DoubleMatrixPtrMatrix used to store stomach content (consumption) information specified in the input file. More...
 
DoubleMatrixPtrMatrix modelConsumption
 This is the DoubleMatrixPtrMatrix used to store consumption (stomach content) information calculated in the model. More...
 
DoubleMatrix likelihoodValues
 This is the DoubleMatrix used to store the calculated likelihood information. More...
 
CharPtrVector predatornames
 This is the CharPtrVector of the names of the predators that will be used to calculate the likelihood score. More...
 
CharPtrMatrix preynames
 This is the CharPtrMatrix of the names of the preys that will be used to calculate the likelihood score. More...
 
CharPtrVector areaindex
 This is the CharPtrVector of the names of the areas. More...
 
CharPtrVector predindex
 This is the CharPtrVector of the names of the predator aggregation units (either age or length) that will be read in from the input file. More...
 
CharPtrVector preyindex
 This is the CharPtrVector of the names of the prey aggregation units that will be read in from the input file. More...
 
IntVector Years
 This is the IntVector used to store information about the years when the likelihood score should be calculated. More...
 
IntVector Steps
 This is the IntVector used to store information about the steps when the likelihood score should be calculated. More...
 
DoubleVector predatorlengths
 This is the DoubleVector used to store predator length information. More...
 
IntMatrix predatorages
 This is the IntMatrix used to store predator age information. More...
 
DoubleMatrix preylengths
 This is the DoubleMatrix used to store prey length information. More...
 
IntMatrix areas
 This is the IntMatrix used to store area information. More...
 
int usepredages
 This is the flag used to denote whether the predators are specified using age groups or length groups. More...
 
PredatorAggregator ** aggregator
 This is the PredatorAggregator used to collect information about the predation. More...
 
LengthGroupDivision ** preyLgrpDiv
 This is the LengthGroupDivision used to store predator length information. More...
 
LengthGroupDivisionpredLgrpDiv
 This is the LengthGroupDivision used to store prey length information. More...
 
int timeindex
 This is the index of the timesteps for the likelihood component data. More...
 
ActionAtTimes AAT
 This ActionAtTimes stores information about when the likelihood score should be calculated. More...
 
FormulaMatrix digestioncoeff
 This is the FormulaMatrix used to store the digestion parameters for the various predator prey pairs. More...
 
DoubleMatrix digestion
 This is the DoubleMatrix used to store the calculated digestion coefficiants for the various predator prey pairs. More...
 
double epsilon
 This is the value of epsilon used when calculating the likelihood score. More...
 
const DoubleMatrixdptr
 This is the DoubleMatrix used to temporarily store the information returned from the aggregatation function. More...
 

Detailed Description

This is the base class used to calculate the stomach content likelihood score based on the consumption of the preys in the model and the stomach content data specified in the input files.

Note
This will always be overridden by the derived classes that actually calculate the stomach content likelihood score

Constructor & Destructor Documentation

◆ SC()

SC::SC ( CommentStream infile,
const AreaClass *const  Area,
const TimeClass *const  TimeInfo,
Keeper *const  keeper,
const char *  datafilename,
const char *  givenname 
)

This is the SC constructor.

Parameters
infileis the CommentStream to read the SC data from
Areais the AreaClass for the current model
TimeInfois the TimeClass for the current model
keeperis the Keeper for the current model
datafilenameis the name of the file containing the SC data
givennameis the name for the likelihood component

◆ ~SC()

SC::~SC ( )
virtual

This is the default SC destructor.

Member Function Documentation

◆ aggregate()

void SC::aggregate ( int  i)
virtual

This function will aggregate consumption information for each StomachContent calculation.

Parameters
iis the index of the prey that is being consumed

Reimplemented in SCNumbers.

◆ calcLikelihood() [1/2]

virtual double SC::calcLikelihood ( )
protectedpure virtual

This function will calculate the likelihood score from the SC information.

Returns
0 (will be overridden in derived classes)

Implemented in SCSimple, SCRatios, SCAmounts, and SCNumbers.

◆ calcLikelihood() [2/2]

double SC::calcLikelihood ( const TimeClass *const  TimeInfo)
virtual

This function will calculate the likelihood score from the SC information.

Parameters
TimeInfois the TimeClass for the current model
Returns
likelihood score

◆ Print()

void SC::Print ( ofstream &  outfile) const
virtual

This function will print the summary SC information.

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

◆ printLikelihood()

void SC::printLikelihood ( ofstream &  outfile,
const TimeClass *const  TimeInfo 
)
virtual

This function will print information from each StomachContent calculation.

Parameters
outfileis the ofstream that all the model likelihood information gets sent to
TimeInfois the TimeClass for the current model

Reimplemented in SCAmounts.

◆ printSummary()

void SC::printSummary ( ofstream &  outfile,
double  weight 
)
virtual

This function will print summary information from each StomachContent likelihood calculation.

Parameters
outfileis the ofstream that all the model likelihood information gets sent to
weightis the weight for the likelihood component

◆ Reset()

void SC::Reset ( )
virtual

This function will reset the SC information.

◆ setPredatorsAndPreys()

void SC::setPredatorsAndPreys ( PredatorPtrVector Predators,
PreyPtrVector Preys 
)
virtual

This will select the predators and preys required to calculate the SC likelihood score.

Parameters
Predatorsis the PredatorPtrVector of all the available predators
Preysis the PreyPtrVector of all the available preys

Reimplemented in SCSimple, and SCRatios.

Member Data Documentation

◆ AAT

ActionAtTimes SC::AAT
protected

This ActionAtTimes stores information about when the likelihood score should be calculated.

◆ aggregator

PredatorAggregator** SC::aggregator
protected

This is the PredatorAggregator used to collect information about the predation.

◆ areaindex

CharPtrVector SC::areaindex
protected

This is the CharPtrVector of the names of the areas.

◆ areas

IntMatrix SC::areas
protected

This is the IntMatrix used to store area information.

◆ digestion

DoubleMatrix SC::digestion
protected

This is the DoubleMatrix used to store the calculated digestion coefficiants for the various predator prey pairs.

◆ digestioncoeff

FormulaMatrix SC::digestioncoeff
protected

This is the FormulaMatrix used to store the digestion parameters for the various predator prey pairs.

◆ dptr

const DoubleMatrix* SC::dptr
protected

This is the DoubleMatrix used to temporarily store the information returned from the aggregatation function.

◆ epsilon

double SC::epsilon
protected

This is the value of epsilon used when calculating the likelihood score.

◆ likelihoodValues

DoubleMatrix SC::likelihoodValues
protected

This is the DoubleMatrix used to store the calculated likelihood information.

Note
The indices for this object are [time][area]

◆ modelConsumption

DoubleMatrixPtrMatrix SC::modelConsumption
protected

This is the DoubleMatrixPtrMatrix used to store consumption (stomach content) information calculated in the model.

Note
The indices for this object are [time][area][predator][prey]

◆ obsConsumption

DoubleMatrixPtrMatrix SC::obsConsumption
protected

This is the DoubleMatrixPtrMatrix used to store stomach content (consumption) information specified in the input file.

Note
The indices for this object are [time][area][predator][prey]

◆ predatorages

IntMatrix SC::predatorages
protected

This is the IntMatrix used to store predator age information.

◆ predatorlengths

DoubleVector SC::predatorlengths
protected

This is the DoubleVector used to store predator length information.

◆ predatornames

CharPtrVector SC::predatornames
protected

This is the CharPtrVector of the names of the predators that will be used to calculate the likelihood score.

◆ predindex

CharPtrVector SC::predindex
protected

This is the CharPtrVector of the names of the predator aggregation units (either age or length) that will be read in from the input file.

◆ predLgrpDiv

LengthGroupDivision* SC::predLgrpDiv
protected

This is the LengthGroupDivision used to store prey length information.

◆ preyindex

CharPtrVector SC::preyindex
protected

This is the CharPtrVector of the names of the prey aggregation units that will be read in from the input file.

◆ preylengths

DoubleMatrix SC::preylengths
protected

This is the DoubleMatrix used to store prey length information.

Note
The indices for this object are [prey number][prey length]

◆ preyLgrpDiv

LengthGroupDivision** SC::preyLgrpDiv
protected

This is the LengthGroupDivision used to store predator length information.

◆ preynames

CharPtrMatrix SC::preynames
protected

This is the CharPtrMatrix of the names of the preys that will be used to calculate the likelihood score.

◆ Steps

IntVector SC::Steps
protected

This is the IntVector used to store information about the steps when the likelihood score should be calculated.

◆ timeindex

int SC::timeindex
protected

This is the index of the timesteps for the likelihood component data.

◆ usepredages

int SC::usepredages
protected

This is the flag used to denote whether the predators are specified using age groups or length groups.

◆ Years

IntVector SC::Years
protected

This is the IntVector used to store information about the years when the likelihood score should be calculated.


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