This function updates a stock renewal ("recruitment") parameters, but only if the stock is set to renew (i.e., doesrenew is set to 1 in the model). The function accepts a similar input format as the original gadget renewal file. Note that only 2 modes of renewal (Normal Parametric and Numerical Distribution) that are supported for now.

updateRenewal(
  stockName,
  year,
  step,
  area,
  age,
  number,
  mean = NA,
  sdev = NA,
  alpha = NA,
  beta = NA,
  length = NA,
  meanWeight = NA
)

Arguments

stockName

a string of the stock name

year

the target year of renewal

step

the target step of renewal

area

the target area of renewal

age

the age target of the stock

number

the number parameter value

mean

the mean parameter value (Normal Parametric Distribution only), Default: NA

sdev

the sdev parameter value (Normal Parametric Distribution only), Default: NA

alpha

the alpha parameter value (Normal Parametric Distribution only), Default: NA

beta

the beta parameter value (Normal Parametric Distribution only), Default: NA

length

the mean parameter value (Numerical Distribution only), Default: NA

meanWeight

the weight parameter value (Numerical Distribution only), Default: NA

Value

a vector of numeric error codes (0 is success, otherwise is error)

Examples

if (FALSE) { if(interactive()){ exPath <- loadExample() initGadget(exPath, "refinputfile") updateRenewal("had", 1978, 1, 1, 1, 123456, mean=16.41, sdev=2.25, alpha=8.85e-6, beta=3.0257) stat <- runStep(stockAfterStep = TRUE) print(sum(stat$stocks$had$rec$renew[, "renewalNumber"])) endGadget() } }