get_SSB {LeMaRns}R Documentation

Calculate Spawning Stock Biomass (SSB) or total biomass

Description

Calculates the Spawning Stock Biomass (SSB) or the total biomass of each species in the model.

Usage

get_SSB(inputs, outputs, ...)

## S4 method for signature 'LeMans_param,LeMans_outputs'
get_SSB(
  inputs,
  outputs,
  species = 1:dim(outputs@N)[2],
  time_steps = 1:dim(outputs@N)[3]
)

## S4 method for signature 'LeMans_param,missing'
get_SSB(inputs, N, species = 1:dim(N)[2], time_steps = 1:dim(N)[3])

## S4 method for signature 'missing,LeMans_outputs'
get_SSB(
  wgt,
  mature,
  outputs,
  species = 1:dim(outputs@N)[2],
  time_steps = 1:dim(outputs@N)[3],
  species_names = NULL
)

## S4 method for signature 'missing,missing'
get_SSB(
  wgt,
  mature,
  N,
  species = 1:dim(N)[2],
  time_steps = 1:dim(N)[3],
  species_names = NULL
)

get_biomass(inputs, outputs, ...)

## S4 method for signature 'LeMans_param,LeMans_outputs'
get_biomass(
  inputs,
  outputs,
  species = 1:dim(outputs@N)[2],
  time_steps = 1:dim(outputs@N)[3]
)

## S4 method for signature 'LeMans_param,missing'
get_biomass(inputs, N, species = 1:dim(N)[2], time_steps = 1:dim(N)[3])

## S4 method for signature 'missing,LeMans_outputs'
get_biomass(
  wgt,
  outputs,
  species = 1:dim(outputs@N)[2],
  time_steps = 1:dim(outputs@N)[3],
  species_names = NULL
)

## S4 method for signature 'missing,missing'
get_biomass(
  wgt,
  N,
  species = 1:dim(N)[2],
  time_steps = 1:dim(N)[3],
  species_names = NULL
)

Arguments

inputs

A LeMans_param object containing the parameter values of the current LeMans model.

outputs

A LeMans_outputs object containing the outputs of the model run.

...

Additional arguments.

species

A numeric value or vector or a character string or vector of the species that you wish to calculate the mean maximum length. The default is 1:dim(N)[2].

time_steps

A numeric vector of the time steps that you wish to calculate the mean maximum length. The default is 1:dim(N)[3].

N

An array with dimensions nsc, nfish and tot_time representing the number of individuals in each length class for each time step.

wgt

A matrix with dimensions nsc and nfish representing the weight of each species in each length class.

mature

A matrix with dimensions ncs and nfish with elements in the range 0-1 representing the proportion of mature individuals of each species in each length class.

species_names

A character vector of length nfish that denotes the names of the species in the model.

Details

The SSB for each species in species is equal to:

colSums(N[, species]*wgt[, species]*mature[, species]).

The biomass for each species in species is equal to:

colSums(N[, species]*wgt[, species])

Value

If length(species)>1, get_SSB returns a matrix with dimensions length(time_steps) by length(species) where the i,jth element is the SSB (g) of the jth species in the ith time_steps. If length(species)==1, the function will return a numeric vector of length length(time_steps).

If length(species)>1, get_biomass returns a matrix with dimensions length(time_steps) by length(species) where the i,jth element is the biomass (g) of the jth species in the ith time_steps. If length(species)==1, the function will return a numeric vector of length length(time_steps).

Examples

# Set up and run the model
NS_params <- LeMansParam(NS_par, tau=NS_tau, eta=rep(0.25, 21), L50=NS_par$Lmat, other=1e12)
effort <- matrix(0.5, 10, dim(NS_params@Qs)[3])
model_run <- run_LeMans(NS_params, years=10, effort=effort)

# Calculate SSB
get_SSB(inputs=NS_params, outputs=model_run)

# Calculate biomass
get_biomass(inputs=NS_params, outputs=model_run)

[Package LeMaRns version 0.1.2 Index]