Gadget
Public Member Functions | List of all members
StomachContent Class Reference

This is the class used to calculate a likelihood score based on data sampled from the stomach of stocks caught by fleets. More...

#include <stomachcontent.h>

Inheritance diagram for StomachContent:
Inheritance graph
Collaboration diagram for StomachContent:
Collaboration graph

Public Member Functions

 StomachContent (CommentStream &infile, const AreaClass *const Area, const TimeClass *const TimeInfo, Keeper *const keeper, double weight, const char *name)
 This is the StomachContent constructor. More...
 
virtual ~StomachContent ()
 This is the default StomachContent destructor. More...
 
virtual void addLikelihood (const TimeClass *const TimeInfo)
 This function will calculate the likelihood score for the StomachContent component. More...
 
virtual void Reset (const Keeper *const keeper)
 This function will reset the StomachContent likelihood information. More...
 
virtual void Print (ofstream &outfile) const
 This function will print the summary StomachContent likelihood information. More...
 
void setPredatorsAndPreys (PredatorPtrVector &Predators, PreyPtrVector &Preys)
 This will select the predators and preys required to calculate the StomachContent likelihood score. More...
 
virtual void printSummary (ofstream &outfile)
 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...
 
- Public Member Functions inherited from Likelihood
 Likelihood (LikelihoodType T, double w, const char *givenname)
 This is the default Likelihood constructor. More...
 
virtual ~Likelihood ()
 This is the default Likelihood destructor. More...
 
virtual void addLikelihoodKeeper (const TimeClass *const TimeInfo, Keeper *const keeper)
 This function will calculate the likelihood score for the current model after adjusting the parameters. More...
 
virtual void Reset (const TimeClass *const TimeInfo)
 This function will reset the likelihood information. More...
 
double getLikelihood () const
 This will return the weighted likelihood score for the likelihood component. More...
 
LikelihoodType getType () const
 This will return the type of likelihood class. More...
 
double getUnweightedLikelihood () const
 This will return the unweighted likelihood score for the likelihood component. More...
 
double getWeight () const
 This will return the weight applied to the likelihood component. More...
 
virtual void setFleetsAndStocks (FleetPtrVector &Fleets, StockPtrVector &Stocks)
 This will select the fleets and stocks required to calculate the likelihood score. 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...
 

Additional Inherited Members

- Protected Attributes inherited from Likelihood
double likelihood
 This stores the calculated score for the likelihood component. More...
 
double weight
 This stores the weight to be applied to the likelihood component. More...
 

Detailed Description

This is the class used to calculate a likelihood score based on data sampled from the stomach of stocks caught by fleets.

This class calculates a likelihood score based on the difference between stomach contents data sampled from stocks caught according to the model and that caught by fleets, according to the landings data. The stomach contents data can either be aggregated into length groups (giving a distribution of prey groups for each length) or into prey groups (giving a distribution of length groups for each prey). The model will calculate the stomach contents data for the predators that are caught according to the model parameters, and then compare this to the corresponding data calculated from the observed stomach contents data

Note
Care is needed when making this comparison, since the data will give information on the stomach content at the time of capture of the predator, where as the model can only give information about the modelled consumption of the prey by the predator.

Constructor & Destructor Documentation

◆ StomachContent()

StomachContent::StomachContent ( CommentStream infile,
const AreaClass *const  Area,
const TimeClass *const  TimeInfo,
Keeper *const  keeper,
double  weight,
const char *  name 
)

This is the StomachContent constructor.

Parameters
infileis the CommentStream to read the StomachContent data from
Areais the AreaClass for the current model
TimeInfois the TimeClass for the current model
keeperis the Keeper for the current model
weightis the weight for the likelihood component
nameis the name for the likelihood component

◆ ~StomachContent()

StomachContent::~StomachContent ( )
virtual

This is the default StomachContent destructor.

Member Function Documentation

◆ addLikelihood()

void StomachContent::addLikelihood ( const TimeClass *const  TimeInfo)
virtual

This function will calculate the likelihood score for the StomachContent component.

Parameters
TimeInfois the TimeClass for the current model

Implements Likelihood.

◆ Print()

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

This function will print the summary StomachContent likelihood information.

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

Implements Likelihood.

◆ printLikelihood()

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

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 from Likelihood.

◆ printSummary()

virtual void StomachContent::printSummary ( ofstream &  outfile)
inlinevirtual

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

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

Reimplemented from Likelihood.

◆ Reset()

void StomachContent::Reset ( const Keeper *const  keeper)
virtual

This function will reset the StomachContent likelihood information.

Parameters
keeperis the Keeper for the current model

Reimplemented from Likelihood.

◆ setPredatorsAndPreys()

void StomachContent::setPredatorsAndPreys ( PredatorPtrVector Predators,
PreyPtrVector Preys 
)
inline

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

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

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