Package 'ageproR'

Title: R package interface for AGEPRO (Age Structured Projection Model) data
Description: Object-oriented data structures based on the input file format defined in the Age Structured Projection Model Reference Manual. Includes support modules for AGEPRO input file support, and experimental JSON input file format.
Authors: Eric Fletcher [aut, cre], Jon Brodziak [aut]
Maintainer: Eric Fletcher <[email protected]>
License: GPL (>= 3)
Version: 0.9.1
Built: 2026-06-01 21:01:03 UTC
Source: https://github.com/nmfs-ost/ageproR

Help Index


AGEPRO Input File Model

Description

AGEPRO Input File Model

AGEPRO Input File Model

Details

File Functionality is based on AGEPRO-CoreLib implementation

Super class

ageproR::agepro_model -> agepro_inp_model

Active bindings

nline

nlines

inp_filepath

Filepath of AGEPRO input file

Methods

Public methods

Inherited methods

Method new()

Initializes an instance of the AGEPRO model with AGEPRO input file format functions. A default model can be initialized without setting general_params parameter values. The default values for the default model is:

  • Projection years: From yr_start 0 to yr_end 2

  • Ages: From age_begin 1 to age_end 6

  • 1000 Population Simulations (num_pop_sims)

  • 1 Fleet (num_fleets)

  • 1 Recruit Model (num_rec_models)

  • Discards Present (discards_present): FALSE (or 0)

  • Pseudo-Randomly generated seed

Usage
agepro_inp_model$new(
  yr_start = 0,
  yr_end = 2,
  age_begin = 1,
  age_end = 6,
  num_pop_sims = 1000,
  num_fleets = 1,
  num_rec_models = 1,
  discards_present = 0,
  seed = sample.int(1e+08, 1),
  enable_cat_print = TRUE,
  show_general_params = TRUE,
  ...
)
Arguments
yr_start

First Year of Projection

yr_end

Last Year of Projection

age_begin

Age begin

age_end

Age end

num_pop_sims

Number of population simulations

num_fleets

Number of fleets

num_rec_models

Number of Recruit Modules

discards_present

Are Discards present? FALSE by default

seed

Random Number seed. By Default, generates a pesdorandom number.

enable_cat_print

Logical flag to show target function's cli cat_print messages to be seen on console. In this instance, this is set to TRUE

show_general_params

Logical flag to show AGEPRO model's general parameters on R console. TRUE, by default.

...

further arguments passed to or from other methods


Method read_inp()

Read AGEPRO INP Input Files

Usage
agepro_inp_model$read_inp(inpfile)
Arguments
inpfile

input file name


Method read_inpfile_values()

Read Input file Values

Usage
agepro_inp_model$read_inpfile_values(inp_con)
Arguments
inp_con

Open file connection to AGEPRO Input File.


Method match_keyword()

Match Keyword

Usage
agepro_inp_model$match_keyword(inp_line, inp_con)
Arguments
inp_line

Line read from the AGEPRO Input File

inp_con

Open file connection to AGEPRO Input File.


Method not_implemented()

Throws a Not Implemented exception message. Placeholder function.

Usage
agepro_inp_model$not_implemented(keyword = "")
Arguments
keyword

keyword


Method write_inp()

Writes AGEPRO keyword parameter data as a AGEPRO input file (*.inp)

Usage
agepro_inp_model$write_inp(
  inpfile,
  delimiter = "  ",
  overwrite_as_currentver = TRUE
)
Arguments
inpfile

input file path

delimiter

Character string delimiter separating values of AGEPRO input file line.

overwrite_as_currentver

As default, overwrites version value to to the current version of the AGEPRO input file format.


Method clone()

The objects of this class are cloneable with this method.

Usage
agepro_inp_model$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


AGEPRO model w/ JSON input file bindings

Description

File Functionality on experimental JSON input file

Super class

ageproR::agepro_model -> agepro_json_model

Methods

Public methods

Inherited methods

Method new()

Initializes the instances of the AGEPRO Model

Usage
agepro_json_model$new(...)
Arguments
...

Parameters to initialize the parent agepro_model class


Method get_json()

Return a json formatted object.

Usage
agepro_json_model$get_json()
Details

See jsonlite::toJSON for more details.NA values in a list or a multi-length vector will converted to JSON style NULL value, but wrapped in a JSON array (⁠[null, null]⁠). Using the defaults in jsonlite::fromJSON, the JSON null array can be is converted back to NA. Single NA values will be reconverted to NULL.


Method write_json()

Write JSON file

Usage
agepro_json_model$write_json(file, show_dir = FALSE)
Arguments
file

input file path

show_dir

Option to show directory after JSON file is written.


Method read_json()

Reads AGEPRO json experimental input file format.

Usage
agepro_json_model$read_json(file)
Arguments
file

input file path


Method import_agepro_inp_model()

Imports AGEPRO model data formatted for AGEPRO input files (agepro_inp_model).

Usage
agepro_json_model$import_agepro_inp_model(inp_model)
Arguments
inp_model

AGEPRO model with AGEPRO Input File (*.INP) functions


Method clone()

The objects of this class are cloneable with this method.

Usage
agepro_json_model$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


R6 class representing AGEPRO model

Description

AGEPRO model contains the projection time horizon, age class range, number of fleets, recruitment, and uncertainties

Details

AGEPRO performs stochastic projections on exploited fisheries stock to determine age-structured population over a time period. Brodziak, 2022

Active bindings

ver_inpfile_string

Version string on AGEPRO input files (*.inp) for version compatibility with Jon Brodiak's AGEPRO calculation engine.

ver_json_format

JSON Input File Format version.

ver_rpackage

Returns ageproR r package version.

projection_analyses_type

Type of projection analyses: standard, rebuilding, pstar.

case_id

Title identifying AGEPRO model attributes

general

General Options

bootstrap

Bootstrapping

natmort

Natural Mortality

maturity

Maturity Fraction

fishery


Fishery Selectivity

discard


Discard Fraction

stock_weight

Stock weight on January 1st at age

ssb_weight

Spawning Stock Weight of Age

mean_weight

Midyear mean population weight at age

catch_weight

Landed catch weight at age by fleet

disc_weight

Discard weight of age by fleet

harvest

Harvest intensity (of fishing mortality or landings quota) by fleet

recruit

AGEPRO Recruitment Model information

perc

User-selected percentile summary of the key results in the output file.

bounds

Bounds on simulated fish weights and natural mortality rates

refpoint

Reference points for optional AGEPRO output threshold report.

scale

Scaling factors for biomass, recruitment, and stock size

retroadjust

Retrospective bias Adjustment

pstar

Calculating Total Allowable Catch TACTAC to produce PP*, the probability of overfishing in the target year.

rebuild

calculation of the constant total Fishing Mortality FF calculated across all fleets with the rebuild spawning biomass.

biological

Seasonal spawning timing for fishing mortality (FF) and natural mortality (MM)

options

Options for AGEPRO projection output

supported_inpfile_versions

Supported AGEPRO Input File formats

Methods

Public methods


Method new()

Initializes the instance of the AGEPRO Model

Usage
agepro_model$new(
  yr_start,
  yr_end,
  age_begin,
  age_end,
  num_pop_sims,
  num_fleets,
  num_rec_models,
  discards_present = FALSE,
  seed = sample.int(1e+08, 1),
  show_general_params = TRUE,
  enable_cat_print = TRUE,
  ...
)
Arguments
yr_start

First Year of Projection

yr_end

Last Year of Projection

age_begin

Age begin

age_end

Age end

num_pop_sims

Number of population simulations

num_fleets

Number of fleets

num_rec_models

Number of Recruit Modules

discards_present

Are Discards present? FALSE by default

seed

Random Number seed. By Default, generates a pesdorandom number.

show_general_params

Logical flag to show AGEPRO model's general parameters on R console. TRUE, by default.

enable_cat_print

Logical flag to show target function's cli cat_print messages to be seen on console. This is also used to print verbose information about the the initialized object. By default, this is set to TRUE.

...

further arguments passed to or from other methods


Method default_agepro_keyword_params()

This will create default values for each primary AGEPRO keyword parameter based on the values passed by the general_params class. Optional keyowrd parameters, such as as discard fraction or discard weight may be created, if enabled.

Usage
agepro_model$default_agepro_keyword_params(
  x,
  projection_analyses_type = "standard",
  enable_cat_print = TRUE,
  ...
)
Arguments
x

General Params class object.

projection_analyses_type

Type of projection analyses type. Default is "standard".

enable_cat_print

Logical flag to show target function's cli cat_print messages to be seen on console.

...

further arguments passed to or from other methods


Method set_recruit_model()

Setup recruitment with a recruitment model collection list with default data using current AGEPRO model's number of recruits and sequence of projection years.

To establish multiple recruit models, pass multiple valid AGERPRO Recruitment Model numbers as vector to the model_num parameter. If the vector length of model_num doesn't match current AGEPRO general parameter's num_rec_models value, it will throw an error.

Usage
agepro_model$set_recruit_model(..., enable_cat_print = TRUE)
Arguments
...

further arguments passed to or from other methods

enable_cat_print

Logical flag to show target function's cli cat_print messages to be seen on console.


Method set_bootstrap_filename()

Wrapper function to call bootstrap's set_bootstrap_filename

Usage
agepro_model$set_bootstrap_filename(bsnfile)
Arguments
bsnfile

bootstrap filename


Method setup_projection_analyses_values()

Helper Function to setup agepro model's projection analyses type. agepro models use standard projection analyses by default, and do not require additional keyword parameter setup. "pstar" and "rebuild" projection analyses types require their own keyword parameter classes to setup. However, they are not created during model initialization.

AGEPRO models must can not have both pstar and rebuilder projection analyses,

Usage
agepro_model$setup_projection_analyses_values(type, enable_cat_print = FALSE)
Arguments
type

projection_analyses_type

enable_cat_print

Logical flag to show target function's cli cat_print messages to be seen on console.


Method clone()

The objects of this class are cloneable with this method.

Usage
agepro_model$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

Examples

## Not run: 
# General parameters for 2019-2026 Uku Projections Base (Example 4)
test <- agepro_model$new(2019,2026,1,32,1000,4,3,0,300)

## End(Not run)

Beverton-Holt Curve w/ Autocorrected Lognormal Error (Model #10)

Description

Beverton-Holt Curve w/ Autocorrected Lognormal Error (Model #10)

Beverton-Holt Curve w/ Autocorrected Lognormal Error (Model #10)

Super classes

ageproR::recruit_model -> ageproR::parametric_curve -> ageproR::parametric_autocorrelated_error -> beverton_holt_autocorrelated_error

Methods

Public methods

Inherited methods

Method new()

Initializes the Beverton Holt Curve with Autocorrelatred Error

Usage
beverton_holt_autocorrelated_error$new(
  alpha = 0,
  beta = 0,
  variance = 0,
  phi = 0,
  log_residual = 0
)
Arguments
alpha


Stock Recruitment Parameter, alpha

beta


Stock Recruitment Parameter, beta

variance


variance

phi


Autocorrelation parameters

log_residual


Log-Scale Residual for the stock recruitment fit in the time prior to the projection


Method clone()

The objects of this class are cloneable with this method.

Usage
beverton_holt_autocorrelated_error$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


Beverton-Holt w/ Lognormal Error (Model #5)

Description

Beverton-Holt w/ Lognormal Error (Model #5)

Beverton-Holt w/ Lognormal Error (Model #5)

Super classes

ageproR::recruit_model -> ageproR::parametric_curve -> beverton_holt_curve_model

Methods

Public methods

Inherited methods

Method new()

Initializes the Beverton Holt Curve Model

Usage
beverton_holt_curve_model$new(alpha = 0, beta = 0, variance = 0)
Arguments
alpha


Stock Recruitment Parameter, alpha

beta


Stock Recruitment Parameter, beta

variance


variance


Method clone()

The objects of this class are cloneable with this method.

Usage
beverton_holt_curve_model$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


Input information for bootstrap numbers at age file

Description

-The Number of data values of each row must equal to the number of age classes. -The number of rows in a bootstrap file must be at least equal to the number of bootstrap iterations containing the population of the first year in the projection

Active bindings

num_bootstraps

Number of bootstraps replicates of initial popualion size

pop_scale_factor

Population Scale Factor, or BootFac, that represents the multiplicative factor to convert the relative bootstrap population numbers at age to absolute numbers at age.

bootstrap_file

Bootstrap file path.

json_list_object

JSON list object for BOOTSTRAP keyword parameter

keyword_name

AGEPRO keyword parameter name

inp_keyword

Returns AGEPRO input-file formatted Parameter

Methods

Public methods


Method new()

Initializes the Bootstrap Class

Usage
bootstrap$new()

Method set_bootstrap_filename()

Uses file dialog interface to retrieve Bootstrap file name

Usage
bootstrap$set_bootstrap_filename(bsn_path)
Arguments
bsn_path

Bootstrap Filename (*.bsn) path


Method read_inp_lines()

Reads in BOOTSTRAP numbers and options from AGEPRO Input file

Usage
bootstrap$read_inp_lines(inp_con, nline)
Arguments
inp_con

Open file connection to AGEPRO Input File.

nline


Location of the current line number being read when the file connection to the AGEPRO input file is open.


Method get_inp_lines()

Returns BOOTSTRAP values AGEPRO input file format (*,inp)

Usage
bootstrap$get_inp_lines(delimiter = " ")
Arguments
delimiter

Character string delimiter separating values of AGEPRO input file line.


Method print()

Prints out BOOTSTRAP fields

Usage
bootstrap$print(...)
Arguments
...

further arguments passed to or from other methods


Method clone()

The objects of this class are cloneable with this method.

Usage
bootstrap$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


converts output as messages

Description

Helper function to format vector output, such as data.frames, matrices. or lists to message format.

Usage

capture_output_as_message(x)

Arguments

x

Vector output object


AGEPRO Case ID

Description

Input title identifying model attributes

Active bindings

model_name

String that describes the projection model run

keyword_name

AGEPRO keyword parameter name

inp_keyword

Returns AGEPRO input-file formatted Parameter

Methods

Public methods


Method new()

Initialize Class

Usage
case_id$new(model_name = NULL)
Arguments
model_name

Character string that describes the projection model


Method print()

Prints out Model case id

Usage
case_id$print()

Method read_inp_lines()

Read AGEPRO Case ID from input data file

Usage
case_id$read_inp_lines(inp_con, nline)
Arguments
inp_con

Open file connection to AGEPRO Input File.

nline


Location of the current line number being read when the file connection to the AGEPRO input file is open.


Method get_inp_lines()

Returns the values for the CASEID keyword parameter formatted to the AGEPRO input file format.description

Usage
case_id$get_inp_lines()

Method clone()

The objects of this class are cloneable with this method.

Usage
case_id$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


Validation for BOUNDS active binding in agepro_model

Description

Custom validation procedure to check if input value has the public methods and active bindings fields of the max_bounds R6Class.

Usage

check_bounds_active_binding(x)

assert_bounds_active_binding(x, .var.name = checkmate::vname(x), add = NULL)

Arguments

x

Object to Check

.var.name

character(1)
Name of the checked object to print in assertions. Defaults to the heuristic implemented in checkmate::vname.

add

checkmate::AssertCollection
Collection to store assertion messages. See checkmate::AssertCollection


Validation for CASEID active binding in agepro_model

Description

Custom validation procedure to check if input value matches the structure of the case_id R6Class. It will also catch single character strings presuming that the input value was intended to set the model_name field.

Usage

check_case_id_active_binding(x)

assert_case_id_active_binding(x, .var.name = checkmate::vname(x), add = NULL)

Arguments

x

Object to Check

.var.name

character(1)
Name of the checked object to print in assertions. Defaults to the heuristic implemented in checkmate::vname.

add

checkmate::AssertCollection
Collection to store assertion messages. See checkmate::AssertCollection


Recruitment model number vector count validation

Description

Checks if input model number matches the number of recruitment models of the model.

Usage

check_model_num_vector_count(x, num_recruit_models)

assert_model_num_vector_count(
  x,
  num_recruit_models,
  .var.name = checkmate::vname(x),
  add = NULL
)

Arguments

x

Object to check

num_recruit_models

Number of recruitment models AGEPRO model at initialization

.var.name

character(1)
Name of the checked object to print in assertions. Defaults to the heuristic implemented in checkmate::vname.

add

checkmate::AssertCollection
Collection to store assertion messages. See checkmate::AssertCollection


Recruitment Model Number Parameter validation

Description

Custom validation to check agepro_model$set_recruit_model() arguments to see if multiple recruit numbers is passed as a single vector or seen as a list of multiple arguments.

If the input value is passed as a list of multiple arguments, this function will "throw" a message of the issue and possible resolution.

assert_model_num_vector_format wraps check_model_num_vector_format as a custom checkmate assertion via checkmate::makeAssertion

Usage

check_model_num_vector_format(x)

assert_model_num_vector_format(x, .var.name = checkmate::vname(x), add = NULL)

Arguments

x

object to check

.var.name

character(1)
Name of the checked object to print in assertions. Defaults to the heuristic implemented in checkmate::vname.

add

checkmate::AssertCollection
Collection to store assertion messages. See checkmate::AssertCollection


Validation for PERC active binding in agepro_model

Description

Custom validation procedure to check if input value matches the structure of the percentile_summary R6Class. It will also catch single numeric input values presuming that the active binder sets the report_percentile.

Usage

check_perc_active_binding(x)

assert_perc_active_binding(x, .var.name = checkmate::vname(x), add = NULL)

Arguments

x

Object to Check

.var.name

character(1)
Name of the checked object to print in assertions. Defaults to the heuristic implemented in checkmate::vname.

add

checkmate::AssertCollection
Collection to store assertion messages. See checkmate::AssertCollection


Projection year sequence vector validation

Description

Custom validation to check projection_years sequence vector is properly incremented by 1, Can be Wrapped as a custom checkmate assertion.

Usage

check_proj_years_sequence(x)

assert_proj_years_sequence(x, .var.name = checkmate::vname(x), add = NULL)

Arguments

x

Object to check

.var.name

character(1)
Name of the checked object to print in assertions. Defaults to the heuristic implemented in checkmate::vname.

add

checkmate::AssertCollection
Collection to store assertion messages. See checkmate::AssertCollection


Creates a table-like matrix with NA values

Description

Wrapper to Matrix function, that returns the object with NA values. Uses the matrix dimnames argument to set row and column names. See Matrix for more information.

Usage

create_blank_parameter_table(num_rows, num_cols, dimnames = NULL)

Arguments

num_rows

the desired number of rows

num_cols

the desired number of columns

dimnames

Matrix dimnames. See Matrix argument for more detail.


DEPRECATED Recruitment Model #9 (Time-Varying Empirical Recruitment Distribution)

Description

DEPRECATED Recruitment Model #9 (Time-Varying Empirical Recruitment Distribution)

DEPRECATED Recruitment Model #9 (Time-Varying Empirical Recruitment Distribution)

Details

Handles an instance for deprecated recruitment model #9.

Super class

ageproR::recruit_model -> deprecated_recruit_model_9

Active bindings

json_recruit_data

Function container to export recruitment model data to experimental jSon input model file. Because recruitment model #9 is DEPRECATED, and not used in the AGEPRO calculation engine, an error will thrown.

Methods

Public methods


Method new()

Initializes the class

Usage
deprecated_recruit_model_9$new()

Method print()

Prints out the error

Usage
deprecated_recruit_model_9$print(...)
Arguments
...

further arguments passed to or from other methods


Method inp_lines_recruit_data()

Function container to export recruitment model data to AGEPRO input model file lines, but since this model is DEPRECATED; not a valid recruitment model type for the AGEPRO calculation engine, an error will thrown.

Usage
deprecated_recruit_model_9$inp_lines_recruit_data(delimiter = " ")
Arguments
delimiter

Character string delimiter separating values of AGEPRO input file line.


Method clone()

The objects of this class are cloneable with this method.

Usage
deprecated_recruit_model_9$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


Discard fraction of numbers at age

Description

Class Structure for discard faction at age AGEPRO Keyword parameter. AGEPRO model must indicate discards are present, enabled via general options discards_present field.

Super class

ageproR::process_error -> discard_fraction

Methods

Public methods

Inherited methods

Method new()

Initializes Class

Usage
discard_fraction$new(
  proj_years,
  num_ages,
  num_fleets,
  input_option = 0,
  time_varying = TRUE,
  enable_cat_print = TRUE
)
Arguments
proj_years

Projection years: Input can be Sequence of years in from first to last year of projection or the number of years in the time projection.

num_ages

Number of Age classes

num_fleets

Number of Fleets.

input_option

Option to indicate this parameter will be:

  • 0 By default, done interactively via interface.

  • 1 Imported via location of an existing data file.

time_varying

Logical flag that enables the stochastic parameter to use as a time-varying array if TRUE (or 1). Otherwise, FALSE the vector will cover "all years" of the projection. Default is TRUE.

enable_cat_print

Logical flag to show target function's cli cat_print messages to be seen on console.


Method clone()

The objects of this class are cloneable with this method.

Usage
discard_fraction$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


Discard weight at age by fleet

Description

AGEPRO keyword parameter class Structure for this fishery process with multiplicative lognormal error distribution.

Super class

ageproR::process_error -> discard_weight_age

Methods

Public methods

Inherited methods

Method new()

Initializes class

Usage
discard_weight_age$new(
  proj_years,
  num_ages,
  num_fleets,
  input_option = 0,
  time_varying = TRUE,
  enable_cat_print = TRUE
)
Arguments
proj_years

Projection years: Input can be Sequence of years in from first to last year of projection or the number of years in the time projection.

num_ages

Number of Age classes

num_fleets

Number of Fleets.

input_option

Option to indicate this parameter will be:

  • 0 By default, done interactively via interface.

  • 1 Imported via location of an existing data file.

time_varying

Logical flag that enables the stochastic parameter to use as a time-varying array if TRUE (or 1). Otherwise, FALSE the vector will cover "all years" of the projection. Default is TRUE.

enable_cat_print

Logical flag to show target function's cli cat_print messages to be seen on console.


Method clone()

The objects of this class are cloneable with this method.

Usage
discard_weight_age$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


Empirical CDF of Recruitment (Model #14)

Description

Empirical CDF of Recruitment (Model #14)

Empirical CDF of Recruitment (Model #14)

Super classes

ageproR::recruit_model -> ageproR::empirical_recruit -> empirical_cdf_model

Methods

Public methods

Inherited methods

Method new()

Initialize the Empirical CDF Model

Usage
empirical_cdf_model$new(num_observations = 2, obs_table = NULL)
Arguments
num_observations


Number of Empirical Observation Records

obs_table

Data Frame containing empirical recruitment observation table. If NULL, set to default values.


Method clone()

The objects of this class are cloneable with this method.

Usage
empirical_cdf_model$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


Empirical Recruitment Distribution (Model #3)

Description

Empirical Recruitment Distribution (Model #3)

Empirical Recruitment Distribution (Model #3)

Super classes

ageproR::recruit_model -> ageproR::empirical_recruit -> empirical_distribution_model

Methods

Public methods

Inherited methods

Method new()

Initialize the Empirical Recruitment Distribution Model

Usage
empirical_distribution_model$new(num_observations, obs_table = NULL)
Arguments
num_observations


Number of Empirical Observation Records

obs_table

Data Frame containing empirical recruitment observation table. If NULL, set to default values.


Method clone()

The objects of this class are cloneable with this method.

Usage
empirical_distribution_model$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


Empirical Recruitment Model Data

Description

Recruitment Model Description

Super class

ageproR::recruit_model -> empirical_recruit

Active bindings

with_ssb

with ssb

low_bound

Lowest significant number bound

json_recruit_data

gets JSON-ready Recruit Model Data

observed_points

Gets/Sets the number of observations used of the model projection

observations

Recruitment Inupt Array (data)

super_

Binds the super class with the empirical_recruit child classes

Methods

Public methods


Method new()

Creates an Empirical Recruit instance

Usage
empirical_recruit$new(num_observations = 1, with_ssb = FALSE, obs_table = NULL)
Arguments
num_observations


Number of Empirical Observation Records

with_ssb

Empirical Recruitment includes Spawning Stock Biomass (SSB)

obs_table

Data Frame containing empirical recruitment observation table. If NULL, set to default values.


Method new_obs_table()

Create Obs table

Usage
empirical_recruit$new_obs_table()

Method set_obs_table_from_df()

Input data frame to set empirical recruitment observation data table. Typically used at initialization.

Usage
empirical_recruit$set_obs_table_from_df(df)
Arguments
df

Input data frame


Method print()

Prints out Recruitment Model

Usage
empirical_recruit$print(...)
Arguments
...

further arguments passed to or from other methods


Method print_json()

Returns Recruit data as JSON

Usage
empirical_recruit$print_json()

Method read_inp_lines()

Read inp lines

Usage
empirical_recruit$read_inp_lines(inp_con, nline)
Arguments
inp_con

Open file connection to AGEPRO Input File.

nline


Location of the current line number being read when the file connection to the AGEPRO input file is open.


Method inp_lines_recruit_data()

Exports RECRUIT submodel data for empirical recruitment types to AGEPRO input file lines.

Usage
empirical_recruit$inp_lines_recruit_data(delimiter = " ")
Arguments
delimiter

Character string delimiter separating values of AGEPRO input file line.


Method clone()

The objects of this class are cloneable with this method.

Usage
empirical_recruit$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


Empirical Recruits Per Spawning Biomass Distribution (SSB) (Model #2)

Description

Empirical Recruits Per Spawning Biomass Distribution (SSB) (Model #2)

Empirical Recruits Per Spawning Biomass Distribution (SSB) (Model #2)

Details

The empirical recruits per spawning biomass distribution model depends on spawning biomass and is time-invariant.

Super classes

ageproR::recruit_model -> ageproR::empirical_recruit -> empirical_ssb

Methods

Public methods

Inherited methods

Method new()

Initializes the Empirical Recruits Per Spawning Biomass Distribution Model

Usage
empirical_ssb$new(num_observations, obs_table = NULL)
Arguments
num_observations


Number of Empirical Observation Records

obs_table

Data Frame containing empirical recruitment observation table. If NULL, set to default values.


Method clone()

The objects of this class are cloneable with this method.

Usage
empirical_ssb$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


Fishery Selectivity at age by fleet

Description

Class Structure for Fishery Selectivity at age by fleet AGEPRO Keyword parameter.

Super class

ageproR::process_error -> fishery_selectivity

Methods

Public methods

Inherited methods

Method new()

Initializes new instance

Usage
fishery_selectivity$new(
  proj_years,
  num_ages,
  num_fleets,
  input_option = 0,
  time_varying = TRUE,
  enable_cat_print = TRUE
)
Arguments
proj_years

Projection years: Input can be Sequence of years in from first to last year of projection or the number of years in the time projection.

num_ages

Number of Age classes

num_fleets

Number of Fleets.

input_option

Option to indicate this parameter will be:

  • 0 By default, done interactively via interface.

  • 1 Imported via location of an existing data file.

time_varying

Logical flag that enables the stochastic parameter to use as a time-varying array if TRUE (or 1). Otherwise, FALSE the vector will cover "all years" of the projection. Default is TRUE.

enable_cat_print

Logical flag to show target function's cli cat_print messages to be seen on console.


Method clone()

The objects of this class are cloneable with this method.

Usage
fishery_selectivity$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


Input general model parameters

Description

Stores overall AGERPRO model project parameters including the projection time horizon, the target model's age class range, the quantity of recruitment models used, and fishery processes that affect projections.

Active bindings

yr_start

First Year in Projection

yr_end

Last Year in Projection

age_begin

First Age Class

age_end

Last Age Class

num_pop_sims

Number of Population Simulations

num_fleets

Number of Fleets

num_rec_models

Number of Recruitment Models

discards_present

Are discards present?

seed

Pseudo Random Number seed

num_years

Determines the number of years in projection by the (absolute) difference of the last and first year of projection.

num_ages

Determines number of ages by the (absolute) difference of the first and last age class.

seq_years

Returns a sequence of years from First year of projection

keyword_name

AGEPRO keyword parameter name

inp_keyword

Returns AGEPRO input-file formatted Parameter

json_list_object

List of GENERAL keyword fields values, exportable to JSON.

Methods

Public methods


Method new()

Starts an instances of the AGEPRO Model

Usage
general_params$new(
  yr_start = 0,
  yr_end = 2,
  age_begin = 1,
  age_end = 6,
  num_pop_sims = 1000,
  num_fleets = 1,
  num_rec_models = 1,
  discards_present = FALSE,
  seed = sample.int(1e+08, 1),
  enable_cat_print = TRUE
)
Arguments
yr_start

First Year of Projection

yr_end

Last Year of Projection

age_begin

age begin

age_end

age end

num_pop_sims

Number of population sims

num_fleets

Number of fleets

num_rec_models

Number of Recruit Modeles

discards_present

discards_present

seed

Random Number seed

enable_cat_print

Logical flag to show target function's messages on console. By Default, set to TRUE.


Method print()

Prints out General Parameters

Usage
general_params$print(...)
Arguments
...

further arguments passed to or from other methods


Method read_inp_lines()

Reads General AGEPRO parameters from AGEPRO INP Input File

Usage
general_params$read_inp_lines(inp_con, nline)
Arguments
inp_con

Open file connection to AGEPRO Input File.

nline


Location of the current line number being read when the file connection to the AGEPRO input file is open.


Method get_inp_lines()

Returns the values for the GENERAL keyword parameter formatted to the AGEPRO input file format.

Usage
general_params$get_inp_lines(delimiter = "  ")
Arguments
delimiter

Character string delimiter separating values of AGEPRO input file line.


Method clone()

The objects of this class are cloneable with this method.

Usage
general_params$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


Harvest intensity (of fishing mortality or landings quota) by fleet

Description

Class Structure containing the Harvest values and Harvest Specifications

Active bindings

harvest_specifications

Contains values the Harvest Specification per projection year

"0"

F-MULT

"1"

LANDINGS

"2"

REMOVALS

harvest_value

Contains the harvest Amount per projection year. Can be fleet specific if more than 2 fleets are specified.

harvest_scenario_table

Combines the Harvest specification and (fleet) harvest amount per projection year.

json_list_object

Returns JSON list object with Harvest Specification and Harvest Values

keyword_name

AGEPRO keyword parameter name

inp_keyword

Returns AGEPRO input-file formatted Parameter

Methods

Public methods


Method new()

Initializes Class

Usage
harvest_scenario$new(projection_years, num_fleets = 1, ...)
Arguments
projection_years

Projection years: Input can be Sequence of years in from first to last year of projection or the number of years in the time projection.

num_fleets

Number of Fleets. Default is 1

...

further arguments passed to or from other methods


Method print()

Formatted to print out the Harvest Scenario Table

Usage
harvest_scenario$print(enable_cat_print = TRUE)
Arguments
enable_cat_print

Logical flag to show target function's cli cat_print messages to be seen on console.


Method setup_harvest_scenario_variables()

Helper function to setup harvest_scenario's variables harvest_specifications, harvest_value, harvest_scenario_table

Usage
harvest_scenario$setup_harvest_scenario_variables(proj_years, num_fleets = 1)
Arguments
proj_years

Projection years object

num_fleets

Number of Fleets. Defaults to 1


Method read_inp_lines()

Reads in Harvest Scenario keyword parameter's values from the AGEPRO Input file

Usage
harvest_scenario$read_inp_lines(inp_con, nline, proj_years, num_fleets = 1)
Arguments
inp_con

Open file connection to AGEPRO Input File.

nline


Location of the current line number being read when the file connection to the AGEPRO input file is open.

proj_years

Projection years: Input can be Sequence of years in from first to last year of projection or the number of years in the time projection.

num_fleets

Number of Fleets. Default is 1


Method get_inp_lines()

Returns Harvest Specification and Harvest Values from the Harvest Scenario parameter formatted to the AGEPRO input file format.

Usage
harvest_scenario$get_inp_lines(delimiter = " ")
Arguments
delimiter

Character string delimiter separating values of AGEPRO input file line.


Method clone()

The objects of this class are cloneable with this method.

Usage
harvest_scenario$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


Invalid Path Message

Description

Returns a reusable invalid Path Message

Usage

invalid_path_message(x)

Arguments

x

Filepath string


Checks Rstudioapi if Rstudio Desktop is used.

Description

vscode uses/emulates rstudioapi but not all features rstudioapi are implemented. vscode's rstudio version information is set to '0'. For Rstudio specific code, check for mode "desktop", and version > '0'

Usage

is_rstudio_desktop()

Stock Weights on January 1st at Age

Description

AGEPRO keyword parameter class Structure for this fishery process with multiplicative lognormal error distribution.

Super class

ageproR::process_error -> jan_stock_weight_age

Methods

Public methods

Inherited methods

Method new()

Initializes class

Usage
jan_stock_weight_age$new(
  proj_years,
  num_ages,
  input_option = 0,
  time_varying = TRUE,
  enable_cat_print = TRUE
)
Arguments
proj_years

Projection years: Input can be Sequence of years in from first to last year of projection or the number of years in the time projection.

num_ages

Number of Age classes

input_option

Option to indicate this parameter will be:

  • 0 By default, done interactively via interface.

  • 1 Imported via location of an existing data file.

time_varying

Logical flag that enables the stochastic parameter to use as a time-varying array if TRUE (or 1). Otherwise, FALSE the vector will cover "all years" of the projection. Default is TRUE.

enable_cat_print

Logical flag to show target function's cli cat_print messages to be seen on console.


Method clone()

The objects of this class are cloneable with this method.

Usage
jan_stock_weight_age$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


Landed Catch weight at age by fleet

Description

AGEPRO keyword parameter class Structure for this fishery process with multiplicative lognormal error distribution.

Super class

ageproR::process_error -> landed_catch_weight_age

Methods

Public methods

Inherited methods

Method new()

Initializes class

Usage
landed_catch_weight_age$new(
  proj_years,
  num_ages,
  num_fleets,
  input_option = 0,
  time_varying = TRUE,
  enable_cat_print = TRUE
)
Arguments
proj_years

Projection years: Input can be Sequence of years in from first to last year of projection or the number of years in the time projection.

num_ages

Number of Age classes

num_fleets

Number of Fleets.

input_option

Option to indicate this parameter will be:

  • 0 By default, done interactively via interface.

  • 1 Imported via location of an existing data file.

time_varying

Logical flag that enables the stochastic parameter to use as a time-varying array if TRUE (or 1). Otherwise, FALSE the vector will cover "all years" of the projection. Default is TRUE.

enable_cat_print

Logical flag to show target function's cli cat_print messages to be seen on console.


Method clone()

The objects of this class are cloneable with this method.

Usage
landed_catch_weight_age$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


Maturation fraction at age

Description

AGEPRO keyword parameter class Structure for this fishery process with multiplicative lognormal error distribution.

Super class

ageproR::process_error -> maturity_fraction

Methods

Public methods

Inherited methods

Method new()

Initializes Class

Usage
maturity_fraction$new(
  proj_years,
  num_ages,
  input_option = 0,
  time_varying = TRUE,
  enable_cat_print = TRUE
)
Arguments
proj_years

Projection years: Input can be Sequence of years in from first to last year of projection or the number of years in the time projection.

num_ages

Number of Age classes

input_option

Option to indicate this parameter will be:

  • 0 By default, done interactively via interface.

  • 1 Imported via location of an existing data file.

time_varying

Logical flag that enables the stochastic parameter to use as a time-varying array if TRUE (or 1). Otherwise, FALSE the vector will cover "all years" of the projection. Default is TRUE.

enable_cat_print

Logical flag to show target function's cli cat_print messages to be seen on console.


Method clone()

The objects of this class are cloneable with this method.

Usage
maturity_fraction$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


Sets the maximum bounds of Weight(MT) and natural mortality

Description

Class Structure that defines maximum bound for weight and natural mortality. The values can be used to limit these values.

The logical flag enable_max_bounds allows the user to set values to this class fields: max_weight, max_natural_mortality. The flag will also notify agepro_model if this keyword parameter is allowed to be written to input file.

Setting maximum bounds is an optional option for agepro models. It will check if the max_bound class was initialized with values equal to the default value for max_weight and max_nat_mort. If both values match the defaults, then enable_max_bounds is flagged as FALSE; this keyword parameter is not used in the agepro_model. Setting non-default values for all of its parameters will set this flag to TRUE.

Details

The max_bounds class (or BOUNDS) is recognized as a keyword parameter used in the AGEPRO input file format, but it is optional.

Active bindings

max_weight

The maximum value of fish weight, noting that there is lognormal sampling variation for weight at age values

max_natural_mortality

The maximum natural mortality rate, noting that there is lognormal sampling variation for natural mortality at age values

json_list_object

Returns JSON list object of containing BOUNDS values

enable_max_bounds

Logical field that flags if fields can be edited. To set the value use set_enable_max_bounds or field

keyword_name

AGEPRO keyword parameter name

inp_keyword

Returns AGEPRO input-file formatted Parameter

Methods

Public methods


Method new()

Initializes the class

Usage
max_bounds$new(max_weight = 10, max_nat_mort = 1, bounds_flag = NULL)
Arguments
max_weight

Maximum bound weight (MT). Default is 10.0

max_nat_mort

Maximum bound of natural mortality. Default is 1.0.

bounds_flag

R6class containing option flags to allow max bounds to be used


Method print()

Formatted to print out max_bounds values

Usage
max_bounds$print()

Method read_inp_lines()

Reads in the values from the keyword parameter BOUNDS from the AGEPRO Input file

Note: enable_max_bounds must be set to TRUE.

Usage
max_bounds$read_inp_lines(inp_con, nline)
Arguments
inp_con

Open file connection to AGEPRO Input File.

nline


Location of the current line number being read when the file connection to the AGEPRO input file is open.


Method get_inp_lines()

Returns values from the class to the BOUNDS AGEPRO keyword parameter formatted as AGEPRO input file lines.

Usage
max_bounds$get_inp_lines(delimiter = " ")
Arguments
delimiter

Character string delimiter separating values of AGEPRO input file line.


Method clone()

The objects of this class are cloneable with this method.

Usage
max_bounds$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


Mean (or mid-year) weights at age

Description

AGEPRO keyword parameter class Structure for this population process with multiplicative lognormal error distribution.

Super class

ageproR::process_error -> mean_population_weight_age

Methods

Public methods

Inherited methods

Method new()

Initializes class

Usage
mean_population_weight_age$new(
  proj_years,
  num_ages,
  input_option = 0,
  time_varying = TRUE,
  enable_cat_print = TRUE
)
Arguments
proj_years

Projection years: Input can be Sequence of years in from first to last year of projection or the number of years in the time projection.

num_ages

Number of Age classes

input_option

Option to indicate this parameter will be:

  • 0 By default, done interactively via interface.

  • 1 Imported via location of an existing data file.

time_varying

Logical flag that enables the stochastic parameter to use as a time-varying array if TRUE (or 1). Otherwise, FALSE the vector will cover "all years" of the projection. Default is TRUE.

enable_cat_print

Logical flag to show target function's cli cat_print messages to be seen on console.


Method clone()

The objects of this class are cloneable with this method.

Usage
mean_population_weight_age$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


Proportion of total mortality occurring prior to spawn in year t

Description

Class Structure that includes proportion seasonal timing for fishing mortality & natural mortality prior to spawning season

Active bindings

time_varying

Logical flag to list fishing and natural mortality per observation year if TRUE or representative of the

proportion_total_mortality_matrix

Proportion of total mortality occurring prior to spawning

natural_mortality_prior_spawn

Returns the proportions of Natural mortality (TM) that occurs from January 1st to Spawning Season.

fishing_mortality_prior_spawn

Returns within-year fractions of fishing mortality (TF) that occurs from January 1st to Spawning Season.

json_list_object

Returns JSON list object of values from the mortality_fraction_prior_spawn class

keyword_name

AGEPRO keyword parameter name

inp_keyword

Returns AGEPRO input-file formatted Parameter

Methods

Public methods


Method new()

Initializes the class

Usage
mortality_fraction_prior_spawn$new(
  proj_years_vector,
  time_varying = FALSE,
  default_proportion = 0.5,
  enable_cat_print = TRUE
)
Arguments
proj_years_vector

Input can be Sequence of years in from first to last year of projection or the number of years in the time projection.

time_varying

Logical flag that enables the stochastic parameter to use as a time-varying array if TRUE (or 1). Otherwise, FALSE the vector will cover "all years" of the projection. Default is FALSE

default_proportion

Proportion default values. Time varying will adjust the values by number of projection years.

enable_cat_print

Logical flag to show target function's cli cat_print messages to be seen on console.

enable_cat_print

Logical flag to show target function's cli cat_print messages to be seen on console.


Method print()

Formatted to print out the values of the Fraction Mortality Parameter

Usage
mortality_fraction_prior_spawn$print(enable_cat_print = TRUE)
Arguments
enable_cat_print

Logical flag to show target function's cli cat_print messages to be seen on console.

enable_cat_print

Logical flag to show target function's cli cat_print messages to be seen on console.


Method read_inp_lines()

Reads in the values from the keyword parameter BIOLOGICAL from the AGEPRO Input file

Usage
mortality_fraction_prior_spawn$read_inp_lines(
  inp_con,
  nline,
  proj_years_vector
)
Arguments
inp_con

Open file connection to AGEPRO Input File.

nline


Location of the current line number being read when the file connection to the AGEPRO input file is open.

proj_years_vector

Input can be Sequence of years in from first to last year of projection or the number of years in the time projection.


Method get_inp_lines()

Returns values from the mortality_fraction_prior_spawn (BIOLOGICAL) AGEPRO keyword parameter formatted as AGEPRO input file lines.

Usage
mortality_fraction_prior_spawn$get_inp_lines(delimiter = " ")
Arguments
delimiter

Character string delimiter separating values of AGEPRO input file line.


Method clone()

The objects of this class are cloneable with this method.

Usage
mortality_fraction_prior_spawn$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


Input information for the natural mortality rate (M) at Age

Description

Generalized Class Structure for Natural Mortality rate of age AGEPRO Keyword parameter.

Super class

ageproR::process_error -> natural_mortality

Methods

Public methods

Inherited methods

Method new()

Initializes the class

Usage
natural_mortality$new(
  proj_years,
  num_ages,
  input_option = 0,
  time_varying = TRUE,
  enable_cat_print = TRUE
)
Arguments
proj_years

Projection years: Input can be Sequence of years in from first to last year of projection or the number of years in the time projection.

num_ages

Number of Age classes

input_option

Option to indicate this parameter will be:

  • 0 By default, done interactively via interface.

  • 1 Imported via location of an existing data file.

time_varying

Logical flag that enables the stochastic parameter to use as a time-varying array if TRUE (or 1). Otherwise, FALSE the vector will cover "all years" of the projection. Default is TRUE.

enable_cat_print

Logical flag to show target function's cli cat_print messages to be seen on console.


Method clone()

The objects of this class are cloneable with this method.

Usage
natural_mortality$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


Null Recruitment UI Fallback Default

Description

Recruitment Model Description

Super class

ageproR::recruit_model -> null_recruit_model

Active bindings

json_recruit_data

Function container to export recruitment model data to experimental jSon input model file. However, NULL recruitment is not a valid recruitment model type, an error will thrown.

Methods

Public methods


Method new()

Initialize

Usage
null_recruit_model$new()

Method print()

Prints out NULL Recruiment Model Data

Usage
null_recruit_model$print(...)
Arguments
...

further arguments passed to or from other methods


Method inp_lines_recruit_data()

Function container to export recruitment model data to AGEPRO input model file lines, but since NULL recruitment is not a valid recruitment model type for the AGEPRO calculation engine, an error will thrown to indicate NuLL recruitment

Usage
null_recruit_model$inp_lines_recruit_data(delimiter = " ")
Arguments
delimiter

Character string delimiter separating values of AGEPRO input file line.


Method clone()

The objects of this class are cloneable with this method.

Usage
null_recruit_model$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


Class container that encapsulates logical flags to enable AGEPRO user-defined options

Description

Encapsulates logical flags indicating that an optional AGEPRO's option can be used: these options are percentile summary (PERC), scaling factors (SCALE), biological reference points (REFPOINT), maximum bounds (BOUNDS), and retrospective adjustment (RETROADJUST).

Details

Associated with AGEPRO's output options (OPTIONS) are additional optional options:

  • PERC : percentile_summary

  • REFPOINT : reference_points

  • SCALE : scaling_factors

  • BOUNDS : max_bounds

  • RETROADJUST : retrospective_adjustment

The AGEPRO input file format recognizes these optional keyword parameters. At initialization, all option flags will be set to FALSE. To "enable" an optional option or set it to TRUE, assign a value to the optional option's field. For example, if the flag to enable for percentile summary is FALSE: set value report_percentile, Then it will be TRUE

Public fields

enable_percentile_summary

Enables output summary report of specific Percentile

enable_reference_points

Enables biological reference points threshold report

enable_scaling_factors

Enables Scaling Factors

enable_max_bounds

Sets maximum bounds of Weight(MT) and natural mortality

enable_retrospective_adjustments

Allows use of Retrospective Adjustment Factors by Age

Methods

Public methods


Method clone()

The objects of this class are cloneable with this method.

Usage
options_flag_container$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

Public fields

op

Class container that encapsulates logical flags to enable AGEPRO user-defined options

Methods

Public methods


Method new()

Initialize

Usage
options_flags$new()

Method clone()

The objects of this class are cloneable with this method.

Usage
options_flags$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


AGEPRO projection output options.

Description

Class Structure that includes user-defined options to enable auxiliary or options to export AGEPRO output

Active bindings

auxfile_output_flag

Logical flag to output stock summary information

process_error_datafiles

Logical flag to output population and fishery processes simulated with lognormal process error (process_error parameters) to auxiliary output files

export_df

Logical flag to output AGEPRO calculation engine projection results to R data.frame. Default is 1 (or TRUE) at initialization.

valid_aux_output_flags

Returns a list of valid numerical flags to enable _Stock of Age _ Distribution Summary and Auxiliary Files.

enable_agepro40_format

Logical flag to indicate model is using the ⁠AGEPRO VERSION 4.0⁠ format for setting auxiliary files.

json_list_object

Returns JSON list object of containing options_output values

keyword_name

AGEPRO keyword parameter name

inp_keyword

Returns AGEPRO input-file formatted Parameter

Methods

Public methods


Method new()

Initializes the class

Usage
options_output$new(
  auxiliary_flag = 0,
  process_error_datafiles = FALSE,
  export_df = TRUE,
  enable_agepro40_format = FALSE
)
Arguments
auxiliary_flag

Numeric flag to enable Stock Distribution Summary file and auxiliary data. The following options allow the user to select which output from the AGEPRO calculation engine is returned:

0

Do not output Stock of Age Distribution Summary File, but output auxiliary data files EXCEPT the Stock Numbers of Age Auxiliary File.

1

Output Stock of Age Distribution Summary File and all auxiliary data files files.

2

Do not output Stock of Age Distribution Summary and Auxiliary files.

3

Output Stock of Age Distribution Summary, but do not output any auxiliary files.

4

Output Stock of Age Distribution Summary and Auxiliary files EXCEPT the Stock Numbers of Age Auxiliary File

process_error_datafiles

Logical flag to enable output of population and fishery process error results as auxiliary files

export_df

Logical flag to enable AGEPRO output to data.frame

enable_agepro40_format

Logical flag to indicate model is using the ⁠AGEPRO VERSION 4.0⁠ format for setting auxiliary files.


Method print()

Formatted to print out output_option values

Usage
options_output$print()

Method read_inp_lines()

Reads in the values from the keyword parameter OPTIONS from the AGEPRO Input file

Usage
options_output$read_inp_lines(inp_con, nline)
Arguments
inp_con

Open file connection to AGEPRO Input File.

nline


Location of the current line number being read when the file connection to the AGEPRO input file is open.


Method get_inp_lines()

Returns values from the options_output (OPTIONS) AGEPRO keyword parameter formatted as AGEPRO input file lines.

Usage
options_output$get_inp_lines(delimiter = " ")
Arguments
delimiter

Character string delimiter separating values of AGEPRO input file line.


Method clone()

The objects of this class are cloneable with this method.

Usage
options_output$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


Parametric Recruitment Model w/ correlated lognormal error

Description

Recruitment Model Description

Super classes

ageproR::recruit_model -> ageproR::parametric_curve -> parametric_autocorrelated_error

Active bindings

phi

Sets the Autocorrelated parametric Curve Parameter, phi. Returns the current value if no argument was passed.

log_residual

Sets the Autocorrelated parametric Curve Parameter, log_residual. Returns the current value if no argument was passed.

json_recruit_data

Returns JSON-ready Recruit Model Data

Methods

Public methods


Method new()

Initializes the Model

Usage
parametric_autocorrelated_error$new(
  alpha = 0,
  beta = 0,
  variance = 0,
  phi = 0,
  log_residual = 0
)
Arguments
alpha


Stock Recruitment Parameter, alpha

beta


Stock Recruitment Parameter, beta

variance


variance

phi


Autocorrelation parameters

log_residual


Log-Scale Residual for the stock recruitment fit in the time prior to the projection


Method print()

Prints out Parametric Data

Usage
parametric_autocorrelated_error$print(...)
Arguments
...

further arguments passed to or from other methods


Method inp_lines_recruit_data()

Exports RECRUIT submodel data for autocorrleated parametric curve recruitment as formatted AGEPRO input file lines.

Usage
parametric_autocorrelated_error$inp_lines_recruit_data(delimiter = " ")
Arguments
delimiter

Character string delimiter separating values of AGEPRO input file line.


Method read_inp_lines()

Reads Autocorrelated Parametric Curve model data from AGEPRO Input file

Usage
parametric_autocorrelated_error$read_inp_lines(inp_con, nline)
Arguments
inp_con

Open file connection to AGEPRO Input File.

nline


Location of the current line number being read when the file connection to the AGEPRO input file is open.


Method clone()

The objects of this class are cloneable with this method.

Usage
parametric_autocorrelated_error$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


Parametric Recruitment Model

Description

Recruitment Model Description

Super class

ageproR::recruit_model -> parametric_curve

Active bindings

json_recruit_data

Returns JSON-ready Recruit Model Data'

alpha

Sets the Parametric Curve Parameter, alpha. Returns the current value if no argument was passed

beta

Sets the Parametric Curve Parameter, beta. Returns the current value if no argument was passed

variance

Sets the Parametric Curve Parameter, variance. Returns the current value if no argument was passed.

model_group

Model group Number

super_

Binds the super class to parametric_curve child classes

Methods

Public methods


Method new()

Instantiate Parametric Recruitment Curve Model

Usage
parametric_curve$new(alpha = 0, beta = 0, variance = 0)
Arguments
alpha


Stock Recruitment Parameter, alpha

beta


Stock Recruitment Parameter, beta

variance


variance


Method inp_lines_recruit_data()

Exports RECRUIT submodel data for parametric curve recruitment to AGEPRO input file lines.

Usage
parametric_curve$inp_lines_recruit_data(delimiter = " ")
Arguments
delimiter

Character string delimiter separating values of AGEPRO input file line.


Method print()

Prints out Parametric Data

Usage
parametric_curve$print(...)
Arguments
...

further arguments passed to or from other methods


Method read_inp_lines()

Reads Parametric Curve model data from AGEPRO Input file

Usage
parametric_curve$read_inp_lines(inp_con, nline)
Arguments
inp_con

Open file connection to AGEPRO Input File.

nline


Location of the current line number being read when the file connection to the AGEPRO input file is open.


Method clone()

The objects of this class are cloneable with this method.

Usage
parametric_curve$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


Percentile summary of the key results of AGEPRO projection output

Description

Class Structure that includes user-defined options for setting a specific percentile for the distributions of outputs.

The logical flag enable_percentile_summary allows the user to set values to this class field: report_percentile. The flag will also notify agepro_model if this keyword parameter is allowed to be written to input file.

If percentile_summary is initialized with default values, it is presumed that this keyword parameter is not used in the agepro_model. Therefore, enable_percentile_summary is flagged as FALSE. Valid non- default values will set this flag to TRUE.#'

Details

The percentile_summary class (or PERC) is an optional keyword parameter used in the AGEPRO input file format.

Active bindings

report_percentile

User-defined percentile for reporting the percentile of the projected distribution of the following quantities of interest by year: spawning stock biomass, stock biomass on January 1st, mean biomass, combined catch biomass, landings, fishing mortality, and stock numbers at age

enable_percentile_summary

Read-only logical field that flags if fields can be edited. To set the value use set_enable_percentile_summary or field

json_list_object

Returns JSON list object of containing options_output values

keyword_name

AGEPRO keyword parameter name

inp_keyword

Returns AGEPRO input-file formatted Parameter

Methods

Public methods


Method new()

Initializes the class

Usage
percentile_summary$new(perc = 0, perc_flag = NULL)
Arguments
perc

User-defined percentile of projected distributions

perc_flag

R6class containing option flags to allow percentile summary to be used


Method print()

Formatted to print out output_option values

Usage
percentile_summary$print()

Method read_inp_lines()

Reads in the values from the keyword parameter PERC from the AGEPRO Input file

Usage
percentile_summary$read_inp_lines(inp_con, nline)
Arguments
inp_con

Open file connection to AGEPRO Input File.

nline


Location of the current line number being read when the file connection to the AGEPRO input file is open.


Method get_inp_lines()

Returns values from the class to the PERC AGEPRO keyword parameter formatted as AGEPRO input file lines.

Usage
percentile_summary$get_inp_lines(delimiter = " ")
Arguments
delimiter

Character string delimiter separating values of AGEPRO input file line.


Method clone()

The objects of this class are cloneable with this method.

Usage
percentile_summary$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


Process Errors for Population and Fishery Processes

Description

Generalized Class Structure for AGEPRO Keyword parameters who have process errors that generate time-varying dynamics of population and fishery process.

Active bindings

input_option

Option to indicate this parameter will be read:

  • 0 By default, done interactively via interface.

  • 1 Imported via location of an existing data file.

time_varying

Logical flag to list parameter process data by observation year

parameter_table

This is the logic for the fish population or fishery's processes by age (and by fleet if fleets are a factor).

cv_table

Matrix containing the vector of the lognormal process error of the average population or fishery process parameter's at age (and by fleet if fleets are a factor).

parameter_title

Name of the population or fishery process

keyword_name

AGEPRO keyword parameter name

inp_keyword

Returns AGEPRO input-file formatted Parameter name

json_list_object

Returns JSON list object with Process Error Parameter values

Methods

Public methods


Method new()

Initializes the class

Usage
process_error$new(
  proj_years,
  num_ages,
  num_fleets = 1,
  input_option = 0,
  time_varying = TRUE,
  ...
)
Arguments
proj_years

Projection years: Input can be Sequence of years in from first to last year of projection or the number of years in the time projection.

num_ages

Number of Age classes

num_fleets

Number of Fleets. Default is 1

input_option

Option to indicate this parameter will be:

  • 0 By default, done interactively via interface.

  • 1 Imported via location of an existing data file.

time_varying

Logical flag that enables the stochastic parameter to use as a time-varying array if TRUE (or 1). Otherwise, FALSE the vector will cover "all years" of the projection. Default is TRUE.

...

further arguments passed to or from other methods


Method create_parameter_table()

Creates an Population or Fishery process Parameter table

Usage
process_error$create_parameter_table(fleet_yr_rows, ages_cols)
Arguments
fleet_yr_rows

(Fleet-)Year Row

ages_cols

Age Columns


Method print()

Formatted to print out the values of the Process Error Parameter

Usage
process_error$print(enable_cat_print = TRUE, ...)
Arguments
enable_cat_print

Logical flag to show target function's cli cat_print messages to be seen on console.

...

further arguments passed to or from other methods


Method read_inp_lines()

Reads in Process Error keyword parameter's values from AGEPRO Input file

Usage
process_error$read_inp_lines(
  inp_con,
  nline,
  proj_years,
  num_ages,
  num_fleets = 1
)
Arguments
inp_con

Open file connection to AGEPRO Input File.

nline


Location of the current line number being read when the file connection to the AGEPRO input file is open.

proj_years

Projection years: Input can be Sequence of years in from first to last year of projection or the number of years in the time projection.

num_ages

Number of Age classes

num_fleets

Number of Fleets. Default is 1


Method read_inp_lines_parameter_tables()

Helper function to set population or fishery process parameter tables from AGEPRO input files. Reads in an additional line (or lines) from the file connection to assign to the parameter_table

Usage
process_error$read_inp_lines_parameter_tables(inp_con, nline)
Arguments
inp_con

Open file connection to AGEPRO Input File.

nline


Location of the current line number being read when the file connection to the AGEPRO input file is open.


Method read_inp_lines_cv_table()

Internal helper function to set cv tables from AGEPRO input files. Reads in an additional line (or lines) from the file connection to assign to the cv_table

Usage
process_error$read_inp_lines_cv_table(inp_con, nline)
Arguments
inp_con

Open file connection to AGEPRO Input File.

nline


Location of the current line number being read when the file connection to the AGEPRO input file is open.


Method get_inp_lines()

Returns the values for the Process Error parameter formatted to the AGEPRO input file format.

Usage
process_error$get_inp_lines(delimiter = "  ")
Arguments
delimiter

Character string delimiter separating values of AGEPRO input file line.


Method clone()

The objects of this class are cloneable with this method.

Usage
process_error$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


Generalized structure of projection analyses keyword parameters

Description

Generalized or common data structure for Standard (Harvest Table only), Rebuilding, and PStar projection analyses based AGEPRO Keyword parameters.

Active bindings

target_year

User-Selected target year for rebuilder and pstar projection analyses

keyword_name

AGEPRO keyword parameter name

inp_keyword

Returns AGEPRO input-file formatted Parameter

Methods

Public methods


Method new()

Initializes class

Usage
projection_analyses$new(proj_years, target_year = NULL)
Arguments
proj_years

May be a single numeric value: the number of years in the time projection; a vector of sequential values: Sequence of years in from first to last year of the time projection; or an instance of Projection years:

target_year

Harvest Scenario Target Year for Pstar or Rebuild projections. The NULL default triggers the default to be assigned to the last projection year from proj_years


Method clone()

The objects of this class are cloneable with this method.

Usage
projection_analyses$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


Projection Years

Description

Projection Years

Projection Years

Details

Handle the ambiguous use of "projection years" that can interpreted as a single int representing the count of projection years or a vector of sequential values representing a vector of "years" from first to last year of the AGEPRO model's time projection.

Active bindings

count

The count of projection_years

sequence

Vector of years of time projection

Methods

Public methods


Method new()

Initializes the class

Usage
projection_years$new(x)
Arguments
x

Projected year value or vector


Method print()

Prints out projection_years fields

Usage
projection_years$print()

Method clone()

The objects of this class are cloneable with this method.

Usage
projection_years$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


Projection analyses that shows the probability of exceeding overfishing threshold of the target year

Description

Input information for calculating Total Allowable Catch (TACpstarTAC_{pstar}) to produce PP*, which is the probability of overfishing in the target projection year

Details

Creating or importing pstar_projection object will overwrite the any existing rebuild and pstar projection objects.

Super class

ageproR::projection_analyses -> pstar_projection

Active bindings

num_pstar_levels

Number of pstar values to be evaluated

pstar_levels_table

The vector of probabilities of overfishing or PStar values to be used

pstar_overfishing_f

Fishing mortality rate that defines the overfishing level

json_list_object

Returns JSON list object of PStar Projection values

Methods

Public methods


Method new()

Initializes class

Usage
pstar_projection$new(proj_years, num_pstar_levels = 1, pstar_f = 0, ...)
Arguments
proj_years

May be a single numeric value: the number of years in the time projection; a vector of sequential values: Sequence of years in from first to last year of the time projection; or an instance of Projection years

num_pstar_levels

Number of Pstar levels. Default is 1

pstar_f

Fishing mortality rate ff. Default is 0.0

...

Other parameters to pass to projection_analyses


Method create_blank_pstar_levels_table()

Creates a blank table-like matrix of probabilities of overfishing, or PStar values, to be used.

Usage
pstar_projection$create_blank_pstar_levels_table(num_pstar_levels = 1)
Arguments
num_pstar_levels

Number of pstar values


Method read_inp_lines()

Reads in the values from the keyword parameter PSTAR from the AGEPRO Input file

Usage
pstar_projection$read_inp_lines(inp_con, nline)
Arguments
inp_con

Open file connection to AGEPRO Input File.

nline


Location of the current line number being read when the file connection to the AGEPRO input file is open.


Method get_inp_lines()

Returns PStar projection Values formatted as AGEPRO input file lines.

Usage
pstar_projection$get_inp_lines(delimiter = " ")
Arguments
delimiter

Character string delimiter separating values of AGEPRO input file line.


Method print()

Formatted to print out PStar values on Rconsole

Usage
pstar_projection$print(enable_cat_print = TRUE)
Arguments
enable_cat_print

Logical flag to show target function's cli cat_print messages to be seen on console.


Method clone()

The objects of this class are cloneable with this method.

Usage
pstar_projection$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


Input information for calculating F to rebuild spawning biomass

Description

Rebuilding projections is focused on the calculation of the constant total fishing mortality calculated across all fleets that will rebuild the population, denoted as FREBUILDF_{REBUILD}.

Details

Creating or importing rebuild_projection object will overwrite the any existing rebuild and pstar projection objects.

Super class

ageproR::projection_analyses -> rebuild_projection

Active bindings

json_list_object

Returns JSON list object of rebuilder Projection values

target_biomass_value

Rebuilding projection's target biomass value in units of thousands of metric tons (MT)

target_biomass_type

Index for the type of population biomass as the target:

0

Spawning Stock Biomass

1

January 1st Stock Biomass

2

Mid-Year (Mean) Biomass

target_percent

The percent frequency of achieving the target value by the target year. The percent frequency is a value between 0 (a zero chance of achieving target) and 100 (indicating a 100 percent chance of achieving target).

Methods

Public methods


Method new()

Initializes class

Usage
rebuild_projection$new(
  proj_years,
  target_biomass = 0,
  target_type = 0,
  target_percent = 0,
  ...
)
Arguments
proj_years

May be a single numeric value: the number of years in the time projection; a vector of sequential values: Sequence of years in from first to last year of the time projection; or an instance of Projection years

target_biomass

Target biomass value in units of thousands of metric tons (MT). Default set to 0.

target_type

Target population biomass:

0

Spawning Stock Biomass. Set as Default

1

January 1st Stock Biomass

2

Mid-Year (Mean) Biomass

target_percent

The percent frequency that target_year reaches target_biomass from 0 to 100. Default set to 0.

...

Other parameters to pass to projection_analyses


Method read_inp_lines()

Reads in the values from the keyword parameter REBUILD from the AGEPRO Input file

Usage
rebuild_projection$read_inp_lines(inp_con, nline)
Arguments
inp_con

Open file connection to AGEPRO Input File.

nline


Location of the current line number being read when the file connection to the AGEPRO input file is open.


Method get_inp_lines()

Returns rebuild projection Values formatted as AGEPRO input file lines.

Usage
rebuild_projection$get_inp_lines(delimiter)
Arguments
delimiter

Character string delimiter separating values of AGEPRO input file line.


Method print()

Prints out the rebuild projections fields to console

Usage
rebuild_projection$print(...)
Arguments
...

further arguments passed to or from other methods


Method clone()

The objects of this class are cloneable with this method.

Usage
rebuild_projection$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


Recruit Model

Description

Recruitment Model Description

Active bindings

model_num

Model number

model_group

Group type of Recruitment Model

model_name

Name of Recruitment Model

projected_years

Time Series of Projected Years

length_projected_years

Length of projected_years counted as the the number of recruitment observations for some models.

Methods

Public methods


Method new()

Creates a new instance of this class

Usage
recruit_model$new()

Method clone()

The objects of this class are cloneable with this method.

Usage
recruit_model$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


AGEPRO Recruitment Parameter

Description

Recruitment is the primary stochastic element in the AGEPRO model (Brodziak, 2022). AGEPRO handles 21 Recruitment stochastic recruitment models for projections. Please refer to the AGEPRO reference Manual for more detail on these models.

Active bindings

recruit_scaling_factor

The multiplier to convert recruitment submodel's recruitment units to absolute numbers of fish

ssb_scaling_factor

The multiplier to convert recruitment submodel's SSB to absolute spawning weight of fish in kilograms (kg)

max_recruit_obs

Recruitment submodel's maximum number of observations

recruit_model_num_list

Helper Function To View Recruitment Model Collection Data

number_recruit_models

Returns number of recruitment models

recruit_probability

The Recruitment Probabilities.

recruit_data

List containing data for each recruitment model in the recruitment model collection list. Use this field to access a specific recruitment models field.

json_list_object

List of RECRUIT keyword fields values, exportable to JSON.

keyword_name

AGEPRO keyword parameter name

inp_keyword

Returns AGEPRO input-file formatted Parameter

valid_recruit_models

Returns vector of valid Recruitment Model Numbers

Methods

Public methods


Method new()

Initializes the Recruitment Class

Usage
recruitment$new(
  model_num,
  seq_years,
  num_recruit_models = 1,
  recruit_scaling_factor = 1000,
  ssb_scaling_factor = 1,
  max_recruit_obs = 10000,
  enable_cat_print = TRUE
)
Arguments
model_num


AGEPRO Recruitment Model Number

seq_years


Array representing the Projection Time Horizon

num_recruit_models

Number of Recruitment Models in AGEPRO model. Default is 1.

recruit_scaling_factor

Recruit model's multiplier to convert units to absolute numbers of fish.

ssb_scaling_factor

Recruit model's multiplier to convert SSB to absolute spawning weight of fish in kilograms (kg)

max_recruit_obs

Max limit of recruitment observations. Default is 10000.

enable_cat_print

Flag to print out cat based cli messages printed on console. Default is TRUE.


Method print()

Prints out Recruitment

Usage
recruitment$print(enable_cat_print = TRUE, ...)
Arguments
enable_cat_print

Flag to allow cat based cli messages printed on console. Default is TRUE

...

further arguments passed to or from other methods


Method read_inp_lines()

Reads in Recruitment AGEPRO parameters from AGEPRO INP Input File

Usage
recruitment$read_inp_lines(
  inp_con,
  nline,
  seq_years = 1,
  num_recruit_models = 1
)
Arguments
inp_con

Open file connection to AGEPRO Input File.

nline


Location of the current line number being read when the file connection to the AGEPRO input file is open.

seq_years


Array representing the Projection Time Horizon

num_recruit_models

Number of Recruitment Models. Default is 1


Method get_inp_lines()

Returns the values for the RECRUIT keyword parameter formatted to the AGEPRO input file format.

Usage
recruitment$get_inp_lines(delimiter = " ")
Arguments
delimiter

Character string delimiter separating values of AGEPRO input file line.


Method clone()

The objects of this class are cloneable with this method.

Usage
recruitment$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


Values to output optional agepro model's reference point threshold report.

Description

Class Structure that defines biomass thresholds for spawaning biomass (BS, THRESHOLD)(B_{S,\ THRESHOLD}), mean biomass (BˉS, THRESHOLD)(\bar B_{S,\ THRESHOLD}), and total stock biomass(BT, THRESHOLD)(B_{T,\ THRESHOLD}), including the threshold rate for fishing mortality (FTHRESHOLD)(F_{THRESHOLD}).

The logical flag enable_reference_points allows the user to set values to this class fields. The flag will also notify agepro_model if this keyword parameter is allowed to be written to input file.

If this class is initialized with default values, it is presumed that this keyword parameter is not used in the agepro_model. Therefore, enable_reference_points is flagged as FALSE. Valid non-default values will set this flag to TRUE.

Details

The reference_points class (REFPOINTS) is recognized as a keyword parameter used in the AGEPRO input file format, but it is optional.

Active bindings

ssb_threshold

Threshold of spawning biomass

stock_biomass_threshold

Threshold of total stock biomass

mean_biomass_threshold

Threshold for mean biomass

fishing_mortality_threshold

Threshold for the fishing mortality rate for annual total fishing mortality calculated across all fleets.

json_list_object

Returns JSON list object of containing REFPOINT values

enable_reference_points

Logical field that flags if fields can be edited. This class will not accept new values to its fields or allow it to be exported to input file until this option flag is TRUE.

keyword_name

AGEPRO keyword parameter name

inp_keyword

Returns AGEPRO input-file formatted Parameter

Methods

Public methods


Method new()

Initializes the class

Usage
reference_points$new(
  ssb_threshold = 0,
  stockbio_threshold = 0,
  meanbio_threshold = 0,
  fmort_threshold = 0,
  refpoint_flag = NULL
)
Arguments
ssb_threshold

Spawning Biomass threshold express in biomass output units (MT).

stockbio_threshold

Stock biomass threshold expressed in biomass output units(MT).

meanbio_threshold

Mean biomass threshold expressed in biomass output units (MT)

fmort_threshold

Fishing mortality threshold

refpoint_flag

R6class containing option flags to allow reference points to be used


Method print()

Formatted to print out reference_points values

Usage
reference_points$print()

Method read_inp_lines()

Reads in the values from the keyword parameter REFPOINT from the AGEPRO Input file

Note: enable_reference_points must be set to TRUE.

Usage
reference_points$read_inp_lines(inp_con, nline)
Arguments
inp_con

Open file connection to AGEPRO Input File.

nline


Location of the current line number being read when the file connection to the AGEPRO input file is open.


Method get_inp_lines()

Returns values from the class to the REFOPINTS AGEPRO keyword parameter formatted as AGEPRO input file lines.

Usage
reference_points$get_inp_lines(delimiter = " ")
Arguments
delimiter

Character string delimiter separating values of AGEPRO input file line.


Method clone()

The objects of this class are cloneable with this method.

Usage
reference_points$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


Vector of retrospective bias-correction coefficients to adjust to the initial population of numbers of age.

Description

This is the vector of age-specific numbers at age multipliers for an initial population size at age vector if retrospective bias adjustment is applied.

The logical flag enable_retrospective_adjustments allows the user to set values to this class fields. The flag will also notify agepro_model if this keyword parameter is allowed to be written to input file.

If this class is initialized with default values, it is presumed that this keyword parameter is not used in the agepro_model. Therefore, enable_retrospective_adjustments is flagged as FALSE. Valid non-default values will set this flag to TRUE.

Details

The retrospective_adjustments class (RETROADJUST) is recognized as a keyword parameter used in the AGEPRO input file format, but it is optional.

Active bindings

retro_adjust

This is the vector of age-specific numbers at age multipliers for an initial population size at age vector if retrospective bias adjustment is applied.

enable_retrospective_adjustments

Logical field that flags if fields can be edited. This class will not accept new values to its fields or allow it to be exported to input file until this option flag is TRUE.

json_list_object

Returns JSON list object of containing SCALE values

keyword_name

AGEPRO keyword parameter name

inp_keyword

Returns AGEPRO input-file formatted Parameter

Methods

Public methods


Method new()

Initializes the class

Usage
retrospective_adjustments$new(
  retro_adjust,
  enable_cat_print = TRUE,
  retro_flag = NULL
)
Arguments
retro_adjust

Vector for retrospective bias adjustment

enable_cat_print

Logical flag to show target function's cli cat_print messages to be seen on console.

enable_cat_print

Logical flag to show target function's cli cat_print messages to be seen on console.

retro_flag

R6class containing option flags to allow retrospective adjustments to be used


Method print()

Formatted to print out retrospective_adjustments values

Usage
retrospective_adjustments$print(enable_cat_print = TRUE, ...)
Arguments
enable_cat_print

Logical flag to show target function's cli cat_print messages to be seen on console.

enable_cat_print

Logical flag to show target function's cli cat_print messages to be seen on console.

...

further arguments passed to or from other methods


Method read_inp_lines()

Reads in the values from the keyword parameter RETROADJUST from the AGEPRO Input file

Note: enable_retrospective_adjustments must be set to TRUE.

Usage
retrospective_adjustments$read_inp_lines(inp_con, nline, num_ages)
Arguments
inp_con

Open file connection to AGEPRO Input File.

nline


Location of the current line number being read when the file connection to the AGEPRO input file is open.

num_ages

Model's number of ages derived from general_params num_ages active binding.


Method get_inp_lines()

Returns values from the class to the RETROADJUST AGEPRO keyword parameter formatted as AGEPRO input file lines.

Usage
retrospective_adjustments$get_inp_lines(delimiter = "  ")
Arguments
delimiter

Character string delimiter separating values of AGEPRO input file line.


Method clone()

The objects of this class are cloneable with this method.

Usage
retrospective_adjustments$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


Ricker Curve with Autocorrelated Lognormal Error (Model #11)

Description

Ricker Curve with Autocorrelated Lognormal Error (Model #11)

Ricker Curve with Autocorrelated Lognormal Error (Model #11)

Super classes

ageproR::recruit_model -> ageproR::parametric_curve -> ageproR::parametric_autocorrelated_error -> ricker_curve_autocorrelated_error

Methods

Public methods

Inherited methods

Method new()

Initializes the Ricker Curve with Autocorrelated Error Model

Usage
ricker_curve_autocorrelated_error$new(
  alpha = 0,
  beta = 0,
  variance = 0,
  phi = 0,
  log_residual = 0
)
Arguments
alpha


Stock Recruitment Parameter, alpha

beta


Stock Recruitment Parameter, beta

variance


variance

phi


Autocorrelation parameters

log_residual


Log-Scale Residual for the stock recruitment fit in the time prior to the projection


Method clone()

The objects of this class are cloneable with this method.

Usage
ricker_curve_autocorrelated_error$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


Ricker Curve #/ Lognormal Error (Model #6)

Description

Ricker Curve #/ Lognormal Error (Model #6)

Ricker Curve #/ Lognormal Error (Model #6)

Super classes

ageproR::recruit_model -> ageproR::parametric_curve -> ricker_curve_model

Methods

Public methods

Inherited methods

Method new()

Initializes the Ricker Curve Model

Usage
ricker_curve_model$new(alpha = 0, beta = 0, variance = 0)
Arguments
alpha


Stock Recruitment Parameter, alpha

beta


Stock Recruitment Parameter, beta

variance


variance


Method clone()

The objects of this class are cloneable with this method.

Usage
ricker_curve_model$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


Scale Factors

Description

Input information on scaling factors for biomass, recruitment, and stock size

The logical flag enable_scaling_factors allows the user to set values to this class active binding fields: biomass_scale, recruitment_scale, and stock_size_scale. The flag will also notify agepro_model that this keyword parameter is allowed to be written to input file.

If this class is initialized with default values, it is presumed that this keyword parameter is not used in the agepro_model. Therefore, enable_scaling_factors is flagged as FALSE. Valid non-default values will set this flag to TRUE.

Details

The scaling_factors class (or SCALE) is recognized as a keyword parameter used in the AGEPRO input file format, but it is optional.

Active bindings

biomass_scale

Output units of biomass expressed in thousand metric tons

recruitment_scale

Output units of recruitment numbers

stock_size_scale

Output Units of stock size numbers

enable_scaling_factors

Logical field that flags if fields can be edited. This class will not accept new values to its fields or allow it to be exported to input file until this option flag is TRUE.

json_list_object

Returns JSON list object of containing SCALE values

keyword_name

AGEPRO keyword parameter name

inp_keyword

Returns AGEPRO input-file formatted Parameter

Methods

Public methods


Method new()

Initializes the class

Usage
scaling_factors$new(
  scale_bio = 0,
  scale_recruit = 0,
  scale_stock_size = 0,
  scale_flag = NULL
)
Arguments
scale_bio

Output units of biomass express in thousand metric units

scale_recruit

Output Units of Recruitment Numbers

scale_stock_size

Output Units of Stock Size Numbers

scale_flag

R6class containing option flags to allow scaling factors to be used


Method print()

Formatted to print out scaling_factors values

Usage
scaling_factors$print()

Method read_inp_lines()

Reads in the values from the keyword parameter SCALE from the AGEPRO Input file

Note: enable_scaling_factors must be set to TRUE.

Usage
scaling_factors$read_inp_lines(inp_con, nline)
Arguments
inp_con

Open file connection to AGEPRO Input File.

nline


Location of the current line number being read when the file connection to the AGEPRO input file is open.


Method get_inp_lines()

Returns values from the class to the SCALE AGEPRO keyword parameter formatted as AGEPRO input file lines.

Usage
scaling_factors$get_inp_lines(delimiter = " ")
Arguments
delimiter

Character string delimiter separating values of AGEPRO input file line.


Method clone()

The objects of this class are cloneable with this method.

Usage
scaling_factors$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


Shepherd Curve with Autocorrelated Lognormal Error (Model #12)

Description

Shepherd Curve with Autocorrelated Lognormal Error (Model #12)

Shepherd Curve with Autocorrelated Lognormal Error (Model #12)

Super classes

ageproR::recruit_model -> ageproR::parametric_curve -> ageproR::parametric_autocorrelated_error -> shepherd_curve_autocorrelated_error

Active bindings

kpar

Sets the Autocorrelated parametric Curve Parameter, phi. Returns the current value if no argument was passed.

json_recruit_data

Returns JSON-ready Recruit Model Data

Methods

Public methods

Inherited methods

Method new()

Initializes the Shepherd Autocorrelated Curve Model

Usage
shepherd_curve_autocorrelated_error$new(
  alpha = 0,
  beta = 0,
  kpar = 0,
  variance = 0,
  phi = 0,
  log_residual = 0
)
Arguments
alpha


Stock Recruitment Parameter, alpha

beta


Stock Recruitment Parameter, beta

kpar

kpar

variance


variance

phi


Autocorrelation parameters

log_residual


Log-Scale Residual for the stock recruitment fit in the time prior to the projection


Method print()

Prints out Parametric Autocorrelated Curve Data

Usage
shepherd_curve_autocorrelated_error$print(...)
Arguments
...

further arguments passed to or from other methods


Method read_inp_lines()

Reads Parametric Autocorreled Curve model data from AGEPRO Input file

Usage
shepherd_curve_autocorrelated_error$read_inp_lines(inp_con, nline)
Arguments
inp_con

Open file connection to AGEPRO Input File.

nline


Location of the current line number being read when the file connection to the AGEPRO input file is open.


Method clone()

The objects of this class are cloneable with this method.

Usage
shepherd_curve_autocorrelated_error$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


Shepherd Curve with Lognormal Error (Model #7)

Description

Shepherd Curve with Lognormal Error (Model #7)

Shepherd Curve with Lognormal Error (Model #7)

Super classes

ageproR::recruit_model -> ageproR::parametric_curve -> shepherd_curve_model

Active bindings

kpar


Sets the Parametric Curve Parameter, k. Returns the current value if no argument was passed

json_recruit_data

Returns JSON-ready Recruit Model Data

Methods

Public methods


Method new()

Initializes the Shepherd Curve Model

Usage
shepherd_curve_model$new(alpha = 0.1, beta = 0.1, kpar = 0.1, variance = 0.1)
Arguments
alpha


Stock Recruitment Parameter, alpha

beta


Stock Recruitment Parameter, beta

kpar

kpar

variance


variance


Method print()

Prints out Parametric Curve Data

Usage
shepherd_curve_model$print(...)
Arguments
...

further arguments passed to or from other methods


Method read_inp_lines()

Reads Parametric Curve model data from AGEPRO Input file

Usage
shepherd_curve_model$read_inp_lines(inp_con, nline)
Arguments
inp_con

Open file connection to AGEPRO Input File.

nline


Location of the current line number being read when the file connection to the AGEPRO input file is open.


Method inp_lines_recruit_data()

Exports RECRUIT submodel data for shepherd curve recruitment to AGEPRO input file lines.

Usage
shepherd_curve_model$inp_lines_recruit_data(delimiter = " ")
Arguments
delimiter

Character string delimiter separating values of AGEPRO input file line.


Method clone()

The objects of this class are cloneable with this method.

Usage
shepherd_curve_model$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


Spawning stock weight at Age

Description

AGEPRO keyword parameter class Structure for this population process with multiplicative lognormal error distribution.

Super class

ageproR::process_error -> spawning_stock_weight_age

Methods

Public methods

Inherited methods

Method new()

Initializes class

Usage
spawning_stock_weight_age$new(
  proj_years,
  num_ages,
  input_option = 0,
  time_varying = TRUE,
  enable_cat_print = TRUE
)
Arguments
proj_years

Projection years: Input can be Sequence of years in from first to last year of projection or the number of years in the time projection.

num_ages

Number of Age classes

input_option

Option to indicate this parameter will be:

  • 0 By default, done interactively via interface.

  • 1 Imported via location of an existing data file.

time_varying

Logical flag that enables the stochastic parameter to use as a time-varying array if TRUE (or 1). Otherwise, FALSE the vector will cover "all years" of the projection. Default is TRUE.

enable_cat_print

Logical flag to show target function's cli cat_print messages to be seen on console.


Method clone()

The objects of this class are cloneable with this method.

Usage
spawning_stock_weight_age$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


Standard Projection Analyses

Description

Class Structure containing Standard Projection Analyses

Super class

ageproR::projection_analyses -> standard_projection

Methods

Public methods


Method new()

Initializes class

Usage
standard_projection$new(proj_years)
Arguments
proj_years

May be a single numeric value: the number of years in the time projection; a vector of sequential values: Sequence of years in from first to last year of the time projection; or an instance of Projection years


Method clone()

The objects of this class are cloneable with this method.

Usage
standard_projection$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


Two-Stage Empirical Cumulative Distribution Function of Recruitment (Recruit #15)

Description

Two-Stage Empirical Cumulative Distribution Function of Recruitment (Recruit #15)

Two-Stage Empirical Cumulative Distribution Function of Recruitment (Recruit #15)

Super classes

ageproR::recruit_model -> ageproR::empirical_recruit -> ageproR::two_stage_empirical_recruit -> two_stage_empirical_cdf

Active bindings

json_recruit_data

gets JSON-ready Recruit Model Data

Methods

Public methods

Inherited methods

Method new()

Initialize the Empirical CDF Model

Usage
two_stage_empirical_cdf$new(low_recruits = 2, high_recruits = 2)
Arguments
low_recruits


The number of low recruits per spawning stock biomass data points.

high_recruits


The number of high recruits per spawning stock biomass data points.


Method clone()

The objects of this class are cloneable with this method.

Usage
two_stage_empirical_cdf$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


Two-Stage Empirical Recruitment Base

Description

Two-Stage Empirical Recruitment Base

Two-Stage Empirical Recruitment Base

Super classes

ageproR::recruit_model -> ageproR::empirical_recruit -> two_stage_empirical_recruit

Active bindings

num_low_recruits

Number of Low State Recruitments

num_high_recruits

Number of high State Recruitments

ssb_cutoff

Cutoff level of spawning Biomass

low_recruitment

Vector of Low State Recruitments per Spawning Biomass

high_recruitment

Vector of High State Recruitments per Spawning Biomass

json_recruit_data

gets JSON-ready Recruit Model Data

Methods

Public methods

Inherited methods

Method new()

Initialize the Empirical CDF Model

Usage
two_stage_empirical_recruit$new(
  low_recruits = 1,
  high_recruits = 1,
  with_ssb = FALSE
)
Arguments
low_recruits


The number of low recruits per spawning stock biomass data points.

high_recruits


The number of high recruits per spawning stock biomass data points.

with_ssb

flag to include Spawning Stock Biomass in Observations


Method new_recruitment_matrix()

Creates a recruitment matrix

Usage
two_stage_empirical_recruit$new_recruitment_matrix(recruit_points)
Arguments
recruit_points

Number of Empirical Observation Records


Method read_inp_lines()

Reads the two State Empirical model data from AGEPRO Input file

Usage
two_stage_empirical_recruit$read_inp_lines(inp_con, nline)
Arguments
inp_con

Open file connection to AGEPRO Input File.

nline


Location of the current line number being read when the file connection to the AGEPRO input file is open.


Method inp_lines_recruit_data()

Exports RECRUIT submodel data for two-stage empirical recruitment types to AGEPRO input file lines.

Usage
two_stage_empirical_recruit$inp_lines_recruit_data(delimiter = " ")
Arguments
delimiter

Character string delimiter separating values of AGEPRO input file line.


Method print()

Prints out Recruitment Model

Usage
two_stage_empirical_recruit$print(...)
Arguments
...

further arguments passed to or from other methods


Method clone()

The objects of this class are cloneable with this method.

Usage
two_stage_empirical_recruit$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


Two-Stage Empirical Recruits Per Spawning Biomass Distribution (Model #4)

Description

Two-Stage Empirical Recruits Per Spawning Biomass Distribution (Model #4)

Two-Stage Empirical Recruits Per Spawning Biomass Distribution (Model #4)

Super classes

ageproR::recruit_model -> ageproR::empirical_recruit -> ageproR::two_stage_empirical_recruit -> two_stage_empirical_ssb

Active bindings

json_recruit_data

gets JSON-ready Recruit Model Data

Methods

Public methods

Inherited methods

Method new()

Initialize the Empirical CDF Model

Usage
two_stage_empirical_ssb$new(low_recruits = 2, high_recruits = 2)
Arguments
low_recruits


The number of low recruits per spawning stock biomass data points.

high_recruits


The number of high recruits per spawning stock biomass data points.


Method clone()

The objects of this class are cloneable with this method.

Usage
two_stage_empirical_ssb$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


Custom mapping function for error handing

Description

Custom mapping function used for error handling. This is based on the rlang topic errors guide.

Usage

validate_map(.xs, .fn, ...)

Arguments

.xs

List r Atomic Vector

.fn

Function

...

further arguments passed to or from other methods


Validates the usage of the 'projection years' parameter.

Description

If proj_years parameter is a projection_years class, then it will return that value. Otherwise, it will create a new projection_years class based on the param value passed.

Usage

validate_proj_years_parameter(proj_years)

Arguments

proj_years

Projection year parameter. May be a numeric vector or a projection_years