FIMS  v0.8.0
Loading...
Searching...
No Matches
fims_popdy::CatchAtAge< Type > Class Template Reference

CatchAtAge is a class containing a catch-at-age model, which is just one of many potential fishery models that can be used in FIMS. The CatchAtAge class inherits from the FisheryModelBase class and can be used to fit both age and length data even though it is called CatchAtAge. More...

#include <catch_at_age.hpp>

Inheritance diagram for fims_popdy::CatchAtAge< Type >:
fims_popdy::FisheryModelBase< Type > fims_model_object::FIMSObject< Type >

Public Types

typedef std::map< std::string, fims::Vector< Type > >::iterator derived_quantities_iterator
 Iterate the derived quantities.
 
typedef std::map< uint32_t, std::map< std::string, fims::Vector< Type > > >::iterator fleet_derived_quantities_iterator
 Used to iterate through fleet-based derived quantities.
 
typedef std::map< uint32_t, std::map< std::string, fims::Vector< size_t > > >::iterator fleet_derived_quantities_dims_iterator
 Used to iterate through fleet-based derived quantities dimensions.
 
typedef std::map< uint32_t, std::map< std::string, fims::Vector< Type > > >::iterator population_derived_quantities_iterator
 Used to iterate through population-based derived quantities.
 
typedef std::map< uint32_t, std::map< std::string, fims::Vector< size_t > > >::iterator population_derived_quantities_dims_iterator
 Used to iterate through population-based derived quantities dimensions.
 
typedef std::map< uint32_t, std::shared_ptr< fims_popdy::Fleet< Type > > >::iterator fleet_iterator
 Iterate through fleets.
 
typedef std::map< std::string, fims::Vector< Type > >::iterator dq_iterator
 Iterate through derived quantities.
 
- Public Types inherited from fims_popdy::FisheryModelBase< Type >
typedef std::map< uint32_t, std::shared_ptr< fims_popdy::Fleet< Type > > >::iterator fleet_iterator
 Fleet-based iterator.
 
typedef std::map< uint32_t, std::map< std::string, fims::Vector< Type > > > DerivedQuantitiesMap
 Type definitions for derived quantities and dimension information maps.
 
typedef DerivedQuantitiesMap::iterator DerivedQuantitiesMapIterator
 Iterator for the derived quantities map.
 
typedef std::map< uint32_t, std::map< std::string, DimensionInfo > > DimensionInfoMap
 Type definitions for dimension information maps.
 
typedef std::map< uint32_t, std::map< std::string, UncertaintyReportInfo > > UncertaintyReportInfoMap
 Type definition for the uncertainty report information map.
 

Public Member Functions

 CatchAtAge ()
 
 CatchAtAge (const CatchAtAge &other)
 Copy constructor for the CatchAtAge class.
 
virtual ~CatchAtAge ()
 Destroy the Catch At Age object.
 
virtual void Initialize ()
 
virtual void Prepare ()
 
void AddPopulation (uint32_t id)
 
std::set< uint32_t > & GetPopulationIds ()
 Get the population ids of the model.
 
std::vector< std::shared_ptr< fims_popdy::Population< Type > > > & GetPopulations ()
 
void CalculateInitialNumbersAA (std::shared_ptr< fims_popdy::Population< Type > > &population, size_t i_age_year, size_t age)
 Calculates initial numbers at age for index and age.
 
void CalculateNumbersAA (std::shared_ptr< fims_popdy::Population< Type > > &population, size_t i_age_year, size_t i_agem1_yearm1, size_t age)
 Calculates numbers at age for a population.
 
void CalculateUnfishedNumbersAA (std::shared_ptr< fims_popdy::Population< Type > > &population, size_t i_age_year, size_t i_agem1_yearm1, size_t age)
 Calculates unfished numbers at age at year and age specific indices.
 
void CalculateMortality (std::shared_ptr< fims_popdy::Population< Type > > &population, size_t i_age_year, size_t year, size_t age)
 Calculates total mortality for a population.
 
void CalculateBiomass (std::shared_ptr< fims_popdy::Population< Type > > &population, size_t i_age_year, size_t year, size_t age)
 Calculates biomass for a population.
 
void CalculateUnfishedBiomass (std::shared_ptr< fims_popdy::Population< Type > > &population, size_t i_age_year, size_t year, size_t age)
 Calculates the unfished biomass for a population.
 
void CalculateSpawningBiomass (std::shared_ptr< fims_popdy::Population< Type > > &population, size_t i_age_year, size_t year, size_t age)
 Calculates spawning biomass for a population.
 
void CalculateUnfishedSpawningBiomass (std::shared_ptr< fims_popdy::Population< Type > > &population, size_t i_age_year, size_t year, size_t age)
 Calculated unfished spawning biomass for a population.
 
void CalculateSpawningBiomassRatio (std::shared_ptr< fims_popdy::Population< Type > > &population, size_t year)
 Calculate the spawning biomass ratio for a population and year.
 
Type CalculateSBPR0 (std::shared_ptr< fims_popdy::Population< Type > > &population)
 Calculates equilibrium spawning biomass per recruit.
 
void CalculateRecruitment (std::shared_ptr< fims_popdy::Population< Type > > &population, size_t i_age_year, size_t year, size_t i_dev)
 Calculates expected recruitment for a population.
 
void CalculateMaturityAA (std::shared_ptr< fims_popdy::Population< Type > > &population, size_t i_age_year, size_t age)
 Calculates maturity at age, in proportion, for a population.
 
void CalculateLandings (std::shared_ptr< fims_popdy::Population< Type > > &population, size_t year, size_t age)
 Calculates total catch (landings) by fleet and population for a given year by aggregating age-specific catch over ages.
 
void CalculateLandingsWeightAA (std::shared_ptr< fims_popdy::Population< Type > > &population, size_t year, size_t age)
 Calculates weight at age of the landings for a given fleet from a population.
 
void CalculateLandingsNumbersAA (std::shared_ptr< fims_popdy::Population< Type > > &population, size_t i_age_year, size_t year, size_t age)
 Calculates numbers of fish for the landings for a given fleet from a population, year and age.
 
void CalculateIndex (std::shared_ptr< fims_popdy::Population< Type > > &population, size_t i_age_year, size_t year, size_t age)
 Calculates the index for a fleet from a population.
 
void CalculateIndexNumbersAA (std::shared_ptr< fims_popdy::Population< Type > > &population, size_t i_age_year, size_t year, size_t age)
 Calculates the numbers for the index for a fleet from a population.
 
void CalculateIndexWeightAA (std::shared_ptr< fims_popdy::Population< Type > > &population, size_t year, size_t age)
 Calculates biomass of fish for the index for a given fleet from a population.
 
void evaluate_age_comp ()
 
void evaluate_length_comp ()
 
void evaluate_index ()
 
void evaluate_landings ()
 
virtual void Evaluate ()
 Evaluate the model.
 
virtual void Report ()
 
- Public Member Functions inherited from fims_popdy::FisheryModelBase< Type >
 FisheryModelBase ()
 Construct a new Fishery Model Base object.
 
 FisheryModelBase (const FisheryModelBase &other)
 Construct a new Fishery Model Base object.
 
virtual ~FisheryModelBase ()
 Destroy the Fishery Model Base object.
 
std::map< uint32_t, std::map< std::string, DimensionInfo > > & GetFleetDimensionInfo ()
 Get the fleet dimension information.
 
std::map< uint32_t, std::map< std::string, DimensionInfo > > & GetPopulationDimensionInfo ()
 Get the population dimension information.
 
DerivedQuantitiesMapGetFleetDerivedQuantities ()
 Get the fleet derived quantities.
 
DerivedQuantitiesMapGetPopulationDerivedQuantities ()
 Get the population derived quantities.
 
std::map< std::string, fims::Vector< Type > > & GetFleetDerivedQuantities (uint32_t fleet_id)
 Get the fleet derived quantities for a specified fleet.
 
void InitializeFleetDerivedQuantities (uint32_t fleet_id)
 Initialize the derived quantities map for a fleet.
 
void InitializePopulationDerivedQuantities (uint32_t population_id)
 Initialize the derived quantities map for a population.
 
std::map< std::string, fims::Vector< Type > > & GetPopulationDerivedQuantities (uint32_t population_id)
 Get the population derived quantities for a specified population.
 
std::map< std::string, DimensionInfo > & GetFleetDimensionInfo (uint32_t fleet_id)
 Get the fleet dimension information for a specified fleet.
 
std::map< std::string, DimensionInfo > & GetPopulationDimensionInfo (uint32_t population_id)
 Get the population dimension information for a specified population.
 
UncertaintyReportInfoMapGetFleetUncertaintyReportInfo ()
 Get the fleet uncertainty report information.
 
UncertaintyReportInfoMapGetPopulationUncertaintyReportInfo ()
 Get the population uncertainty report information.
 
std::map< std::string, UncertaintyReportInfo > & GetFleetUncertaintyReportInfo (uint32_t fleet_id)
 Get the fleet uncertainty report information for a specified fleet.
 
std::map< std::string, UncertaintyReportInfo > & GetPopulationUncertaintyReportInfo (uint32_t population_id)
 Get the population uncertainty report information for a specified population.
 
virtual void ResetVector (fims::Vector< Type > &v, Type value=0.0)
 Reset a vector from start to end with a value.
 
uint32_t GetId ()
 Get the Id object.
 
- Public Member Functions inherited from fims_model_object::FIMSObject< Type >
uint32_t GetId () const
 Getter that returns the unique id for parameters in the model.
 
bool CheckDimensions (size_t actual, size_t expected)
 Check the dimensions of an object.
 
virtual void create_report_vectors (std::map< std::string, fims::Vector< fims::Vector< Type > > > &report_vectors)
 Create a map of report vectors for the object. used to populate the report_vectors map in FisheryModelBase.
 
virtual void get_report_vector_count (std::map< std::string, size_t > &report_vector_count)
 Get the report vector count object. used to get the length of each report vector for populating the UncertaintyReportInfo struct in FisheryModelBase.
 

Public Attributes

std::string name_m
 The name of the model.
 
std::map< std::string, fims::Vector< fims::Vector< Type > > > report_vectors
 A map of report vectors for the object. used to populate the report_vectors map in for submodule parameters.
 
std::vector< Typeages
 
- Public Attributes inherited from fims_popdy::FisheryModelBase< Type >
std::string model_type_m
 A string specifying the model type.
 
std::set< uint32_tpopulation_ids
 Unique identifier for the fishery model.
 
std::vector< std::shared_ptr< fims_popdy::Population< Type > > > populations
 A vector of populations in the fishery model.
 
std::map< uint32_t, std::shared_ptr< fims_popdy::Fleet< Type > > > fleets
 A map of fleets in the fishery model, indexed by fleet id. Unique instances to eliminate duplicate initialization.
 
std::shared_ptr< DerivedQuantitiesMapfleet_derived_quantities
 Shared pointer for the fleet derived quantities map.
 
std::shared_ptr< DerivedQuantitiesMappopulation_derived_quantities
 Shared pointer for the population derived quantities map.
 
std::shared_ptr< DimensionInfoMapfleet_dimension_info
 Shared pointer for the fleet dimension information map.
 
std::shared_ptr< DimensionInfoMappopulation_dimension_info
 Shared pointer for the population dimension information map.
 
std::shared_ptr< UncertaintyReportInfoMapfleet_uncertainty_report_info
 Shared pointer for the uncertainty report information map.
 
std::shared_ptr< UncertaintyReportInfoMappopulation_uncertainty_report_info
 Shared pointer for the population uncertainty report information map.
 
- Public Attributes inherited from fims_model_object::FIMSObject< Type >
uint32_t id
 
std::vector< Type * > parameters
 
std::vector< Type * > random_effects_parameters
 
std::vector< Type * > fixed_effects_parameters
 

Detailed Description

template<typename Type>
class fims_popdy::CatchAtAge< Type >

CatchAtAge is a class containing a catch-at-age model, which is just one of many potential fishery models that can be used in FIMS. The CatchAtAge class inherits from the FisheryModelBase class and can be used to fit both age and length data even though it is called CatchAtAge.

Constructor & Destructor Documentation

◆ CatchAtAge() [1/2]

template<typename Type >
fims_popdy::CatchAtAge< Type >::CatchAtAge ( )
inline

Constructor for the CatchAtAge class. This constructor initializes the name of the model and sets the id of the model.

◆ CatchAtAge() [2/2]

template<typename Type >
fims_popdy::CatchAtAge< Type >::CatchAtAge ( const CatchAtAge< Type > &  other)
inline

Copy constructor for the CatchAtAge class.

Parameters
otherThe other CatchAtAge object to copy from.

Member Function Documentation

◆ AddPopulation()

template<typename Type >
void fims_popdy::CatchAtAge< Type >::AddPopulation ( uint32_t  id)
inline

This function is used to add a population id to the set of population ids.

◆ CalculateBiomass()

template<typename Type >
void fims_popdy::CatchAtAge< Type >::CalculateBiomass ( std::shared_ptr< fims_popdy::Population< Type > > &  population,
size_t  i_age_year,
size_t  year,
size_t  age 
)
inline

Calculates biomass for a population.

Adds the biomass at age to the total biomass for a given year \(y\) by multiplying numbers at age \(a\) by weight at age \(w_a\):

\[ B_y \mathrel{+}= N_{a,y} \times w_a \]

Parameters
populationShared pointer to the population object.
Parameters
i_age_yearDimension folded index for age and year.
Parameters
yearYear index.
Parameters
ageAge index.

◆ CalculateIndex()

template<typename Type >
void fims_popdy::CatchAtAge< Type >::CalculateIndex ( std::shared_ptr< fims_popdy::Population< Type > > &  population,
size_t  i_age_year,
size_t  year,
size_t  age 
)
inline

Calculates the index for a fleet from a population.

This function updates the population indices for each fleet by adding the age- and year-specific index weights and numbers to the corresponding annual totals. The updated index weight and index numbers for a given fleet and year are calculated as:

\[ IW_{f,y} \mathrel{+}= IWAA_{a,y}, \quad IN_{f,y} \mathrel{+}= INAA_{a,y} \]

where:

  • \(IW_{f,y}\) is the total index weight for fleet \(f\) in year \(y\)
  • \(IN_{f,y}\) is the total index numbers for fleet \(f\) in year \(y\)
  • \(IWAA_{a,y}\) is the index weight at age \(a\) in year \(y\)
  • \(INAA_{a,y}\) is the index numbers at age \(a\) in year \(y\)

Parameters
populationShared pointer to the population object.
Parameters
i_age_yearDimension folded index for age and year.
Parameters
yearYear index.
Parameters
ageAge index.

◆ CalculateIndexNumbersAA()

template<typename Type >
void fims_popdy::CatchAtAge< Type >::CalculateIndexNumbersAA ( std::shared_ptr< fims_popdy::Population< Type > > &  population,
size_t  i_age_year,
size_t  year,
size_t  age 
)
inline

Calculates the numbers for the index for a fleet from a population.

This function calculates the expected index in numbers at age for each fleet, using catchability, selectivity, and population numbers at age:

\[ I_{f,a,y} \mathrel{+}= q_{f,y} \times S_f(a) \times N_{a,y} \]

where:

  • \(I_{f,a,y}\) is the index numbers for fleet \(f\) at age \(a\) in year \(y\)
  • \(q_{f,y}\) is the catchability coefficient for fleet \(f\) at year \(y\)
  • \(S_f(a)\) is the selectivity at age \(a\) for fleet \(f\)
  • \(N_{a,y}\) is the population numbers at age \(a\) and year \(y\)

When timing is accounted for within FIMS the equation will include the fraction of the year when the survey was conducted \(t_y\):

\[ I_{f,a,y} \mathrel{+}= S_{f,y}(a) \times N_{a,y} \times e^{(-t_{y}Z_{a,y})}\]

Parameters
populationShared pointer to the population object.
Parameters
i_age_yearDimension folded index for age and year.
Parameters
yearYear index.
Parameters
ageAge index.

◆ CalculateIndexWeightAA()

template<typename Type >
void fims_popdy::CatchAtAge< Type >::CalculateIndexWeightAA ( std::shared_ptr< fims_popdy::Population< Type > > &  population,
size_t  year,
size_t  age 
)
inline

Calculates biomass of fish for the index for a given fleet from a population.

This function computes the expected index weight at age by multiplying the expected index numbers at age by the corresponding weight at age:

\[ IWAA_{f,a,y} = I_{f,a,y} \times w_a \]

where \(IWAA_{f,a,y}\) is the index weight for fleet \(f\) at age \(a\) in year \(y\).

Parameters
populationShared pointer to the population object.
Parameters
yearYear index.
Parameters
ageAge index.

◆ CalculateInitialNumbersAA()

template<typename Type >
void fims_popdy::CatchAtAge< Type >::CalculateInitialNumbersAA ( std::shared_ptr< fims_popdy::Population< Type > > &  population,
size_t  i_age_year,
size_t  age 
)
inline

Calculates initial numbers at age for index and age.

The formula used is:

\[ N_{a,0} = \exp(\log N_{a,0}) \]

Parameters
populationShared pointer to the population object.
Parameters
i_age_yearDimension folded index for age and year.
Parameters
ageAge index.

◆ CalculateLandings()

template<typename Type >
void fims_popdy::CatchAtAge< Type >::CalculateLandings ( std::shared_ptr< fims_popdy::Population< Type > > &  population,
size_t  year,
size_t  age 
)
inline

Calculates total catch (landings) by fleet and population for a given year by aggregating age-specific catch over ages.

This function updates fleet-specific and total expected landings for a given year and age by accumulating age-specific catch from each fleet:

\[ CW_{f,y} \mathrel{+}= CW_{f,a,y}, \quad C_{f,y} \mathrel{+}= C_{f,a,y} \]

where

  • \(CW_{f,y}\) is total catch weight for fleet \(f\) in year \(y\)
  • \(C_{f,y}\) is total catch numbers for fleet \(f\) in year \(y\)
  • \(CW_{f,a,y}\), \(C_{f,a,y}\) are catch weight and numbers for fleet \(f\) at age \(a\) in year \(y\).

Parameters
populationShared pointer to the population object.
Parameters
yearYear index.
Parameters
ageAge index.

◆ CalculateLandingsNumbersAA()

template<typename Type >
void fims_popdy::CatchAtAge< Type >::CalculateLandingsNumbersAA ( std::shared_ptr< fims_popdy::Population< Type > > &  population,
size_t  i_age_year,
size_t  year,
size_t  age 
)
inline

Calculates numbers of fish for the landings for a given fleet from a population, year and age.

This function uses the Baranov Catch Equation to calculate expected landings in numbers at age for each fleet. With F multiplier \(f_y\):

\[ C_{f,a,y} = \frac{F_{f,y} \times f_y \times S_f(a)}{Z_{a,y}} \times N_{a,y} \times \left( 1 - \exp(-Z_{a,y}) \right) \]

where

  • \(C_{f,a,y}\) is the catch (landings) for fleet \(f\) at age \(a\) in year \(y\)
  • \(F_{f,y}\) is fleet-specific fishing mortality in year \(y\)
  • \(S_f(a)\) is selectivity at age \(a\) for fleet \(f\)
  • \(Z_{a,y}\) is total mortality at age \(a\) and year \(y\)
  • \(N_{a,y}\) is the number of individuals at age \(a\) and year \(y\)

Parameters
populationShared pointer to the population object.
Parameters
i_age_yearDimension folded index for age and year.
Parameters
yearYear index.
Parameters
ageAge index.

◆ CalculateLandingsWeightAA()

template<typename Type >
void fims_popdy::CatchAtAge< Type >::CalculateLandingsWeightAA ( std::shared_ptr< fims_popdy::Population< Type > > &  population,
size_t  year,
size_t  age 
)
inline

Calculates weight at age of the landings for a given fleet from a population.

This function computes the expected landings at age in weight by multiplying the expected landings numbers at age by the corresponding weight at age:

\[ CW_{f,a,y} = C_{f,a,y} \times w_a \]

where \(CW_{f,a,y}\) is the catch weight for fleet \(f\) at age \(a\) in year \(y\).

Parameters
populationShared pointer to the population object.
Parameters
yearYear index.
Parameters
ageAge index.

◆ CalculateMaturityAA()

template<typename Type >
void fims_popdy::CatchAtAge< Type >::CalculateMaturityAA ( std::shared_ptr< fims_popdy::Population< Type > > &  population,
size_t  i_age_year,
size_t  age 
)
inline

Calculates maturity at age, in proportion, for a population.

This function evaluates the maturity ogive at the specified age to estimate the proportion of individuals that are mature:

\[ p_{mature,a} = \text{maturity}(a) \]

Parameters
populationShared pointer to the population object.
Parameters
i_age_yearDimension folded index for age and year.
Parameters
ageAge index.

◆ CalculateMortality()

template<typename Type >
void fims_popdy::CatchAtAge< Type >::CalculateMortality ( std::shared_ptr< fims_popdy::Population< Type > > &  population,
size_t  i_age_year,
size_t  year,
size_t  age 
)
inline

Calculates total mortality for a population.

This function calculates total mortality \(Z\) for a specific age and year, combining natural mortality \(M\) and fishing mortality \(F\) from all fleets.

The fishing mortality \(F_{f,a,y}\) for each fleet \(f\) is computed using age-specific selectivity \(S_f(a)\), fleet-specific annual fishing mortality \(F_{f,y}\), and year-specific F multiplier \(f_y\):

\[ F_{f,a,y} = F_{f,y} \times f_y \times S_f(a) \]

Total fishing mortality at age \(a\) and year \(y\) is the sum over fleets:

\[ F_{a,y} = \sum_{f=1}^{N_{fleets}} F_{f,a,y} \]

Total mortality \(Z_{a,y}\) is the sum of natural and fishing mortality:

\[ Z_{a,y} = M_{a,y} + F_{a,y} \]

Parameters
populationShared pointer to the population object.
Parameters
i_age_yearDimension folded index for age and year.
Parameters
yearYear index.
Parameters
ageAge index.

◆ CalculateNumbersAA()

template<typename Type >
void fims_popdy::CatchAtAge< Type >::CalculateNumbersAA ( std::shared_ptr< fims_popdy::Population< Type > > &  population,
size_t  i_age_year,
size_t  i_agem1_yearm1,
size_t  age 
)
inline

Calculates numbers at age for a population.

This function calculates numbers at age by applying total mortality \(Z\) to individuals from the previous time step. It also handles the accumulation of a plus group.

Standard update:

\[ N_{a,y} = N_{a-1,y-1} \exp(-Z_{a-1,y-1}) \]

Plus group update (if \(a = A\)):

\[ N_{A,y} = N_{A-1,y-1} \exp(-Z_{A-1,y-1}) + N_{A,y-1} \exp(-Z_{A,y-1}) \]

Parameters
populationShared pointer to the population object.
Parameters
i_age_yearDimension folded index for age and year.
Parameters
i_agem1_yearm1Dimension folded index for age-1 and year-1.
Parameters
ageAge index.

◆ CalculateRecruitment()

template<typename Type >
void fims_popdy::CatchAtAge< Type >::CalculateRecruitment ( std::shared_ptr< fims_popdy::Population< Type > > &  population,
size_t  i_age_year,
size_t  year,
size_t  i_dev 
)
inline

Calculates expected recruitment for a population.

Calculates expected recruitment as a function of spawning biomass and equilibrium spawning biomass per recruit \(\phi_0\).

The expected recruitment \(R_y\) in year \(y\) is given by:

\[ R_y = \begin{cases} f(SB_{y-1}, \phi_0), & \text{if } i_{dev} = n_{years} \\ \exp(g(y-1)), & \text{otherwise} \end{cases} \]

Where \(f()\) evaluates mean recruitment based on spawning biomass and \(\phi_0\), and \(g(y-1)\) evaluates recruitment deviations.

Parameters
populationShared pointer to the population object.
Parameters
i_age_yearDimension folded index for age and year.
Parameters
yearYear index.
Parameters
i_devIndex to log_recruit_dev of vector length n_years-1.

◆ CalculateSBPR0()

template<typename Type >
Type fims_popdy::CatchAtAge< Type >::CalculateSBPR0 ( std::shared_ptr< fims_popdy::Population< Type > > &  population)
inline

Calculates equilibrium spawning biomass per recruit.

This function calculates the spawning biomass per recruit \(\phi_0\) at equilibrium, assuming an unfished stock. The biomass is calculated as the sum of the biomass contributions from each age \(a\):

\[ \phi_0 = \sum_{a=0}^{A} N_a \times p_{female,a} \times p_{mature,a} \times w_a \]

The numbers at age \(N_a\) are calculated recursively with natural mortality:

\[ N_a = N_{a-1} \times \exp(-M_a) \quad \text{for } a = 1, \ldots, A-1 \]

Plus group update:

\[ N_A = \frac{N_{A-1} \times \exp(-M_{A-1})}{1 - \exp(-M_A)} \]

Parameters
populationShared pointer to the population object.

Returns
Type

◆ CalculateSpawningBiomass()

template<typename Type >
void fims_popdy::CatchAtAge< Type >::CalculateSpawningBiomass ( std::shared_ptr< fims_popdy::Population< Type > > &  population,
size_t  i_age_year,
size_t  year,
size_t  age 
)
inline

Calculates spawning biomass for a population.

This function computes yearly \(y\) spawning biomass \(SB_y\) by summing the contributions from each age \(a\), accounting for proportion female, proportion mature, and weight at age \(w_a\):

\[ SB_y \mathrel{+}= N_{a,y} \times w_a \times p_{female,a} \times p_{mature,a} \]

Parameters
populationShared pointer to the population object.
Parameters
i_age_yearDimension folded index for age and year.
Parameters
yearYear index.
Parameters
ageAge index.

◆ CalculateSpawningBiomassRatio()

template<typename Type >
void fims_popdy::CatchAtAge< Type >::CalculateSpawningBiomassRatio ( std::shared_ptr< fims_popdy::Population< Type > > &  population,
size_t  year 
)
inline

Calculate the spawning biomass ratio for a population and year.

This method computes the ratio of spawning biomass in a given year to the spawning biomass at year zero (typically unfished), for the specified population:

\[ \text{ratio}_y = \frac{SB_y}{SB^U_0} \]

The result is stored in the population's spawning_biomass_ratio vector.

Parameters
populationShared pointer to the population object.
Parameters
yearYear index.

◆ CalculateUnfishedBiomass()

template<typename Type >
void fims_popdy::CatchAtAge< Type >::CalculateUnfishedBiomass ( std::shared_ptr< fims_popdy::Population< Type > > &  population,
size_t  i_age_year,
size_t  year,
size_t  age 
)
inline

Calculates the unfished biomass for a population.

Updates unfished biomass \(B^U_y\) by adding the biomass of age \(a\) in year \(y\):

\[ B^U_y \mathrel{+}= N^U_{a,y} \times w_a \]

Parameters
populationShared pointer to the population object.
Parameters
i_age_yearDimension folded index for age and year.
Parameters
yearYear index.
Parameters
ageAge index.

◆ CalculateUnfishedNumbersAA()

template<typename Type >
void fims_popdy::CatchAtAge< Type >::CalculateUnfishedNumbersAA ( std::shared_ptr< fims_popdy::Population< Type > > &  population,
size_t  i_age_year,
size_t  i_agem1_yearm1,
size_t  age 
)
inline

Calculates unfished numbers at age at year and age specific indices.

This function computes unfished numbers at age by applying survival through time using only natural mortality, without any fishing pressure. It also accounts for accumulation of the plus group.

Standard update:

\[ N^U_{a,y} = N^U_{a-1,y-1} \exp(-M_{a-1,y-1}) \]

Plus group update (if \(a = A\)):

\[ N^U_{A,y} = N^U_{A-1,y-1} \exp(-M_{A-1,y-1}) + N^U_{A,y-1} \exp(-M_{A,y-1}) \]

Parameters
populationShared pointer to the population object.
Parameters
i_age_yearDimension folded index for age and year.
Parameters
i_agem1_yearm1Dimension folded index for age-1 and year-1.
Parameters
ageAge index.

◆ CalculateUnfishedSpawningBiomass()

template<typename Type >
void fims_popdy::CatchAtAge< Type >::CalculateUnfishedSpawningBiomass ( std::shared_ptr< fims_popdy::Population< Type > > &  population,
size_t  i_age_year,
size_t  year,
size_t  age 
)
inline

Calculated unfished spawning biomass for a population.

Updates unfished spawning biomass \(SB^U_y\) by adding the biomass of age \(a\) in year \(y\):

\[ SB^U_y \mathrel{+}= N^U_{a,y} \times w_a \times p_{female,a} \times p_{mature,a} \]

Parameters
populationShared pointer to the population object.
Parameters
i_age_yearDimension folded index for age and year.
Parameters
yearYear index.
Parameters
ageAge index.

◆ Evaluate()

template<typename Type >
virtual void fims_popdy::CatchAtAge< Type >::Evaluate ( )
inlinevirtual

Evaluate the model.

Reimplemented from fims_popdy::FisheryModelBase< Type >.

◆ evaluate_age_comp()

template<typename Type >
void fims_popdy::CatchAtAge< Type >::evaluate_age_comp ( )
inline

Evaluate the proportion of landings numbers at age.

◆ evaluate_index()

template<typename Type >
void fims_popdy::CatchAtAge< Type >::evaluate_index ( )
inline

Evaluate the natural log of the expected index.

◆ evaluate_landings()

template<typename Type >
void fims_popdy::CatchAtAge< Type >::evaluate_landings ( )
inline

Evaluate the natural log of the expected landings.

◆ evaluate_length_comp()

template<typename Type >
void fims_popdy::CatchAtAge< Type >::evaluate_length_comp ( )
inline

Evaluate the proportion of landings numbers at length.

◆ GetPopulations()

template<typename Type >
std::vector< std::shared_ptr< fims_popdy::Population< Type > > > & fims_popdy::CatchAtAge< Type >::GetPopulations ( )
inline

This function is used to get the populations of the model. It returns a vector of shared pointers to the populations.

Returns
std::vector<std::shared_ptr<fims_popdy::Population<Type>>>&

◆ Initialize()

template<typename Type >
virtual void fims_popdy::CatchAtAge< Type >::Initialize ( )
inlinevirtual

This function is called once at the beginning of the model run. It initializes the derived quantities for the populations and fleets.

Reimplemented from fims_popdy::FisheryModelBase< Type >.

◆ Prepare()

template<typename Type >
virtual void fims_popdy::CatchAtAge< Type >::Prepare ( )
inlinevirtual

This function is used to reset the derived quantities of a population or fleet to a given value.

Reimplemented from fims_popdy::FisheryModelBase< Type >.

◆ Report()

template<typename Type >
virtual void fims_popdy::CatchAtAge< Type >::Report ( )
inlinevirtual
  • This method is used to generate TMB reports from the population dynamics model.

Reimplemented from fims_popdy::FisheryModelBase< Type >.

Member Data Documentation

◆ ages

template<typename Type >
std::vector<Type> fims_popdy::CatchAtAge< Type >::ages

vector of the ages for referencing


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