FIMS  v0.11.0
Loading...
Searching...
No Matches
PopulationInterface Class Reference

Rcpp interface for a new Population to instantiate from R: population <- methods::new(population). More...

#include <rcpp_population.hpp>

Inheritance diagram for PopulationInterface:
PopulationInterfaceBase FIMSRcppInterfaceBase

Public Types

typedef std::set< uint32_t >::iterator fleet_ids_iterator

Public Member Functions

 PopulationInterface ()
 The constructor.
 PopulationInterface (const PopulationInterface &other)
 Construct a new Population Interface object.
virtual ~PopulationInterface ()
 The destructor.
virtual uint32_t get_id ()
 Gets the ID of the interface base object.
void SetName (const std::string &name)
 Sets the name of the population.
std::string GetName () const
 Gets the name of the population.
void SetMaturityID (uint32_t maturity_id)
 Sets the unique ID for the Maturity object.
void SetGrowthID (uint32_t growth_id)
 Set the unique ID for the growth object.
void SetRecruitmentID (uint32_t recruitment_id)
 Set the unique ID for the recruitment object.
void AddFleet (uint32_t fleet_id)
 Add a fleet id to the list of fleets operating on this population.
virtual void finalize ()
 Extracts derived quantities back to the Rcpp interface object from the Information object.
Public Member Functions inherited from PopulationInterfaceBase
 PopulationInterfaceBase ()
 The constructor.
 PopulationInterfaceBase (const PopulationInterfaceBase &other)
 Construct a new Population Interface Base object.
virtual ~PopulationInterfaceBase ()
 The destructor.
Public Member Functions inherited from FIMSRcppInterfaceBase
virtual bool add_to_fims_tmb ()
 A virtual method to inherit to add objects to the TMB model.
virtual std::string to_json ()
 Convert the data to json representation for the output.
std::string value_to_string (double value)
 Report the variable value as a string.
std::string make_dimensions (uint32_t start, uint32_t end, uint32_t rep=1)
 Make a string of dimensions for the model.

Public Attributes

SharedInt n_ages = 0
 The number of age bins.
SharedInt n_fleets
 The number of fleets.
std::shared_ptr< std::set< uint32_t > > fleet_ids
SharedInt n_years
 The number of years.
SharedInt n_lengths
 The number of length bins.
SharedInt maturity_id
 The ID of the maturity module.
SharedInt growth_id
 The ID of the growth module.
SharedInt recruitment_id
 The ID of the recruitment module.
SharedInt recruitment_err_id
 The ID of the recruitment process module.
VariableVector log_M
 The natural log of the natural mortality for each year.
VariableVector spawning_biomass_ratio
 The population spawning biomass ratio for each year.
VariableVector log_f_multiplier
 Log of the population annual fishing mortality multiplier.
VariableVector log_init_naa
 The natural log of the initial numbers at age.
VariableVector proportion_female
 Proportion of females in the population.
RealVector ages
 Ages that are modeled in the population, the length of this vector should equal "n_ages".
SharedString name = fims::to_string("NA")
 The name for the population.
VariableVector total_catch_weight
 Total annual catch removed from a population by all fleets in weight.
VariableVector total_catch_numbers
 Total annual catch removed from a population by all fleets in numbers.
VariableVector mortality_F
 Total annual fishing mortality a population is subject to.
VariableVector mortality_M
 Total annual natural mortality a population is subject to.
VariableVector mortality_Z
 Total annual mortality a population is subject to.
VariableVector numbers_at_age
 Current population composition in numbers at age.
VariableVector unfished_numbers_at_age
 Theoretical population composition in numbers at age if no fishing had occurred.
VariableVector biomass
 Total weight of all fish in the population.
VariableVector spawning_biomass
 Total weight of mature fish in the population.
VariableVector unfished_biomass
 Total theoretical weight of all fish in the population if no fishing had occurred.
VariableVector unfished_spawning_biomass
 Total theoretical weight of mature fish in the population if no fishing had occurred.
VariableVector proportion_mature_at_age
 Fraction of all fish at a given age that are sexually mature at each age.
VariableVector expected_recruitment
 Model-expected recruitment each year based on the stock–recruit relationship.
VariableVector sum_selectivity
 Sum of selectivity at age across all fleets for a population.
Public Attributes inherited from PopulationInterfaceBase
uint32_t id
 The local id of the PopulationInterfaceBase object.
SharedBoolean initialize_catch_at_age
 Initialize the catch at age model.
SharedBoolean initialize_surplus_production
 Initialize the surplus production model.
Public Attributes inherited from FIMSRcppInterfaceBase
bool finalized = false
 Is the object already finalized? The default is false.

Additional Inherited Members

Static Public Attributes inherited from PopulationInterfaceBase
static std::map< uint32_t, std::shared_ptr< PopulationInterfaceBase > > live_objects
 The map associating the IDs of PopulationInterfaceBase to the objects. This is a live object, which is an object that has been created and lives in memory.
Static Public Attributes inherited from FIMSRcppInterfaceBase
static std::vector< std::shared_ptr< FIMSRcppInterfaceBase > > fims_interface_objects
 FIMS interface object vectors.

Detailed Description

Rcpp interface for a new Population to instantiate from R: population <- methods::new(population).

Member Typedef Documentation

◆ fleet_ids_iterator

typedef std::set<uint32_t>::iterator PopulationInterface::fleet_ids_iterator

Iterator for fleet ids.

Constructor & Destructor Documentation

◆ PopulationInterface()

PopulationInterface::PopulationInterface ( const PopulationInterface & other)
inline

Construct a new Population Interface object.

Parameters
other

Member Function Documentation

◆ finalize()

virtual void PopulationInterface::finalize ( )
inlinevirtual

Extracts derived quantities back to the Rcpp interface object from the Information object.

Reimplemented from FIMSRcppInterfaceBase.

◆ get_id()

virtual uint32_t PopulationInterface::get_id ( )
inlinevirtual

Gets the ID of the interface base object.

Returns
The ID.

Implements PopulationInterfaceBase.

◆ GetName()

std::string PopulationInterface::GetName ( ) const
inline

Gets the name of the population.

Returns
The name.

◆ SetGrowthID()

void PopulationInterface::SetGrowthID ( uint32_t growth_id)
inline

Set the unique ID for the growth object.

Parameters
growth_idUnique ID for the growth object.

◆ SetMaturityID()

void PopulationInterface::SetMaturityID ( uint32_t maturity_id)
inline

Sets the unique ID for the Maturity object.

Parameters
maturity_idUnique ID for the Maturity object.

◆ SetName()

void PopulationInterface::SetName ( const std::string & name)
inline

Sets the name of the population.

Parameters
nameThe name to set.

◆ SetRecruitmentID()

void PopulationInterface::SetRecruitmentID ( uint32_t recruitment_id)
inline

Set the unique ID for the recruitment object.

Parameters
recruitment_idUnique ID for the recruitment object.

Member Data Documentation

◆ fleet_ids

std::shared_ptr<std::set<uint32_t> > PopulationInterface::fleet_ids

list of fleets that operate on this population.

◆ proportion_female

VariableVector PopulationInterface::proportion_female

Proportion of females in the population.

Used to calculate spawning biomass and other sex-specific derived quantities. Supplied from R as a single constant (length 1) and applied to all ages during model evaluation. Values should be in [0, 1]. Out-of-range inputs are logged as warnings.


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