FIMS  v0.8.0
Loading...
Searching...
No Matches
CatchAtAgeInterface Class Reference

The CatchAtAgeInterface class is used to interface with the CatchAtAge model. It inherits from the FisheryModelInterfaceBase class. More...

#include <rcpp_models.hpp>

Inheritance diagram for CatchAtAgeInterface:
FisheryModelInterfaceBase FIMSRcppInterfaceBase

Public Member Functions

 CatchAtAgeInterface ()
 The constructor.
 
 CatchAtAgeInterface (const CatchAtAgeInterface &other)
 Construct a new Catch At Age Interface object.
 
void AddPopulation (uint32_t id)
 
void DoReporting (bool report)
 Enable or disable reporting for the CatchAtAge model.
 
bool IsReporting ()
 Check if reporting is enabled for the CatchAtAge model.
 
virtual uint32_t get_id ()
 Method to get this id.
 
virtual void finalize ()
 Extracts derived quantities back to the Rcpp interface object from the Information object.
 
std::string population_to_json (PopulationInterface *population_interface)
 Method to convert a population to a JSON string.
 
std::string derived_quantity_to_json (std::map< std::string, fims::Vector< double > >::iterator it, const fims_popdy::DimensionInfo &dim_info)
 
std::string derived_quantities_component_to_json (std::map< std::string, fims::Vector< double > > &dqs, std::map< std::string, fims_popdy::DimensionInfo > &dim_info)
 Send the fleet-based derived quantities to the json file.
 
std::string fleet_to_json (FleetInterface *fleet_interface)
 Method to convert a fleet to a JSON string.
 
Rcpp::NumericVector get_fixed_parameters_vector ()
 Get the vector of fixed effect parameters for the CatchAtAge model.
 
Rcpp::NumericVector get_random_parameters_vector ()
 Get the vector of random effect parameters for the CatchAtAge model.
 
Rcpp::List get_report (bool do_sd_report=true)
 Get the report output for the CatchAtAge model.
 
virtual std::string to_json (bool do_sd_report=true)
 Serialize the fishery model to a JSON string.
 
double sum (const std::valarray< double > &v)
 Sum method to calculate the sum of an array or vector of doubles.
 
double sum (const std::vector< double > &v)
 Sum method for a vector of doubles.
 
double min (const std::valarray< double > &v)
 Minimum method to calculate the minimum of an array or vector of doubles.
 
std::valarray< doublefabs (const std::valarray< double > &v)
 A function to compute the absolute value of a value array of floating-point values. It is a wrapper around std::fabs.
 
- Public Member Functions inherited from FisheryModelInterfaceBase
 FisheryModelInterfaceBase ()
 The constructor.
 
 FisheryModelInterfaceBase (const FisheryModelInterfaceBase &other)
 Construct a new Data Interface Base object.
 
virtual ~FisheryModelInterfaceBase ()
 The destructor.
 
virtual Rcpp::List calculate_reference_points ()
 A function to calculate reference points for the fishery model.
 
- 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.
 
void get_se_values (std::string name, std::map< std::string, std::vector< double > > &se_values, fims::Vector< double > &values)
 Method to extract standard error values from the se_values working map.
 
virtual void set_uncertainty (std::map< std::string, std::vector< double > > &se_values)
 Set uncertainty values for the interface object.
 
std::string value_to_string (double value)
 Report the parameter 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.
 

Additional Inherited Members

- Public Attributes inherited from FisheryModelInterfaceBase
uint32_t id
 The local id of the FleetInterfaceBase object.
 
- Public Attributes inherited from FIMSRcppInterfaceBase
bool finalized = false
 Is the object already finalized? The default is false.
 
- Static Public Attributes inherited from FisheryModelInterfaceBase
static uint32_t id_g = 1
 The static id of the FleetInterfaceBase object.
 
static std::map< uint32_t, std::shared_ptr< FisheryModelInterfaceBase > > live_objects
 The map associating the IDs of FleetInterfaceBase 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

The CatchAtAgeInterface class is used to interface with the CatchAtAge model. It inherits from the FisheryModelInterfaceBase class.

Constructor & Destructor Documentation

◆ CatchAtAgeInterface()

CatchAtAgeInterface::CatchAtAgeInterface ( const CatchAtAgeInterface other)
inline

Construct a new Catch At Age Interface object.

Parameters
other

Member Function Documentation

◆ AddPopulation()

void CatchAtAgeInterface::AddPopulation ( uint32_t  id)
inline

Method to add a population id to the set of population ids.

◆ derived_quantities_component_to_json()

std::string CatchAtAgeInterface::derived_quantities_component_to_json ( std::map< std::string, fims::Vector< double > > &  dqs,
std::map< std::string, fims_popdy::DimensionInfo > &  dim_info 
)
inline

Send the fleet-based derived quantities to the json file.

Returns
std::string

◆ derived_quantity_to_json()

std::string CatchAtAgeInterface::derived_quantity_to_json ( std::map< std::string, fims::Vector< double > >::iterator  it,
const fims_popdy::DimensionInfo dim_info 
)
inline

This function is used to convert the derived quantities of a population or fleet to a JSON string. This function is used to create the JSON output for the CatchAtAge model.

◆ DoReporting()

void CatchAtAgeInterface::DoReporting ( bool  report)
inline

Enable or disable reporting for the CatchAtAge model.

This method is used to control whether reporting is performed for the CatchAtAge model. The implementation may depend on TMB_MODEL.

Parameters
reportBoolean flag to enable (true) or disable (false) reporting.

◆ fabs()

std::valarray< double > CatchAtAgeInterface::fabs ( const std::valarray< double > &  v)
inline

A function to compute the absolute value of a value array of floating-point values. It is a wrapper around std::fabs.

Parameters
vA value array of floating-point values, where floating-point values is anything with decimals.
Returns
std::valarray<double>

◆ finalize()

virtual void CatchAtAgeInterface::finalize ( )
inlinevirtual

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

Reimplemented from FIMSRcppInterfaceBase.

◆ get_fixed_parameters_vector()

Rcpp::NumericVector CatchAtAgeInterface::get_fixed_parameters_vector ( )
inline

Get the vector of fixed effect parameters for the CatchAtAge model.

Returns a numeric vector containing the fixed effect parameters used in the model.

Returns
Rcpp::NumericVector of fixed effect parameters.

◆ get_id()

virtual uint32_t CatchAtAgeInterface::get_id ( )
inlinevirtual

Method to get this id.

Implements FisheryModelInterfaceBase.

◆ get_random_parameters_vector()

Rcpp::NumericVector CatchAtAgeInterface::get_random_parameters_vector ( )
inline

Get the vector of random effect parameters for the CatchAtAge model.

Returns a numeric vector containing the random effect parameters used in the model.

Returns
Rcpp::NumericVector of random effect parameters.

◆ get_report()

Rcpp::List CatchAtAgeInterface::get_report ( bool  do_sd_report = true)
inline

Get the report output for the CatchAtAge model.

Returns a list containing the report results for the CatchAtAge model, including derived quantities and diagnostics.

Parameters
do_sd_reportA boolean indicating whether to perform sdreport calculations, which should be skipped when MLE optimization is false. Default is true.
Returns
Rcpp::List containing the report output.

◆ IsReporting()

bool CatchAtAgeInterface::IsReporting ( )
inline

Check if reporting is enabled for the CatchAtAge model.

Returns true if reporting is enabled, false otherwise. The implementation may depend on TMB_MODEL.

Returns
Boolean indicating reporting status.

◆ min()

double CatchAtAgeInterface::min ( const std::valarray< double > &  v)
inline

Minimum method to calculate the minimum of an array or vector of doubles.

Parameters
v
Returns
double

◆ sum() [1/2]

double CatchAtAgeInterface::sum ( const std::valarray< double > &  v)
inline

Sum method to calculate the sum of an array or vector of doubles.

Parameters
v
Returns
double

◆ sum() [2/2]

double CatchAtAgeInterface::sum ( const std::vector< double > &  v)
inline

Sum method for a vector of doubles.

Parameters
v
Returns
double

◆ to_json()

virtual std::string CatchAtAgeInterface::to_json ( bool  do_sd_report = true)
inlinevirtual

Serialize the fishery model to a JSON string.

This method provides a standardized interface for converting the state of a fishery model into a JSON-formatted string. The JSON output is intended for use in reporting, diagnostics, or data exchange between C++ and R. Derived classes should override this method to provide model-specific serialization logic.

Parameters
do_sd_reportA boolean to include standard deviation report calculations in the output if true. This is typically set to false when maximum likelihood estimation optimization is not performed, to avoid unnecessary computations. Default is true.
Returns
A JSON string representing the current state of the model. The base implementation returns a placeholder string indicating the method is not yet implemented.

Reimplemented from FisheryModelInterfaceBase.


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