Add tag-release to a g3 model

g3a_predate_tagrelease(
       fleet_stock, prey_stocks, suitabilities, catchability_f,
       output_tag_f, mortality_f = 0, run_f = ~TRUE,
       run_at = g3_action_order$predate, ...)

g3a_tag_shedding(stocks, tagshed_f, run_f = ~TRUE,
       run_at = g3_action_order$straying)

Arguments

fleet_stock

Tagging fleet, see g3a_predate_fleet

prey_stocks

Stocks fleet harvests, see g3a_predate_fleet

suitabilities

See g3a_predate_fleet

catchability_f

See g3a_predate_fleet

output_tag_f

formula specifying which numeric tag (see g3s_tag) stock will be released into. Implemented with a g3_timeareadata table, e.g.

mortality_f

formula generated by one of the g3_suitability_* functions, describing the proportion of tagged stock that will die during tagging.

stocks

Stocks that will shed tags

tagshed_f

formula for proportion that will shed tags at this point

run_f

formula specifying a condition for running this action, default always runs.

run_at

Integer order that spawning actions will be run within model, see g3_action_order.

...

Any further options for g3a_predate_fleet

Value

g3a_predate_tagrelease

An action (i.e. list of formula objects) that will...

  1. Harvest as-per g3a_predate_fleet

  2. Use mortality_f to apply tagging mortality to harvested stock

  3. Use output_tag_f to decide what tag should be applied to harvested stock

  4. Put harvested stock back into general circulation

g3a_tag_shedding

An action (i.e. list of formula objects) that will...

  1. For each stock, move the proportion tagshed_f back to the "untagged" tag

Examples


tags <- c('H1-00', 'H1-01')
tags <- structure(seq_along(tags), names = tags)

prey_a <- g3_stock('prey_a', seq(1, 10)) %>% g3s_tag(tags)
fleet_a <- g3_fleet('fleet_a')

actions <- list(
    # NB: If g3_tag() is used in the stock, initialconditions/renewal
    # will only renew into tag == 0 (i.e. untagged)
    g3a_predate_tagrelease(
        # Setup as-per g3a_predate_fleet
        fleet_a,
        list(prey_a),
        suitabilities = list(prey_a = 1),
        catchability_f = g3a_predate_catchability_numberfleet(~100),
        
        # Optional tag mortality suitability
        mortality_f = g3_suitability_straightline(
            g3_parameterized('mort_alpha'),
            g3_parameterized('mort_beta')),

        # Formula to decide which tag to output into, generate table
        # with one tag per year
        output_tag_f = g3_timeareadata('fleet_a_tags', data.frame(
            year = 2000:2001,
            tag = tags[c('H1-00', 'H1-01')],
            stringsAsFactors = FALSE), value_field = "tag"),

        # Experiment only happens in spring
        run_f = ~cur_step == 2),

    g3a_tag_shedding(
        list(prey_a),
        # i.e. 0.125 will loose their tag each step
        tagshed_f = log(8)))