Modify baseline model inputs based on a set of actions

load_scenario(
  scenario,
  habitat_inputs,
  species = c("fr", "wr", "sr", "st", "lfr"),
  spawn_decay_rate = DSMscenario::spawn_decay_rate,
  rear_decay_rate = DSMscenario::rear_decay_rate,
  stochastic = TRUE
)

Arguments

scenario

a list containing scenario information, see details below

habitat_inputs

a list with spawning habitat, inchannel fry and juvenile rearing habitat, floodplain rearing habitat, and weeks flooded matrices from the lifecycle model "params" data object. See the example for more details.

species

provide "fr", "lfr", "wr", "sr", or "st" for fall run, late-fall run, winter run, spring run, or steelhead respectively to designate which params data object to be modified. For example, supply "fr" if running the fallRunDSM::fall_run_model.

spawn_decay_rate

length 31 vector of 1 - spawning decay rate estimates

rear_decay_rate

length 31 vector of 1 - rearing decay rate estimates

stochastic

boolean, TRUE for creating scenarios with stochasticity

Details

A scenario is a list of 31 by 20 matrices with each value representing the units of effort to apply in a tributarty in a given year for a action type.

The scenario list should be formatted like this:

list(spawn = matrix(), inchannel = matrix(), floodplain = matrix(), survival = matrix())

A scenario can also include a boolean vector named no_decay if the user desires to exclude a watershed from spawning and rearing habitat decay.

Examples

scenario_df <- dplyr::tibble(watershed = "Lower Sacramento River",
                      action = 3,
                      start_year = 1980,
                      end_year = 1999,
                      units_of_effort = 1)
no_decay_alt <- watershed_labels %in% c("Clear Creek", "Butte Creek", "Upper Sacramento River")
names(no_decay_alt) <- watershed_labels
custom_scenario <- get_action_matrices(scenario_df)
custom_scenario$no_decay <- no_decay_alt

habitats <- list(
  spawning_habitat = fallRunDSM::params$spawning_habitat,
  inchannel_habitat_fry = fallRunDSM::params$inchannel_habitat_fry,
  inchannel_habitat_juvenile = fallRunDSM::params$inchannel_habitat_juvenile,
  floodplain_habitat = fallRunDSM::params$floodplain_habitat,
  weeks_flooded = fallRunDSM::params$weeks_flooded
)

scenario_custom <- load_scenario(scenario = custom_scenario,
                                 species = DSMscenario::species$FALL_RUN,
                                 habitat_inputs = habitats)

scenario_one <- load_scenario(scenario = DSMscenario::scenarios$ONE,
                              species = DSMscenario::species$FALL_RUN,
                              habitat_inputs = habitats)