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

to(stop_time, dist)

Arguments

stop_time
the time at which to stop the generator.
dist
a function modelling the interarrival times.

Value

Returns a generator function.

See also

add_generator.

Examples

t0 <- trajectory() %>% timeout(0) env <- simmer(verbose=TRUE) %>% add_generator("dummy", t0, to(5, function() runif(1, 1, 2))) %>% run(10)
#> 0 | generator: dummy | new: dummy0 | 1.46119 #> 1.46119 | generator: dummy | new: dummy1 | 2.77643 #> 1.46119 | arrival: dummy0 | activity: Timeout | 0 #> 2.77643 | generator: dummy | new: dummy2 | 3.9511 #> 2.77643 | arrival: dummy1 | activity: Timeout | 0 #> 3.9511 | arrival: dummy2 | activity: Timeout | 0