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

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

t0 <- trajectory() %>% timeout(0) env <- simmer(verbose=TRUE) %>% add_generator("dummy", t0, from(5, function() runif(1, 1, 2))) %>% run(10)
#> 0 | generator: dummy | new: dummy0 | 5 #> 5 | generator: dummy | new: dummy1 | 6.0074 #> 5 | arrival: dummy0 | activity: Timeout | 0 #> 6.0074 | generator: dummy | new: dummy2 | 7.47379 #> 6.0074 | arrival: dummy1 | activity: Timeout | 0 #> 7.47379 | generator: dummy | new: dummy3 | 8.97157 #> 7.47379 | arrival: dummy2 | activity: Timeout | 0 #> 8.97157 | generator: dummy | new: dummy4 | 10.2613 #> 8.97157 | arrival: dummy3 | activity: Timeout | 0