FIMS  v0.10.0
Loading...
Searching...
No Matches
fims_popdy::VonBertalanffySchnuteGrowthModelAdapter< Type > Class Template Reference

von Bertalanffy–Schnute growth model adapter implementing the generic growth-derived observation capability for catch-at-age. More...

#include <growth_model_adapter.hpp>

Inheritance diagram for fims_popdy::VonBertalanffySchnuteGrowthModelAdapter< Type >:
fims_popdy::GrowthDerivedObservationBase< Type > fims_popdy::GrowthBase< Type > fims_model_object::FIMSObject< Type > fims_model_object::FIMSMemoryTracker

Public Types

enum class  LengthReferenceParameterization { kEstimatedReferenceLengths = 0 , kConstantLengthYoungEstimatedLengthOld , kEstimatedLengthYoungBelowConstantLengthOld , kBothConstant }
 Options for how the two reference lengths are supplied.
 

Public Member Functions

void UseEstimatedReferenceMeanLengths ()
 Estimate both reference mean lengths.
 
void UseConstantMeanLengthYoungWithEstimatedMeanLengthOld (Type constant_mean_length_young)
 Fix young reference length and estimate older reference mean length.
 
void UseEstimatedMeanLengthYoungBelowConstantMeanLengthOld (Type constant_mean_length_old)
 Estimate young reference length below a fixed old reference length.
 
void UseConstantReferenceMeanLengths (Type constant_mean_length_young, Type constant_mean_length_old)
 Fix both young and old reference mean lengths.
 
fims::Vector< Type > & MeanLengthYoungVector ()
 Access the working-scale storage for the first reference-length parameter.
 
fims::Vector< Type > & MeanLengthOldVector ()
 Access the log-scale length-at-reference-age-2 parameter vector.
 
fims::Vector< Type > & GrowthCoefficientVector ()
 Access the log-scale VonBertalanffySchnute growth coefficient vector.
 
fims::Vector< Type > & ReferenceAgeForLengthYoungVector ()
 Access the first reference-age vector.
 
fims::Vector< Type > & ReferenceAgeForLengthOldVector ()
 Access the second reference-age vector.
 
fims::Vector< Type > & LengthWeightAVector ()
 Access the log-scale length-weight-a vector.
 
fims::Vector< Type > & LengthWeightBVector ()
 Access the log-scale length-weight-b vector.
 
fims::Vector< Type > & LengthAtAgeSdAtRefAgesVector ()
 Access the log-scale length-at-age SD vector at the two reference ages.
 
fims::Vector< Type > & LogSdLengthAtRefAgeYoungVector ()
 Access the log-SD vector for mean_length_young.
 
fims::Vector< Type > & LogSdLengthAtRefAgeOldVector ()
 Access the log-SD vector for mean_length_old.
 
fims::Vector< Type > & LogSdGrowthCoefficientVector ()
 Access the log-SD vector for growth_coefficient.
 
fims::Vector< Type > & LogitCorrLengthAtRefAgeYoungLengthAtRefAgeOldVector ()
 Access the transformed correlation vector for mean_length_young and mean_length_old.
 
fims::Vector< Type > & LogitCorrLengthAtRefAgeYoungKVector ()
 Access the transformed correlation vector for mean_length_young and growth_coefficient.
 
fims::Vector< Type > & LogitCorrLengthAtRefAgeOldKVector ()
 Access the transformed correlation vector for mean_length_old and growth_coefficient.
 
void SetAgeOffset (double min_age) override
 Set the minimum modeled age used by cached growth products.
 
void Initialize (std::size_t n_years, std::size_t n_ages, std::size_t n_sexes=1) override
 Initialize the backing growth model and cache dimensions.
 
bool SupportsAgeToLengthConversionDerived () const override
 Report that the adapter supports growth-derived age-to-length conversion calculations.
 
virtual const Type evaluate (int year, const double &a) override
 Calculates the growth at the independent variable value.
 
void PrepareGrowthProducts () override
 Prepare growth products for the current model state.
 
const GrowthProducts< Type > * TryGetPreparedGrowthProducts () const override
 Return prepared growth products without triggering preparation.
 
Type EvaluateWeightAtLength (const Type &length) const override
 Evaluate the length-weight relationship at a supplied length.
 
- Public Member Functions inherited from fims_popdy::GrowthBase< Type >
 GrowthBase ()
 Constructor.
 
- 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.
 

Additional Inherited Members

- 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
 
- Static Public Attributes inherited from fims_popdy::GrowthBase< Type >
static uint32_t id_g = 0
 
- Static Public Attributes inherited from fims_model_object::FIMSMemoryTracker
static int total_active_objects = 0
 Total number of active FIMSObject instances currently in memory.
 

Detailed Description

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

von Bertalanffy–Schnute growth model adapter implementing the generic growth-derived observation capability for catch-at-age.

Member Function Documentation

◆ evaluate()

template<typename Type >
virtual const Type fims_popdy::VonBertalanffySchnuteGrowthModelAdapter< Type >::evaluate ( int  year,
const double a 
)
inlineoverridevirtual

Calculates the growth at the independent variable value.

Parameters
yearThe year at which to return weight of the fish (in kg).
aThe age at which to return weight of the fish (in kg).

Implements fims_popdy::GrowthBase< Type >.

◆ EvaluateWeightAtLength()

template<typename Type >
Type fims_popdy::VonBertalanffySchnuteGrowthModelAdapter< Type >::EvaluateWeightAtLength ( const Type length) const
inlineoverridevirtual

Evaluate the length-weight relationship at a supplied length.

This is used by fleet-level derived quantities that need a bin-based expectation over the same length bins used in the dynamic age-to-length conversion path.

Parameters
lengthLength on the natural scale.
Returns
Weight on the natural scale.

Implements fims_popdy::GrowthDerivedObservationBase< Type >.

◆ GrowthCoefficientVector()

template<typename Type >
fims::Vector< Type > & fims_popdy::VonBertalanffySchnuteGrowthModelAdapter< Type >::GrowthCoefficientVector ( )
inline

Access the log-scale VonBertalanffySchnute growth coefficient vector.

Returns
Mutable parameter vector.

◆ Initialize()

template<typename Type >
void fims_popdy::VonBertalanffySchnuteGrowthModelAdapter< Type >::Initialize ( std::size_t  n_years,
std::size_t  n_ages,
std::size_t  n_sexes = 1 
)
inlineoverridevirtual

Initialize the backing growth model and cache dimensions.

Parameters
n_yearsNumber of modeled years.
n_agesNumber of modeled ages.
n_sexesNumber of modeled sexes.

Implements fims_popdy::GrowthDerivedObservationBase< Type >.

◆ LengthAtAgeSdAtRefAgesVector()

template<typename Type >
fims::Vector< Type > & fims_popdy::VonBertalanffySchnuteGrowthModelAdapter< Type >::LengthAtAgeSdAtRefAgesVector ( )
inline

Access the log-scale length-at-age SD vector at the two reference ages.

Returns
Mutable parameter vector.

◆ LengthWeightAVector()

template<typename Type >
fims::Vector< Type > & fims_popdy::VonBertalanffySchnuteGrowthModelAdapter< Type >::LengthWeightAVector ( )
inline

Access the log-scale length-weight-a vector.

Returns
Mutable parameter vector.

◆ LengthWeightBVector()

template<typename Type >
fims::Vector< Type > & fims_popdy::VonBertalanffySchnuteGrowthModelAdapter< Type >::LengthWeightBVector ( )
inline

Access the log-scale length-weight-b vector.

Returns
Mutable parameter vector.

◆ LogitCorrLengthAtRefAgeOldKVector()

template<typename Type >
fims::Vector< Type > & fims_popdy::VonBertalanffySchnuteGrowthModelAdapter< Type >::LogitCorrLengthAtRefAgeOldKVector ( )
inline

Access the transformed correlation vector for mean_length_old and growth_coefficient.

Returns
Mutable parameter vector.

◆ LogitCorrLengthAtRefAgeYoungKVector()

template<typename Type >
fims::Vector< Type > & fims_popdy::VonBertalanffySchnuteGrowthModelAdapter< Type >::LogitCorrLengthAtRefAgeYoungKVector ( )
inline

Access the transformed correlation vector for mean_length_young and growth_coefficient.

Returns
Mutable parameter vector.

◆ LogitCorrLengthAtRefAgeYoungLengthAtRefAgeOldVector()

template<typename Type >
fims::Vector< Type > & fims_popdy::VonBertalanffySchnuteGrowthModelAdapter< Type >::LogitCorrLengthAtRefAgeYoungLengthAtRefAgeOldVector ( )
inline

Access the transformed correlation vector for mean_length_young and mean_length_old.

Returns
Mutable parameter vector.

◆ LogSdGrowthCoefficientVector()

template<typename Type >
fims::Vector< Type > & fims_popdy::VonBertalanffySchnuteGrowthModelAdapter< Type >::LogSdGrowthCoefficientVector ( )
inline

Access the log-SD vector for growth_coefficient.

Returns
Mutable parameter vector.

◆ LogSdLengthAtRefAgeOldVector()

template<typename Type >
fims::Vector< Type > & fims_popdy::VonBertalanffySchnuteGrowthModelAdapter< Type >::LogSdLengthAtRefAgeOldVector ( )
inline

Access the log-SD vector for mean_length_old.

Returns
Mutable parameter vector.

◆ LogSdLengthAtRefAgeYoungVector()

template<typename Type >
fims::Vector< Type > & fims_popdy::VonBertalanffySchnuteGrowthModelAdapter< Type >::LogSdLengthAtRefAgeYoungVector ( )
inline

Access the log-SD vector for mean_length_young.

Returns
Mutable parameter vector.

◆ MeanLengthOldVector()

template<typename Type >
fims::Vector< Type > & fims_popdy::VonBertalanffySchnuteGrowthModelAdapter< Type >::MeanLengthOldVector ( )
inline

Access the log-scale length-at-reference-age-2 parameter vector.

Returns
Mutable parameter vector.

◆ MeanLengthYoungVector()

template<typename Type >
fims::Vector< Type > & fims_popdy::VonBertalanffySchnuteGrowthModelAdapter< Type >::MeanLengthYoungVector ( )
inline

Access the working-scale storage for the first reference-length parameter.

Returns
Mutable parameter vector.

◆ PrepareGrowthProducts()

template<typename Type >
void fims_popdy::VonBertalanffySchnuteGrowthModelAdapter< Type >::PrepareGrowthProducts ( )
inlineoverridevirtual

Prepare growth products for the current model state.

Implements fims_popdy::GrowthDerivedObservationBase< Type >.

◆ ReferenceAgeForLengthOldVector()

template<typename Type >
fims::Vector< Type > & fims_popdy::VonBertalanffySchnuteGrowthModelAdapter< Type >::ReferenceAgeForLengthOldVector ( )
inline

Access the second reference-age vector.

Returns
Mutable parameter vector.

◆ ReferenceAgeForLengthYoungVector()

template<typename Type >
fims::Vector< Type > & fims_popdy::VonBertalanffySchnuteGrowthModelAdapter< Type >::ReferenceAgeForLengthYoungVector ( )
inline

Access the first reference-age vector.

Returns
Mutable parameter vector.

◆ SetAgeOffset()

template<typename Type >
void fims_popdy::VonBertalanffySchnuteGrowthModelAdapter< Type >::SetAgeOffset ( double  min_age)
inlineoverridevirtual

Set the minimum modeled age used by cached growth products.

Parameters
min_ageMinimum age on the natural scale.

Implements fims_popdy::GrowthDerivedObservationBase< Type >.

◆ SupportsAgeToLengthConversionDerived()

template<typename Type >
bool fims_popdy::VonBertalanffySchnuteGrowthModelAdapter< Type >::SupportsAgeToLengthConversionDerived ( ) const
inlineoverridevirtual

Report that the adapter supports growth-derived age-to-length conversion calculations.

Returns
Always true for this adapter.

Implements fims_popdy::GrowthDerivedObservationBase< Type >.

◆ TryGetPreparedGrowthProducts()

template<typename Type >
const GrowthProducts< Type > * fims_popdy::VonBertalanffySchnuteGrowthModelAdapter< Type >::TryGetPreparedGrowthProducts ( ) const
inlineoverridevirtual

Return prepared growth products without triggering preparation.

Returns
Pointer to prepared growth products, or nullptr if unavailable.

Implements fims_popdy::GrowthDerivedObservationBase< Type >.

◆ UseConstantMeanLengthYoungWithEstimatedMeanLengthOld()

template<typename Type >
void fims_popdy::VonBertalanffySchnuteGrowthModelAdapter< Type >::UseConstantMeanLengthYoungWithEstimatedMeanLengthOld ( Type  constant_mean_length_young)
inline

Fix young reference length and estimate older reference mean length.

Parameters
constant_mean_length_youngFixed mean length at the younger reference age.

◆ UseConstantReferenceMeanLengths()

template<typename Type >
void fims_popdy::VonBertalanffySchnuteGrowthModelAdapter< Type >::UseConstantReferenceMeanLengths ( Type  constant_mean_length_young,
Type  constant_mean_length_old 
)
inline

Fix both young and old reference mean lengths.

Parameters
constant_mean_length_youngFixed mean length at the younger reference age.
constant_mean_length_oldFixed mean length at the older reference age.

◆ UseEstimatedMeanLengthYoungBelowConstantMeanLengthOld()

template<typename Type >
void fims_popdy::VonBertalanffySchnuteGrowthModelAdapter< Type >::UseEstimatedMeanLengthYoungBelowConstantMeanLengthOld ( Type  constant_mean_length_old)
inline

Estimate young reference length below a fixed old reference length.

Parameters
constant_mean_length_oldFixed mean length at the older reference age.

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