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

This is the class used to calculate a likelihood score based on the overconsumption of a stock by predators. More...

#include <understocking.h>

Inheritance diagram for UnderStocking:
Inheritance graph
Collaboration diagram for UnderStocking:
Collaboration graph

Public Member Functions

 UnderStocking (CommentStream &infile, const AreaClass *const Area, const TimeClass *const TimeInfo, double weight, const char *name)
 This is the UnderStocking constructor. More...
 
virtual ~UnderStocking ()
 This is the default UnderStocking destructor. More...
 
virtual void addLikelihood (const TimeClass *const TimeInfo)
 This function will calculate the likelihood score for the UnderStocking component. More...
 
virtual void Reset (const Keeper *const keeper)
 This function will reset the UnderStocking likelihood information. More...
 
virtual void printSummary (ofstream &outfile)
 This function will print summary information from each non-zero UnderStocking likelihood calculation. More...
 
virtual void Print (ofstream &outfile) const
 This function will print the non-zero UnderStocking likelihood information. More...
 
void setPredatorsAndPreys (PredatorPtrVector &predvec, PreyPtrVector &preyvec, const AreaClass *const Area)
 This will select the predators and preys required to calculate the UnderStocking likelihood score. 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...
 
virtual void printLikelihood (ofstream &outfile, const TimeClass *const TimeInfo)
 This function will print information from each likelihood calculation. 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 the overconsumption of a stock by predators.

This class calculates a penalty that is applied if there are insufficient fish of a particular stock to meet the requirements for the predators - usually the fleet landings data. This indicates that there are less fish in the model than have been landed (as recorded by the landings data), which is very wrong, and so this gets a high penalty. A 'reasonable' model will have a zero likelihood score from this component.

Constructor & Destructor Documentation

◆ UnderStocking()

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

This is the UnderStocking constructor.

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

◆ ~UnderStocking()

UnderStocking::~UnderStocking ( )
virtual

This is the default UnderStocking destructor.

Member Function Documentation

◆ addLikelihood()

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

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

Parameters
TimeInfois the TimeClass for the current model

Implements Likelihood.

◆ Print()

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

This function will print the non-zero UnderStocking likelihood information.

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

Implements Likelihood.

◆ printSummary()

void UnderStocking::printSummary ( ofstream &  outfile)
virtual

This function will print summary information from each non-zero UnderStocking likelihood calculation.

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

Reimplemented from Likelihood.

◆ Reset()

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

This function will reset the UnderStocking likelihood information.

Parameters
keeperis the Keeper for the current model

Reimplemented from Likelihood.

◆ setPredatorsAndPreys()

void UnderStocking::setPredatorsAndPreys ( PredatorPtrVector predvec,
PreyPtrVector preyvec,
const AreaClass *const  Area 
)

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

Parameters
predvecis the PredatorPtrVector of all the available predators
preyvecis the PreyPtrVector of all the available preys
Areais the AreaClass for the current model

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