View source: R/simulate_graph.R
simulate_graph | R Documentation |
Useful for those interested primarily in generating modular network graphs. Equivalent to using simulate_schedule with the independent simulator and then graph_from_schedule, but also includes a discrete-time approximation that is faster for large networks.
simulate_graph( n_animals, n_groups, time_to_leave, time_to_return, travel_time, sampling_duration, sampler = "discrete", samples_per_day = 1 )
n_animals |
The number of nodes to include in the network. |
n_groups |
The number of modules in the network. |
time_to_leave |
The average days spent within the home group prior to leaving. |
time_to_return |
The average days spent abroad before returning to home group. |
travel_time |
Vector of the range of values that travel to the next group can take, drawn from a uniform distribution. |
sampling_duration |
The number of days to simulate. |
sampler |
Takes one of c("discrete", "continuous"). Whether group composition should be monitored instantaneously (truth), or sampled in discrete time. |
samples_per_day |
Only used in discrete time approximations in simulate_graph. |
sim_igraph, an igraph graph object.
plot_simulated_graph
g <- simulate_graph(n_animals = 10, n_groups = 2, time_to_leave = 5, time_to_return = 2, travel_time = c(0.001,0.2), sampling_duration = 7, sampler = "discrete", samples_per_day = 1 )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.