View source: R/generate_trajectories.R
generate_trajectories | R Documentation |
Generate trajectories of birds. A bird trajectory specifies, at each time step, the state of the bird: a site number in 1...S, 0 for flying, -1 for dead and NA for unknown. If partial trajectories (positions of birds are not known until the horizon specified in migration structure) are provided with the argument traj, they are simulated until a time limit defined by the argument end_time.
generate_trajectories(migr, traj = NULL, end_time = migr$horizon)
migr |
A migration structure (attributes site_name, initial_state, flight_duration, death_probability, transition_law_param, sojourn_law_param, sojourn_law_type are used). |
traj |
Partial trajectories, matrix N x (horizon+1) that are going to be extended in time. If NULL, it is initialized from migr structure. |
end_time |
Time until which simulation is required. If NULL, it is initialized with migr horizon. |
A trajectory matrix N x (horizon+1) defining a trajectory for each bird. A trajectory for one bird, specifies at each time step (from 0 to horizon) the state of the bird. Incomplete trajectories finishing with NA are returned if the argument end_time is set a value above migr horizon.
migr <- generate_toy_migration() traj <- generate_trajectories( migr )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.