12#ifndef POPULATION_DYNAMICS_AGE_TO_LENGTH_CONVERSION_DERIVED_HPP
13#define POPULATION_DYNAMICS_AGE_TO_LENGTH_CONVERSION_DERIVED_HPP
34template <
typename Type>
37 std::weak_ptr<SizeDistributionProviderBase<Type>>
39 std::shared_ptr<GrowthDerivedObservationBase<Type>>
194 for (std::size_t
i = 0;
i <
row.size(); ++
i) {
199 for (std::size_t
i = 0;
i <
row.size(); ++
i) {
257 throw std::runtime_error(
258 "AgeToLengthConversionDerived produced an invalid mapped fleet "
Declares the AgeToLengthConversionBase class which is the base class for all age-length key functors.
Definition fims_vector.hpp:27
Generic capability interface for growth models that can feed the growth-derived age-to-length convers...
Definition growth_model_adapter.hpp:26
Base interface for objects that provide population-level size distributions.
Definition size_distribution_provider_base.hpp:30
A collection of mathematical functions used in FIMS.
Declare the fleet functor class which is the base class for all fleet functors.
adapts product-style growth models to the GrowthBase interface used by caa.
The population dynamics of FIMS.
Definition catch_at_age.hpp:45
std::shared_ptr< AgeToLengthConversionBase< Type > > BuildAgeToLengthConversionFleet(const std::shared_ptr< Population< Type > > &population, const std::shared_ptr< Fleet< Type > > &fleet)
Build the active age-to-length conversion for a fleet from the current population and fleet state.
Definition runtime.hpp:44
Defines helpers for mapping population biological size bins to fleet observation bins.
Defines the SizeDistributionProviderBase interface for prepared population-level size products.
Base interface for age-length key implementations.
Definition base.hpp:26
Growth-derived age-to-length conversion implementation that reads prepared population age-to-size pro...
Definition derived.hpp:35
virtual bool PrepareForCurrentState() override
Ensures the linked growth products and population size-provider products are prepared for the current...
Definition derived.hpp:101
fims::Vector< Type > BuildPopulationProbSizeRow(std::size_t year_index, std::size_t age_index) const
Read one prepared age-to-size row from the linked population size provider.
Definition derived.hpp:150
std::weak_ptr< SizeDistributionProviderBase< Type > > size_provider_
Definition derived.hpp:38
std::shared_ptr< GrowthDerivedObservationBase< Type > > growth_observation_
Definition derived.hpp:40
virtual bool IsActive() const override
Returns whether this growth-derived age-to-length conversion is structurally active.
Definition derived.hpp:72
virtual bool BuildAgeToLengthConversionRow(size_t year, size_t age, fims::Vector< Type > &out_row) const override
Builds the normalized age-to-length conversion row for a given year and age.
Definition derived.hpp:135
AgeToLengthConversionDerived(const std::shared_ptr< Fleet< Type > > &fleet_, const std::shared_ptr< GrowthDerivedObservationBase< Type > > &growth_observation_, const std::shared_ptr< SizeDistributionProviderBase< Type > > &size_provider_)
Constructor.
Definition derived.hpp:50
virtual ~AgeToLengthConversionDerived()
Destructor.
Definition derived.hpp:63
bool TryFinalizeMappedProbabilityRow(fims::Vector< Type > &row, std::size_t expected_size, const Type &minimum_bin_prob=static_cast< Type >(1e-12)) const
Normalize one mapped fleet probability row.
Definition derived.hpp:186
const GrowthProducts< Type > * TryGetGrowthProducts() const
Try to get prepared growth products from the linked growth object.
Definition derived.hpp:278
std::weak_ptr< Fleet< Type > > fleet_
Definition derived.hpp:36
std::shared_ptr< SizeDistributionProviderBase< Type > > TryGetSizeProvider() const
Try to get the linked population size provider.
Definition derived.hpp:269
fims::Vector< Type > BuildMappedFleetAgeToLengthConversionRow(std::size_t year_index, std::size_t age_index) const
Build one fleet age-to-length conversion row by mapping a population age-to-size row onto fleet obser...
Definition derived.hpp:213
Base class for all fleets.
Definition fleet.hpp:26
Growth "products" in a consistent (year, age, sex) space.
Definition growth_products.hpp:26
static bool HasStrictlyIncreasingEdges(const fims::Vector< double > &edges)
Check that a bin-edge vector is usable for geometric mapping.
Definition size_bin_mapping.hpp:49
static fims::Vector< fims::Vector< double > > BuildRebinWeights(const fims::Vector< double > &source_edges, const fims::Vector< double > &destination_edges)
Build overlap-based rebin weights from source bins to destination bins.
Definition size_bin_mapping.hpp:78
static fims::Vector< Type > ApplyRebinWeights(const fims::Vector< fims::Vector< double > > &weights, const fims::Vector< Type > &source_mass)
Apply a source-to-destination bin mapping to a size-mass vector.
Definition size_bin_mapping.hpp:212
static fims::Vector< double > ExpandDestinationEdgesToCoverSourceRange(const fims::Vector< double > &source_edges, const fims::Vector< double > &destination_edges)
Return explicit mapping edges whose support covers the source range while preserving the canonical de...
Definition size_bin_mapping.hpp:152
Population-level biological size grid.
Definition size_grid.hpp:26