natcap.invest.fisheries.fisheries_model¶
The Fisheries Model module contains functions for running the model
Variable Suffix Notation: t: time x: area/region a: age/class s: sex
-
natcap.invest.fisheries.fisheries_model.
initialize_vars
(vars_dict)¶ Initializes variables for model run
- Parameters
vars_dict (dictionary) – verified arguments and variables
- Returns
modified vars_dict with additional variables
- Return type
vars_dict (dictionary)
Example Returns:
vars_dict = { # (original vars) 'Survtotalfrac': np.array([...]), # a,s,x 'G_survtotalfrac': np.array([...]), # (same) 'P_survtotalfrac': np.array([...]), # (same) 'N_tasx': np.array([...]), # Index Order: t,a,s,x 'H_tx': np.array([...]), # t,x 'V_tx': np.array([...]), # t,x 'Spawners_t': np.array([...]), }
-
natcap.invest.fisheries.fisheries_model.
run_population_model
(vars_dict, init_cond_func, cycle_func, harvest_func)¶ Runs the model
- Parameters
vars_dict (dictionary) –
init_cond_func (lambda function) – sets initial conditions
cycle_func (lambda function) – computes numbers for the next time step
harvest_func (lambda function) – computes harvest and valuation
- Returns
vars_dict (dictionary)
Example Returned Dictionary:
{ # (other items) ... 'N_tasx': np.array([...]), # Index Order: time, class, sex, region 'H_tx': np.array([...]), # Index Order: time, region 'V_tx': np.array([...]), # Index Order: time, region 'Spawners_t': np,array([...]), 'equilibrate_timestep': <int>, }
-
natcap.invest.fisheries.fisheries_model.
set_cycle_func
(vars_dict, rec_func)¶ Creates a function to run a single cycle in the model
- Parameters
vars_dict (dictionary) –
rec_func (lambda function) – recruitment function
Example Output of Returned Cycle Function:
N_asx = np.array([...]) spawners = <int> N_next, spawners = cycle_func(N_prev)
-
natcap.invest.fisheries.fisheries_model.
set_harvest_func
(vars_dict)¶ Creates harvest function that calculates the given harvest and valuation of the fisheries population over each time step for a given region. Returns None if harvest isn’t selected by user.
Example Outputs of Returned Harvest Function:
H_x, V_x = harv_func(N_tasx) H_x = np.array([3.0, 4.5, 2.5, ...]) V_x = np.array([6.0, 9.0, 5.0, ...])
-
natcap.invest.fisheries.fisheries_model.
set_init_cond_func
(vars_dict)¶ Creates a function to set the initial conditions of the model
- Parameters
vars_dict (dictionary) – variables
- Returns
initial conditions function
- Return type
init_cond_func (lambda function)
Example Return Array:
N_asx = np.ndarray([...])
-
natcap.invest.fisheries.fisheries_model.
set_recru_func
(vars_dict)¶ Creates recruitment function that calculates the number of recruits for class 0 at time t for each region (currently sex agnostic). Also returns number of spawners
- Parameters
vars_dict (dictionary) –
- Returns
recruitment function
- Return type
rec_func (function)
Example Output of Returned Recruitment Function:
N_next[0], spawners = rec_func(N_prev)