Skip to contents

Calculates the total fishing mortality (in units 1/year) from all gears by species and size and possibly time. See setFishing() for details of how fishing gears are set up.

Usage

getFMort(object, effort, time_range, drop = TRUE, n, n_pp, n_other, t, ...)

Arguments

object

A MizerParams object or a MizerSim object

effort

The effort of each fishing gear. Only used if the object argument is of class MizerParams. See notes below.

time_range

Subset the returned fishing mortalities by time. The time range is either a vector of values, a vector of min and max time, or a single value. Default is the whole time range. Only used if the object argument is of type MizerSim.

drop

Only used when object is of type MizerSim. Should dimensions of length 1 be dropped, e.g. if your community only has one species it might make presentation of results easier. Default is TRUE.

n

A matrix of species abundances (species x size).

n_pp

A vector of the resource abundance by size

n_other

A list of abundances for other dynamical components of the ecosystem

t

The time for which to do the calculation (Not used by standard mizer rate functions but useful for extensions with time-dependent parameters.)

...

Unused

Value

If a MizerParams object is passed in without a time-dimensioned effort, returns an ArraySpeciesBySize object (species x size) with the fishing mortality rates. If the effort argument has a time dimension, or a MizerSim object is passed in, returns a three-dimensional array (time x species x size).

The effort argument is only used if a MizerParams object is passed in. The effort argument can be a two dimensional array (time x gear), a vector of length equal to the number of gears (each gear has a different effort that is constant in time), or a single numeric value (each gear has the same effort that is constant in time). The order of gears in the effort argument must be the same as in the MizerParams object.

If the object argument is of class MizerSim then the effort slot of the MizerSim object is used and the effort argument is not used.

Details

The total fishing mortality is just the sum of the fishing mortalities imposed by each gear, \(F_i(w)=\sum_g F_{g,i,w}\). The fishing mortality for each gear is obtained as catchability x selectivity x effort.

Your own fishing mortality function

By default getFMort() calls mizerFMort(). However you can replace this with your own alternative fishing mortality function. If your function is called "myFMort" then you register it in a MizerParams object params with

params <- setRateFunction(params, "FMort", "myFMort")

Your function will then be called instead of mizerFMort(), with the same arguments.

Examples

# \donttest{
params <- NS_params
# Get the total fishing mortality in the initial state
F <- getFMort(params, effort = 1)
str(F)
#>  'ArraySpeciesBySize' num [1:12, 1:100] 0 0 0 0 0 0 0 0 0 0 ...
#>  - attr(*, "dimnames")=List of 2
#>   ..$ sp: chr [1:12] "Sprat" "Sandeel" "N.pout" "Herring" ...
#>   ..$ w : chr [1:100] "0.001" "0.00119" "0.00142" "0.0017" ...
#>  - attr(*, "value_name")= chr "Fishing mortality"
#>  - attr(*, "units")= chr "1/year"
#>  - attr(*, "params")=Formal class 'MizerParams' [package "mizer"] with 46 slots
#>   .. ..@ metadata               : list()
#>   .. ..@ mizer_version          :Classes 'package_version', 'numeric_version'  hidden list of 1
#>   .. .. ..$ : int [1:4] 2 5 4 9126
#>   .. ..@ extensions             : chr(0) 
#>   .. ..@ time_created           : POSIXct[1:1], format: "2021-09-03 20:29:38"
#>   .. ..@ time_modified          : POSIXct[1:1], format: "2026-05-09 08:16:12"
#>   .. ..@ w                      : num [1:100] 0.001 0.00119 0.00142 0.0017 0.00203 ...
#>   .. ..@ dw                     : num [1:100] 0.000193 0.000231 0.000275 0.000329 0.000392 ...
#>   .. ..@ w_full                 : num [1:226] 2.12e-13 2.53e-13 3.02e-13 3.61e-13 4.30e-13 ...
#>   .. ..@ dw_full                : num [1:226] 4.10e-14 4.90e-14 5.84e-14 6.97e-14 8.32e-14 ...
#>   .. ..@ w_min_idx              : Named num [1:12] 1 1 1 1 1 1 1 1 1 1 ...
#>   .. .. ..- attr(*, "names")= chr [1:12] "Sprat" "Sandeel" "N.pout" "Herring" ...
#>   .. ..@ maturity               : num [1:12, 1:100] 0 0 0 0 0 0 0 0 0 0 ...
#>   .. .. ..- attr(*, "dimnames")=List of 2
#>   .. .. .. ..$ sp: chr [1:12] "Sprat" "Sandeel" "N.pout" "Herring" ...
#>   .. .. .. ..$ w : chr [1:100] "0.001" "0.00119" "0.00142" "0.0017" ...
#>   .. ..@ psi                    : num [1:12, 1:100] 0 0 0 0 0 0 0 0 0 0 ...
#>   .. .. ..- attr(*, "dimnames")=List of 2
#>   .. .. .. ..$ sp: chr [1:12] "Sprat" "Sandeel" "N.pout" "Herring" ...
#>   .. .. .. ..$ w : chr [1:100] "0.001" "0.00119" "0.00142" "0.0017" ...
#>   .. ..@ initial_n              : num [1:12, 1:100] 1.84e+13 6.86e+12 1.44e+14 1.45e+13 1.71e+11 ...
#>   .. .. ..- attr(*, "dimnames")=List of 2
#>   .. .. .. ..$ sp: chr [1:12] "Sprat" "Sandeel" "N.pout" "Herring" ...
#>   .. .. .. ..$ w : chr [1:100] "0.001" "0.00119" "0.00142" "0.0017" ...
#>   .. ..@ intake_max             : num [1:12, 1:100] 0.182 0.275 0.328 0.35 0.307 ...
#>   .. .. ..- attr(*, "dimnames")=List of 2
#>   .. .. .. ..$ sp: chr [1:12] "Sprat" "Sandeel" "N.pout" "Herring" ...
#>   .. .. .. ..$ w : chr [1:100] "0.001" "0.00119" "0.00142" "0.0017" ...
#>   .. ..@ search_vol             : num [1:12, 1:100] 1.27e-13 6.00e-14 3.44e-13 4.49e-14 1.86e-13 ...
#>   .. .. ..- attr(*, "dimnames")=List of 2
#>   .. .. .. ..$ sp: chr [1:12] "Sprat" "Sandeel" "N.pout" "Herring" ...
#>   .. .. .. ..$ w : chr [1:100] "0.001" "0.00119" "0.00142" "0.0017" ...
#>   .. ..@ metab                  : num [1:12, 1:100] 0.0289 0.0437 0.0522 0.0557 0.0487 ...
#>   .. .. ..- attr(*, "dimnames")=List of 2
#>   .. .. .. ..$ sp: chr [1:12] "Sprat" "Sandeel" "N.pout" "Herring" ...
#>   .. .. .. ..$ w : chr [1:100] "0.001" "0.00119" "0.00142" "0.0017" ...
#>   .. ..@ pred_kernel            : logi [1(1d)] NA
#>   .. ..@ ft_pred_kernel_e       : cplx [1:12, 1:226] 11.3+0i 26.9+0i 20.8+0i ...
#>   .. .. ..- attr(*, "dimnames")=List of 2
#>   .. .. .. ..$ sp: chr [1:12] "Sprat" "Sandeel" "N.pout" "Herring" ...
#>   .. .. .. ..$ k : chr [1:226] "1" "2" "3" "4" ...
#>   .. ..@ ft_pred_kernel_p       : cplx [1:12, 1:226] 11.3+0i 26.9+0i 20.8+0i ...
#>   .. .. ..- attr(*, "dimnames")=List of 2
#>   .. .. .. ..$ sp: chr [1:12] "Sprat" "Sandeel" "N.pout" "Herring" ...
#>   .. .. .. ..$ k : chr [1:226] "1" "2" "3" "4" ...
#>   .. ..@ mu_b                   : num [1:12, 1:100] 0.1871 0.1817 0.1293 0.0865 0.0874 ...
#>   .. .. ..- attr(*, "dimnames")=List of 2
#>   .. .. .. ..$ sp: chr [1:12] "Sprat" "Sandeel" "N.pout" "Herring" ...
#>   .. .. .. ..$ w : chr [1:100] "0.001" "0.00119" "0.00142" "0.0017" ...
#>   .. ..@ ext_encounter          : num [1:12, 1:100] 0 0 0 0 0 0 0 0 0 0 ...
#>   .. .. ..- attr(*, "dimnames")=List of 2
#>   .. .. .. ..$ sp: chr [1:12] "Sprat" "Sandeel" "N.pout" "Herring" ...
#>   .. .. .. ..$ w : chr [1:100] "0.001" "0.00119" "0.00142" "0.0017" ...
#>   .. ..@ ext_diffusion          : num [1:12, 1:100] 0 0 0 0 0 0 0 0 0 0 ...
#>   .. .. ..- attr(*, "dimnames")=List of 2
#>   .. .. .. ..$ sp: chr [1:12] "Sprat" "Sandeel" "N.pout" "Herring" ...
#>   .. .. .. ..$ w : chr [1:100] "0.001" "0.00119" "0.00142" "0.0017" ...
#>   .. ..@ rr_pp                  : Named num [1:226] 167660 158066 149021 140494 132455 ...
#>   .. .. ..- attr(*, "names")= chr [1:226] "2.12e-13" "2.53e-13" "3.02e-13" "3.61e-13" ...
#>   .. ..@ cc_pp                  : Named num [1:226] 1.09e+38 7.46e+37 5.11e+37 3.51e+37 2.41e+37 ...
#>   .. .. ..- attr(*, "names")= chr [1:226] "2.12e-13" "2.53e-13" "3.02e-13" "3.61e-13" ...
#>   .. ..@ resource_dynamics      : chr "resource_semichemostat"
#>   .. ..@ resource_params        :List of 5
#>   .. .. ..$ kappa      : num 1e+11
#>   .. .. ..$ lambda     : num 2.13
#>   .. .. ..$ r_pp       : num 10
#>   .. .. ..$ n          : num 0.667
#>   .. .. ..$ w_pp_cutoff: num 9.82
#>   .. ..@ other_dynamics         : list()
#>   .. ..@ other_params           : list()
#>   .. ..@ other_encounter        : list()
#>   .. ..@ other_mort             : list()
#>   .. ..@ rates_funcs            :List of 14
#>   .. .. ..$ Rates          : chr "mizerRates"
#>   .. .. ..$ Encounter      : chr "mizerEncounter"
#>   .. .. ..$ FeedingLevel   : chr "mizerFeedingLevel"
#>   .. .. ..$ EReproAndGrowth: chr "mizerEReproAndGrowth"
#>   .. .. ..$ PredRate       : chr "mizerPredRate"
#>   .. .. ..$ PredMort       : chr "mizerPredMort"
#>   .. .. ..$ FMort          : chr "mizerFMort"
#>   .. .. ..$ Mort           : chr "mizerMort"
#>   .. .. ..$ ERepro         : chr "mizerERepro"
#>   .. .. ..$ EGrowth        : chr "mizerEGrowth"
#>   .. .. ..$ ResourceMort   : chr "mizerResourceMort"
#>   .. .. ..$ RDI            : chr "mizerRDI"
#>   .. .. ..$ RDD            : chr "BevertonHoltRDD"
#>   .. .. ..$ Diffusion      : chr "mizerDiffusion"
#>   .. ..@ sc                     : num [1:100] 0.001 0.00119 0.00142 0.0017 0.00203 ...
#>   .. ..@ initial_n_pp           : Named num [1:226] 1.09e+38 7.46e+37 5.11e+37 3.51e+37 2.41e+37 ...
#>   .. .. ..- attr(*, "names")= chr [1:226] "2.12e-13" "2.53e-13" "3.02e-13" "3.61e-13" ...
#>   .. ..@ initial_n_other        : list()
#>   .. ..@ species_params         :'data.frame':	12 obs. of  34 variables:
#>   .. .. ..$ species             : chr [1:12] "Sprat" "Sandeel" "N.pout" "Herring" ...
#>   .. .. ..$ w_max               : num [1:12] 33 36 100 334 324 ...
#>   .. .. ..$ w_mat               : int [1:12] 13 4 23 99 21 75 78 39 105 165 ...
#>   .. .. ..$ beta                : int [1:12] 51076 398849 22 280540 191 22 381 283 113 558 ...
#>   .. .. ..$ sigma               : num [1:12] 0.8 1.9 1.5 3.2 1.9 1.5 1.9 1.8 1.6 2.1 ...
#>   .. .. ..$ k_vb                : num [1:12] 0.681 1 0.849 0.606 0.536 0.323 0.284 0.266 0.122 0.271 ...
#>   .. .. ..$ gear                : chr [1:12] "Industrial" "Industrial" "Industrial" "Pelagic" ...
#>   .. .. ..$ w_min               : num [1:12] 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 ...
#>   .. .. ..$ alpha               : num [1:12] 0.6 0.6 0.6 0.6 0.6 0.6 0.6 0.6 0.6 0.6 ...
#>   .. .. ..$ pred_kernel_type    : chr [1:12] "lognormal" "lognormal" "lognormal" "lognormal" ...
#>   .. .. ..$ h                   : num [1:12] 18.2 27.5 32.8 35 30.7 ...
#>   .. .. ..$ k                   : num [1:12] 0 0 0 0 0 0 0 0 0 0 ...
#>   .. .. ..$ ks                  : num [1:12] 3.64 5.5 6.57 7.01 6.14 ...
#>   .. .. ..$ z0                  : num [1:12] 0.1871 0.1817 0.1293 0.0865 0.0874 ...
#>   .. .. ..$ gamma               : num [1:12] 3.20e-11 1.51e-11 8.63e-11 1.13e-11 4.67e-11 ...
#>   .. .. ..$ m                   : num [1:12] 1 1 1 1 1 1 1 1 1 1 ...
#>   .. .. ..$ erepro              : num [1:12] 1 1 1 1 1 1 1 1 1 1 ...
#>   .. .. ..$ R_max               : num [1:12] 7.38e+11 4.10e+11 1.05e+13 1.11e+12 1.12e+10 ...
#>   .. .. ..$ sel_func            : chr [1:12] "knife_edge" "knife_edge" "knife_edge" "knife_edge" ...
#>   .. .. ..$ knife_edge_size     : int [1:12] 13 4 23 99 21 75 78 39 105 165 ...
#>   .. .. ..$ catchability        : num [1:12] 1 1 1 1 1 1 1 1 1 1 ...
#>   .. .. ..$ p                   : num [1:12] 0.7 0.7 0.7 0.7 0.7 0.7 0.7 0.7 0.7 0.7 ...
#>   .. .. ..$ q                   : num [1:12] 0.8 0.8 0.8 0.8 0.8 0.8 0.8 0.8 0.8 0.8 ...
#>   .. .. ..$ n                   : num [1:12] 0.667 0.667 0.667 0.667 0.667 ...
#>   .. .. ..$ f0                  : num [1:12] 0.6 0.6 0.6 0.6 0.6 0.6 0.6 0.6 0.6 0.6 ...
#>   .. .. ..$ interaction_resource: num [1:12] 1 1 1 1 1 1 1 1 1 1 ...
#>   .. .. ..$ w_inf               : num [1:12] 33 36 100 334 324 ...
#>   .. .. ..$ w_mat25             : num [1:12] 11.65 3.58 20.61 88.7 18.82 ...
#>   .. .. ..$ w_repro_max         : num [1:12] 33 36 100 334 324 ...
#>   .. .. ..$ is_background       : logi [1:12] FALSE FALSE FALSE FALSE FALSE FALSE ...
#>   .. .. ..$ z_ext               : num [1:12] 0 0 0 0 0 0 0 0 0 0 ...
#>   .. .. ..$ d                   : num [1:12] -0.333 -0.333 -0.333 -0.333 -0.333 ...
#>   .. .. ..$ E_ext               : num [1:12] 0 0 0 0 0 0 0 0 0 0 ...
#>   .. .. ..$ D_ext               : num [1:12] 0 0 0 0 0 0 0 0 0 0 ...
#>   .. ..@ given_species_params   :'data.frame':	12 obs. of  27 variables:
#>   .. .. ..$ species             : chr [1:12] "Sprat" "Sandeel" "N.pout" "Herring" ...
#>   .. .. ..$ w_max               : num [1:12] 33 36 100 334 324 ...
#>   .. .. ..$ w_mat               : int [1:12] 13 4 23 99 21 75 78 39 105 165 ...
#>   .. .. ..$ beta                : int [1:12] 51076 398849 22 280540 191 22 381 283 113 558 ...
#>   .. .. ..$ sigma               : num [1:12] 0.8 1.9 1.5 3.2 1.9 1.5 1.9 1.8 1.6 2.1 ...
#>   .. .. ..$ k_vb                : num [1:12] 0.681 1 0.849 0.606 0.536 0.323 0.284 0.266 0.122 0.271 ...
#>   .. .. ..$ gear                : chr [1:12] "Industrial" "Industrial" "Industrial" "Pelagic" ...
#>   .. .. ..$ w_min               : num [1:12] 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 ...
#>   .. .. ..$ alpha               : num [1:12] 0.6 0.6 0.6 0.6 0.6 0.6 0.6 0.6 0.6 0.6 ...
#>   .. .. ..$ pred_kernel_type    : chr [1:12] "lognormal" "lognormal" "lognormal" "lognormal" ...
#>   .. .. ..$ h                   : num [1:12] 18.2 27.5 32.8 35 30.7 ...
#>   .. .. ..$ k                   : num [1:12] 0 0 0 0 0 0 0 0 0 0 ...
#>   .. .. ..$ ks                  : num [1:12] 3.64 5.5 6.57 7.01 6.14 ...
#>   .. .. ..$ z0                  : num [1:12] 0.1871 0.1817 0.1293 0.0865 0.0874 ...
#>   .. .. ..$ gamma               : num [1:12] 3.20e-11 1.51e-11 8.63e-11 1.13e-11 4.67e-11 ...
#>   .. .. ..$ m                   : num [1:12] 1 1 1 1 1 1 1 1 1 1 ...
#>   .. .. ..$ erepro              : num [1:12] 1 1 1 1 1 1 1 1 1 1 ...
#>   .. .. ..$ R_max               : num [1:12] 7.38e+11 4.10e+11 1.05e+13 1.11e+12 1.12e+10 ...
#>   .. .. ..$ sel_func            : chr [1:12] "knife_edge" "knife_edge" "knife_edge" "knife_edge" ...
#>   .. .. ..$ knife_edge_size     : int [1:12] 13 4 23 99 21 75 78 39 105 165 ...
#>   .. .. ..$ catchability        : num [1:12] 1 1 1 1 1 1 1 1 1 1 ...
#>   .. .. ..$ p                   : num [1:12] 0.7 0.7 0.7 0.7 0.7 0.7 0.7 0.7 0.7 0.7 ...
#>   .. .. ..$ q                   : num [1:12] 0.8 0.8 0.8 0.8 0.8 0.8 0.8 0.8 0.8 0.8 ...
#>   .. .. ..$ n                   : num [1:12] 0.667 0.667 0.667 0.667 0.667 ...
#>   .. .. ..$ f0                  : num [1:12] 0.6 0.6 0.6 0.6 0.6 0.6 0.6 0.6 0.6 0.6 ...
#>   .. .. ..$ interaction_resource: num [1:12] 1 1 1 1 1 1 1 1 1 1 ...
#>   .. .. ..$ w_inf               : num [1:12] 33 36 100 334 324 ...
#>   .. ..@ interaction            : num [1:12, 1:12] 0.7291 0.0341 0.0635 0.2742 0.3624 ...
#>   .. .. ..- attr(*, "dimnames")=List of 2
#>   .. .. .. ..$ predator: chr [1:12] "Sprat" "Sandeel" "N.pout" "Herring" ...
#>   .. .. .. ..$ prey    : chr [1:12] "Sprat" "Sandeel" "N.pout" "Herring" ...
#>   .. ..@ gear_params            :'data.frame':	12 obs. of  5 variables:
#>   .. .. ..$ gear           : chr [1:12] "Industrial" "Industrial" "Industrial" "Pelagic" ...
#>   .. .. ..$ species        : chr [1:12] "Sprat" "Sandeel" "N.pout" "Herring" ...
#>   .. .. ..$ sel_func       : chr [1:12] "knife_edge" "knife_edge" "knife_edge" "knife_edge" ...
#>   .. .. ..$ knife_edge_size: int [1:12] 13 4 23 99 21 75 78 39 105 165 ...
#>   .. .. ..$ catchability   : num [1:12] 1 1 1 1 1 1 1 1 1 1 ...
#>   .. ..@ selectivity            : num [1:4, 1:12, 1:100] 0 0 0 0 0 0 0 0 0 0 ...
#>   .. .. ..- attr(*, "dimnames")=List of 3
#>   .. .. .. ..$ gear: chr [1:4] "Industrial" "Pelagic" "Beam" "Otter"
#>   .. .. .. ..$ sp  : chr [1:12] "Sprat" "Sandeel" "N.pout" "Herring" ...
#>   .. .. .. ..$ w   : chr [1:100] "0.001" "0.00119" "0.00142" "0.0017" ...
#>   .. ..@ catchability           : num [1:4, 1:12] 1 0 0 0 1 0 0 0 1 0 ...
#>   .. .. ..- attr(*, "dimnames")=List of 2
#>   .. .. .. ..$ gear: chr [1:4] "Industrial" "Pelagic" "Beam" "Otter"
#>   .. .. .. ..$ sp  : chr [1:12] "Sprat" "Sandeel" "N.pout" "Herring" ...
#>   .. ..@ initial_effort         : Named num [1:4] 0 1 0.5 0.5
#>   .. .. ..- attr(*, "names")= chr [1:4] "Industrial" "Pelagic" "Beam" "Otter"
#>   .. ..@ A                      : num [1:12] 1 1 1 1 1 1 1 1 1 1 ...
#>   .. ..@ linecolour             : Named chr [1:17] "#815f00" "#6237e2" "#8da600" "#de53ff" ...
#>   .. .. ..- attr(*, "names")= chr [1:17] "Sprat" "Sandeel" "N.pout" "Herring" ...
#>   .. ..@ linetype               : Named chr [1:16] "solid" "solid" "solid" "solid" ...
#>   .. .. ..- attr(*, "names")= chr [1:16] "Sprat" "Sandeel" "N.pout" "Herring" ...
#>   .. ..@ ft_mask                : logi [1:12, 1:226] TRUE TRUE TRUE TRUE TRUE TRUE ...
#>   .. ..@ use_predation_diffusion: logi FALSE
# Get the initial total fishing mortality when effort is different
# between the four gears:
F <- getFMort(params, effort = c(0.5,1,1.5,0.75))
# Get the total fishing mortality when effort is different
# between the four gears and changes with time:
effort <- array(NA, dim = c(20,4))
effort[, 1] <- seq(from = 0, to = 1, length = 20)
effort[, 2] <- seq(from = 1, to = 0.5, length = 20)
effort[, 3] <- seq(from = 1, to = 2, length = 20)
effort[, 4] <- seq(from = 2, to = 1, length = 20)
F <- getFMort(params, effort = effort)
str(F)
#>  num [1:20, 1:12, 1:100] 0 0 0 0 0 0 0 0 0 0 ...
#>  - attr(*, "dimnames")=List of 3
#>   ..$ time: NULL
#>   ..$ sp  : chr [1:12] "Sprat" "Sandeel" "N.pout" "Herring" ...
#>   ..$ w   : chr [1:100] "0.001" "0.00119" "0.00142" "0.0017" ...
# Get the total fishing mortality using the effort already held in a
# MizerSim object.
sim <- project(params, t_max = 20, effort = 0.5)
F <- getFMort(sim)
F <- getFMort(sim, time_range = c(10, 20))
# }