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) simmer() %>% add_generator("dummy", t0, to(5, function() runif(1, 1, 2))) %>% run(10) %>% get_mon_arrivals()
#> name start_time end_time activity_time finished replication #> 1 dummy0 1.065216 1.065216 0 TRUE 1 #> 2 dummy1 2.419423 2.419423 0 TRUE 1 #> 3 dummy2 4.244622 4.244622 0 TRUE 1