library(magrittr)
ling_imm <- g3_stock(c(species = 'ling', 'imm'), seq(20, 156, 4)) %>% g3s_age(3, 10)
ling_mat <- g3_stock(c(species = 'ling', 'mat'), seq(20, 156, 4)) %>% g3s_age(5, 15)
igfs <- g3_fleet('igfs')
igfs_landings <-
structure(expand.grid(year=1990:1994, step=2, area=1, total_weight=1),
area_group = list(`1` = 1))
# Generate a fleet predation action, use g3_timeareadata to supply landings
# NB: Since igfs_landings only contains values for step=2, there will be no
# predation on other steps (since g3_timeareadata will return 0).
predate_action <- g3a_predate_fleet(
igfs,
list(ling_imm, ling_mat),
suitabilities = list(
ling_imm = g3_suitability_exponentiall50(
g3_parameterized('lln.alpha', by_stock = 'species'),
g3_parameterized('lln.l50', by_stock = 'species')),
ling_mat = g3_suitability_exponentiall50(
g3_parameterized('lln.alpha', by_stock = 'species'),
g3_parameterized('lln.l50', by_stock = 'species'))),
catchability = g3a_predate_catchability_totalfleet(
g3_timeareadata('igfs_landings', igfs_landings)))
Run the code above in your browser using DataLab