update_state: Updates state of island given sampled event for a constant...

View source: R/update_state.R

update_stateR Documentation

Updates state of island given sampled event for a constant rate case.

Description

Makes the event happen by updating island species matrix and species IDs. What event happens is determined by the sampling in the algorithm.

Usage

update_state(
  timeval,
  total_time,
  possible_event,
  max_spec_id,
  mainland_spec,
  island_tbl
)

Arguments

timeval

Numeric defining current time of simulation.

total_time

Numeric defining the length of the simulation in time units.

possible_event

Numeric defining what event will happen.

max_spec_id

Current species IDs.

mainland_spec

Numeric focal species on the mainland

island_tbl

Data frame with current state of simulation containing number of species, see create_test_island_tbl()

Value

The updated state of the system, which is a list with the island_tbl matrix and an integer max_spec_id with the most recent ID of species.

Author(s)

Joshua W. Lambert


joshwlambert/DAISIEmainland documentation built on July 14, 2024, 5:40 p.m.