Learn R Programming

simmer (version 3.5.1)

from: Generate arrivals starting at a specified time

Description

Generator convenience function to generate inter-arrivals with a specified start time.

Usage

from(start_time, dist, arrive = TRUE)

Arguments

start_time
the time at which to launch the initial arrival.
dist
a function modelling the interarrival times.
arrive
if set to TRUE (default) the first arrival will be generated at start_time and will follow dist from then on. If set to FALSE, will initiate dist at start_time (and the first arrival will most likely start at a time later than start_time).

Value

Returns a generator function.

See Also

add_generator.

Examples

Run this code
t0 <- create_trajectory() %>% timeout(0)
env <- simmer(verbose=TRUE) %>%
  add_generator("dummy", t0, from(5, function() runif(1, 1, 2))) %>%
  run(10)

Run the code above in your browser using DataLab