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

This is the base class used to calculate a likelihood score by fitting a regression line to the model population and survey index data. More...

#include <sionstep.h>

Inheritance diagram for SIOnStep:
Inheritance graph
Collaboration diagram for SIOnStep:
Collaboration graph

Public Member Functions

 SIOnStep (CommentStream &infile, const char *datafilename, const CharPtrVector &aindex, const TimeClass *const TimeInfo, const IntMatrix &areas, const CharPtrVector &charindex, const char *givenname, int bio, SIType type)
 This is the default SIOnStep constructor. More...
 
virtual ~SIOnStep ()
 This is the default SIOnStep destructor. More...
 
virtual void Sum (const TimeClass *const TimeInfo)=0
 This function will sum the survey index data. More...
 
virtual void setFleetsAndStocks (FleetPtrVector &Fleets, StockPtrVector &Stocks)=0
 This will select the fleets and stocks required to calculate the regression line. More...
 
virtual void Reset ()
 This function will reset the SIOnStep information. More...
 
virtual void Print (ofstream &outfile) const =0
 This function will print the SIOnStep information. More...
 
virtual void printLikelihood (ofstream &outfile, const TimeClass *const TimeInfo)
 This function will print information from each SIOnStep regression calculation. More...
 
virtual void printSummary (ofstream &outfile, const double weight)
 This function will print summary information from each SIOnStep regression calculation. More...
 
virtual double calcSSE ()
 This function will calculate the SSE from the regression line. More...
 
FitType getType () const
 This will return the fit type for the regression line. More...
 
SIType getSIType () const
 This will return the type of survey index data to be used. 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 Attributes

IntMatrix Areas
 This is the IntMatrix used to store information about the areas that the survey index should be calculated on. More...
 
IntVector Years
 This is the IntVector used to store information about the years when the survey index should be calculated. More...
 
IntVector Steps
 This is the IntVector used to store information about the steps when the survey index should be calculated. More...
 
IntMatrix Ages
 This is the IntMatrix used to store information about the ages that the survey index should be calculated on. More...
 
LengthGroupDivisionLgrpDiv
 This is the LengthGroupDivision used to store information about the lengths that the survey index should be calculated on. More...
 
DoubleVector likelihoodValues
 This is the DoubleVector used to store the calculated likelihood information. More...
 
ActionAtTimes AAT
 This ActionAtTimes stores information about when the survey index should be calculated. More...
 
DoubleMatrixPtrVector obsIndex
 This is the DoubleMatrixPtrVector used to store the survey indices specified in the input file. More...
 
DoubleMatrixPtrVector modelIndex
 This is the DoubleMatrixPtrVector used to store the survey indices calculated in the model. More...
 
DoubleMatrixPtrVector weightIndex
 This is the DoubleMatrixPtrVector used to store the weights specified for the regression line. More...
 
const AgeBandMatrixPtrVectoralptr
 This is the AgeBandMatrixPtrVector used to temporarily store the information returned from the aggregatation function. More...
 
SIType sitype
 This denotes what type of survey index data is to be used. More...
 
int timeindex
 This is the index of the timesteps for the survey index data. More...
 
int biomass
 This is the flag to denote whether the index should be based on the biomass or not. More...
 
int useweight
 This is the flag to denote whether weighted regression line should be used when calculating the fit to the data or not. More...
 

Detailed Description

This is the base class used to calculate a likelihood score by fitting a regression line to the model population and survey index data.

Note
This will always be overridden by the derived classes that actually calculate the survey indices and the likelihood score from the regression line

Constructor & Destructor Documentation

◆ SIOnStep()

SIOnStep::SIOnStep ( CommentStream infile,
const char *  datafilename,
const CharPtrVector aindex,
const TimeClass *const  TimeInfo,
const IntMatrix areas,
const CharPtrVector charindex,
const char *  givenname,
int  bio,
SIType  type 
)

This is the default SIOnStep constructor.

Parameters
infileis the CommentStream to read the SIOnStep data from
datafilenameis the name of the file to read the index data from
aindexis the CharPtrVector of the names of the areas for the survey indices
TimeInfois the TimeClass for the current model
areasis the IntMatrix of the areas that the survey indices are calculated on
charindexis the CharPtrVector of the names of the column index for the survey indices
givennameis the name for the SIOnStep component
biois the flag to denote whether the index should be based on the biomass or not
typeis the SIType of the SIOnStep

◆ ~SIOnStep()

SIOnStep::~SIOnStep ( )
virtual

This is the default SIOnStep destructor.

Member Function Documentation

◆ calcSSE()

double SIOnStep::calcSSE ( )
virtual

This function will calculate the SSE from the regression line.

Returns
SSE from the regession line

◆ getSIType()

SIType SIOnStep::getSIType ( ) const
inline

This will return the type of survey index data to be used.

Returns
sitype

◆ getType()

FitType SIOnStep::getType ( ) const
inline

This will return the fit type for the regression line.

Returns
fittype

◆ Print()

virtual void SIOnStep::Print ( ofstream &  outfile) const
pure virtual

This function will print the SIOnStep information.

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

Implemented in SIByLengthOnStep, SIByFleetOnStep, SIByEffortOnStep, SIByAgeOnStep, and SIByAcousticOnStep.

◆ printLikelihood()

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

This function will print information from each SIOnStep regression calculation.

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

◆ printSummary()

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

This function will print summary information from each SIOnStep regression calculation.

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

◆ Reset()

void SIOnStep::Reset ( )
virtual

This function will reset the SIOnStep information.

◆ setFleetsAndStocks()

virtual void SIOnStep::setFleetsAndStocks ( FleetPtrVector Fleets,
StockPtrVector Stocks 
)
pure virtual

This will select the fleets and stocks required to calculate the regression line.

Parameters
Fleetsis the FleetPtrVector of all the available fleets
Stocksis the StockPtrVector of all the available stocks

Implemented in SIByLengthOnStep, SIByFleetOnStep, SIByEffortOnStep, SIByAgeOnStep, and SIByAcousticOnStep.

◆ Sum()

virtual void SIOnStep::Sum ( const TimeClass *const  TimeInfo)
pure virtual

This function will sum the survey index data.

Parameters
TimeInfois the TimeClass for the current model

Implemented in SIByLengthOnStep, SIByFleetOnStep, SIByEffortOnStep, SIByAgeOnStep, and SIByAcousticOnStep.

Member Data Documentation

◆ AAT

ActionAtTimes SIOnStep::AAT
protected

This ActionAtTimes stores information about when the survey index should be calculated.

◆ Ages

IntMatrix SIOnStep::Ages
protected

This is the IntMatrix used to store information about the ages that the survey index should be calculated on.

◆ alptr

const AgeBandMatrixPtrVector* SIOnStep::alptr
protected

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

◆ Areas

IntMatrix SIOnStep::Areas
protected

This is the IntMatrix used to store information about the areas that the survey index should be calculated on.

◆ biomass

int SIOnStep::biomass
protected

This is the flag to denote whether the index should be based on the biomass or not.

Note
The default value for this is 0, which means that the index is based on the number of the population

◆ LgrpDiv

LengthGroupDivision* SIOnStep::LgrpDiv
protected

This is the LengthGroupDivision used to store information about the lengths that the survey index should be calculated on.

◆ likelihoodValues

DoubleVector SIOnStep::likelihoodValues
protected

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

◆ modelIndex

DoubleMatrixPtrVector SIOnStep::modelIndex
protected

This is the DoubleMatrixPtrVector used to store the survey indices calculated in the model.

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

◆ obsIndex

DoubleMatrixPtrVector SIOnStep::obsIndex
protected

This is the DoubleMatrixPtrVector used to store the survey indices specified in the input file.

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

◆ sitype

SIType SIOnStep::sitype
protected

This denotes what type of survey index data is to be used.

◆ Steps

IntVector SIOnStep::Steps
protected

This is the IntVector used to store information about the steps when the survey index should be calculated.

◆ timeindex

int SIOnStep::timeindex
protected

This is the index of the timesteps for the survey index data.

◆ useweight

int SIOnStep::useweight
protected

This is the flag to denote whether weighted regression line should be used when calculating the fit to the data or not.

Note
The default value for this is 0, which means that the regression line doesnt use weights

◆ weightIndex

DoubleMatrixPtrVector SIOnStep::weightIndex
protected

This is the DoubleMatrixPtrVector used to store the weights specified for the regression line.

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

◆ Years

IntVector SIOnStep::Years
protected

This is the IntVector used to store information about the years when the survey index should be calculated.


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