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) simmer() %>% add_generator("dummy", t0, from(5, function() runif(1, 1, 2))) %>% run(10) %>% get_mon_arrivals()
#> name start_time end_time activity_time finished replication #> 1 dummy0 5.000000 5.000000 0 TRUE 1 #> 2 dummy1 6.174941 6.174941 0 TRUE 1 #> 3 dummy2 7.209182 7.209182 0 TRUE 1 #> 4 dummy3 8.529568 8.529568 0 TRUE 1 #> 5 dummy4 9.931896 9.931896 0 TRUE 1