![]() |
FIMS
v0.10.0
|
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>
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. | |
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 | CalculateCatch (std::shared_ptr< fims_popdy::Population< Type > > &population, size_t year, size_t age) |
| Calculates total catch (catch) by fleet and population for a given year by aggregating age-specific catch over ages. | |
| void | CalculateCatchWeightAA (std::shared_ptr< fims_popdy::Population< Type > > &population, size_t year, size_t age) |
| Calculates weight at age of the catch for a given fleet from a population. | |
| void | CalculateCatchNumbersAA (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 catch 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 () |
| Type | MeanWeightFromAgeToLengthConversionRow (const std::shared_ptr< fims_popdy::GrowthDerivedObservationBase< Type > > &growth_observation, const std::shared_ptr< fims_popdy::Fleet< Type > > &fleet, const fims::Vector< Type > &age_to_length_conversion_row) |
| Compute expected fleet-specific weight-at-age from a normalized age-to-length conversion row and fleet observation-bin centers. | |
| void | BuildAgeToLengthConversionDerivedRowOrThrow (const std::shared_ptr< fims_popdy::AgeToLengthConversionDerived< Type > > &age_to_length_conversion_derived, const std::shared_ptr< fims_popdy::Fleet< Type > > &fleet, size_t year, size_t age, fims::Vector< Type > &age_to_length_conversion_row) |
| Build one fleet-specific growth-derived age-to-length conversion row or fail clearly. | |
| Type | MeanWeightFromAgeToLengthConversionDerived (const std::shared_ptr< fims_popdy::AgeToLengthConversionDerived< Type > > &age_to_length_conversion_derived, const std::shared_ptr< fims_popdy::Fleet< Type > > &fleet, size_t year, size_t age) |
| Compute fleet-specific mean weight-at-age from one growth-derived age-to-length conversion row. | |
| void | EnsureAllFleetAgeToLengthConversion () |
| Ensure all fleets linked to this model have a usable age-to-length conversion. | |
| void | PreparePopulationGrowthProducts () |
| Prepares cached population growth products for all populations whose growth objects expose the growth-derived observation interface. | |
| Type | GrowthDerivedFleetMeanWeightAA (const std::shared_ptr< fims_popdy::Fleet< Type > > &fleet, size_t year, size_t age) |
| Compute fleet-specific expected weight-at-age from the growth-derived age-to-length conversion path. | |
| Type | BiologicalMeanWeightFromPreparedGrowthProducts (const std::shared_ptr< fims_popdy::Population< Type > > &population, const std::shared_ptr< fims_popdy::GrowthDerivedObservationBase< Type > > &growth_observation, size_t year, size_t age) |
| Read biological mean weight-at-age directly from prepared growth products. | |
| Type | PopulationMeanWeightAA (const std::shared_ptr< fims_popdy::Population< Type > > &population, size_t year, size_t age) |
| Calculates population-level mean weight-at-age. | |
| void | evaluate_length_comp () |
| void | evaluate_index () |
| void | evaluate_catch () |
| 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. | |
| DerivedQuantitiesMap & | GetFleetDerivedQuantities () |
| Get the fleet derived quantities. | |
| DerivedQuantitiesMap & | GetPopulationDerivedQuantities () |
| 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. | |
| 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. | |
Public Member Functions inherited from fims_model_object::FIMSMemoryTracker | |
| void | register_self (const uint32_t id) |
| Registers a FIMSObject instance with the memory tracker. | |
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. | |
| bool | report_age_to_length_conversion_derived_tensor = false |
| Controls whether reporting materializes the full derived age-to-length tensor for fleets using the growth-derived age-to-length conversion path. | |
| std::vector< Type > | ages |
Public Attributes inherited from fims_popdy::FisheryModelBase< Type > | |
| std::string | model_type_m |
| A string specifying the model type. | |
| std::set< uint32_t > | population_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< DerivedQuantitiesMap > | fleet_derived_quantities |
| Shared pointer for the fleet derived quantities map. | |
| std::shared_ptr< DerivedQuantitiesMap > | population_derived_quantities |
| Shared pointer for the population derived quantities map. | |
| std::shared_ptr< DimensionInfoMap > | fleet_dimension_info |
| Shared pointer for the fleet dimension information map. | |
| std::shared_ptr< DimensionInfoMap > | population_dimension_info |
| Shared pointer for the population dimension 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 |
Additional Inherited Members | |
Static Public Attributes inherited from fims_model_object::FIMSMemoryTracker | |
| static int | total_active_objects = 0 |
| Total number of active FIMSObject instances currently in memory. | |
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.
See the Glossary for definitions of mathematical symbols used below.
|
inline |
Constructor for the CatchAtAge class. This constructor initializes the name of the model and sets the id of the model.
|
inline |
Copy constructor for the CatchAtAge class.
| other | The other CatchAtAge object to copy from. |
This function is used to add a population id to the set of population ids.
|
inline |
Read biological mean weight-at-age directly from prepared growth products.
This helper is for population-level quantities that should use the biological growth path without requiring fleet observation-bin mapping.
| population | Shared pointer to the population object. |
| growth_observation | Shared pointer to the growth-derived observation capability. |
| year | Year index. |
| age | Age index. |
|
inline |
Build one fleet-specific growth-derived age-to-length conversion row or fail clearly.
| age_to_length_conversion_derived | Shared pointer to the growth-derived age-to-length conversion. |
| fleet | Shared pointer to the fleet object. |
| year | Year index. |
| age | Age index. |
| age_to_length_conversion_row | Output normalized age-to-length probabilities. |
|
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 \]
| population | Shared pointer to the population object. |
| i_age_year | Dimension folded index for age and year. |
| year | Year index. |
| age | Age index. |
|
inline |
Calculates total catch (catch) by fleet and population for a given year by aggregating age-specific catch over ages.
This function updates fleet-specific and total expected catch 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} \]
| population | Shared pointer to the population object. |
| year | Year index. |
| age | Age index. |
|
inline |
Calculates numbers of fish for the catch for a given fleet from a population, year and age.
This function uses the Baranov Catch Equation to calculate expected catch 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) \]
| population | Shared pointer to the population object. |
| i_age_year | Dimension folded index for age and year. |
| year | Year index. |
| age | Age index. |
|
inline |
Calculates weight at age of the catch for a given fleet from a population.
This function computes the expected catch at age in weight by multiplying the expected catch numbers at age by the corresponding weight at age:
\[ CW_{f,a,y} = C_{f,a,y} \times w_a \]
Weight at age comes from the historical direct growth evaluation path unless the population growth object exposes the growth-derived observation interface, in which case the biological population mean weight-at-age path is used.
| population | Shared pointer to the population object. |
| year | Year index. |
| age | Age index. |
|
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} \]
| population | Shared pointer to the population object. |
| i_age_year | Dimension folded index for age and year. |
| year | Year index. |
| age | Age index. |
|
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:
\[ IN_{f,a,y} \mathrel{+}= q_{f,y} \times S_f(a) \times N_{a,y} \]
When timing is accounted for within FIMS the equation will include the fraction of the year when the survey was conducted \(t_y\):
\[ IN_{f,a,y} \mathrel{+}= S_{f,y}(a) \times N_{a,y} \times e^{(-t_{y}Z_{a,y})}\]
| population | Shared pointer to the population object. |
| i_age_year | Dimension folded index for age and year. |
| year | Year index. |
| age | Age index. |
|
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} = IN_{f,a,y} \times w_a \]
Weight at age comes from the historical direct growth evaluation path unless the population growth object exposes the growth-derived observation interface, in which case the biological population mean weight-at-age path is used.
| population | Shared pointer to the population object. |
| year | Year index. |
| age | Age index. |
|
inline |
Calculates initial numbers at age for index and age.
The formula used is:
\[ N_{a,0} = \exp(\log N_{a,0}) \]
| population | Shared pointer to the population object. |
| i_age_year | Dimension folded index for age and year. |
| age | Age index. |
|
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) \]
| population | Shared pointer to the population object. |
| i_age_year | Dimension folded index for age and year. |
| age | Age index. |
|
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} \]
| population | Shared pointer to the population object. |
| i_age_year | Dimension folded index for age and year. |
| year | Year index. |
| age | Age index. |
|
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}) \]
| population | Shared pointer to the population object. |
| i_age_year | Dimension folded index for age and year. |
| i_agem1_yearm1 | Dimension folded index for age-1 and year-1. |
| age | Age index. |
|
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.
| population | Shared pointer to the population object. |
| i_age_year | Dimension folded index for age and year. |
| year | Year index. |
| i_dev | Index to log_recruit_dev of vector length n_years-1. |
|
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)} \]
| population | Shared pointer to the population object. |
|
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} \]
| population | Shared pointer to the population object. |
| i_age_year | Dimension folded index for age and year. |
| year | Year index. |
| age | Age index. |
|
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.
| population | Shared pointer to the population object. |
| year | Year index. |
|
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 \]
| population | Shared pointer to the population object. |
| i_age_year | Dimension folded index for age and year. |
| year | Year index. |
| age | Age index. |
|
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}) \]
| population | Shared pointer to the population object. |
| i_age_year | Dimension folded index for age and year. |
| i_agem1_yearm1 | Dimension folded index for age-1 and year-1. |
| age | Age index. |
|
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} \]
| population | Shared pointer to the population object. |
| i_age_year | Dimension folded index for age and year. |
| year | Year index. |
| age | Age index. |
|
inline |
Ensure all fleets linked to this model have a usable age-to-length conversion.
Reuses each fleet's current age-to-length conversion when it matches the current population growth path and can prepare for the current model state. Otherwise rebuilds the fleet age-to-length conversion from the current population and fleet state before evaluation or reporting uses it.
Evaluate the model.
Reimplemented from fims_popdy::FisheryModelBase< Type >.
|
inline |
Evaluate the proportion of catch numbers at age.
|
inline |
Evaluate the natural log of the expected catch.
|
inline |
Evaluate the natural log of the expected index.
|
inline |
Evaluate the proportion of catch numbers at length.
|
inline |
This function is used to get the populations of the model. It returns a vector of shared pointers to the populations.
|
inline |
Compute fleet-specific expected weight-at-age from the growth-derived age-to-length conversion path.
This helper uses the fleet-specific growth-derived path only. It first prefers the per-evaluation fleet WAA cache and then falls back to the shared age-to-length conversion-row calculation helper. If neither growth-derived path is available, the function fails rather than silently switching to a different weight-at-age meaning.
| fleet | Shared pointer to the fleet object. |
| year | Year index. |
| age | Age index. |
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 >.
|
inline |
Compute fleet-specific mean weight-at-age from one growth-derived age-to-length conversion row.
This helper builds the fleet-specific age-to-length conversion row for the requested year and age, then converts that mapped age-to-length row into expected weight using weight-at-length evaluated at the fleet observation-bin centers.
| age_to_length_conversion_derived | Shared pointer to the growth-derived age-to-length conversion. |
| fleet | Shared pointer to the fleet object. |
| year | Year index. |
| age | Age index. |
|
inline |
Compute expected fleet-specific weight-at-age from a normalized age-to-length conversion row and fleet observation-bin centers.
This is the bin-based downstream WAA step used with the growth-derived age-to-length conversion path. Instead of using only growth->evaluate(age), it computes expected weight as the weighted average of weight-at-length over the same fleet observation bins used in the mapped age-to-length conversion row.
| growth_observation | Shared pointer to the linked growth-derived observation capability. |
| fleet | Shared pointer to the fleet object. |
| age_to_length_conversion_row | Normalized age-to-length probabilities for one year and age. |
|
inline |
Calculates population-level mean weight-at-age.
This function returns the biological mean weight at age for a population. If the growth object does not support the growth-derived observation interface, it uses the historical direct growth evaluation path. If the growth object does support that interface, it reads biological mean weight-at-age directly from the prepared growth products and does not require any fleet observation-bin mapping.
| population | Shared pointer to the population object. |
| year | Year index. |
| age | Age index. |
This function is used to reset the derived quantities of a population or fleet to a given value.
Reimplemented from fims_popdy::FisheryModelBase< Type >.
|
inline |
Prepares cached population growth products for all populations whose growth objects expose the growth-derived observation interface.
This helper makes sure growth-derived-capable populations prepare their cached growth products before catch-at-age evaluation so code that uses those prepared values can access them consistently.
Reimplemented from fims_popdy::FisheryModelBase< Type >.
| std::vector<Type> fims_popdy::CatchAtAge< Type >::ages |
vector of the ages for referencing
| bool fims_popdy::CatchAtAge< Type >::report_age_to_length_conversion_derived_tensor = false |
Controls whether reporting materializes the full derived age-to-length tensor for fleets using the growth-derived age-to-length conversion path.
Default is false to avoid large report-side allocations.