simmer (version 4.4.6.3)

timeout: Delay

Description

Activity for inserting delays and execute user-defined tasks.

Usage

timeout(.trj, task, ..., tag)

timeout_from_attribute(.trj, key, ..., tag)

timeout_from_global(.trj, key, ..., tag)

Value

Returns the trajectory object.

Arguments

.trj

the trajectory object.

task

the timeout duration supplied by either passing a numeric or a callable object (a function) which must return a numeric (negative values are automatically coerced to positive).

...

unused.

tag

activity tag name to perform named rollbacks (see rollback) or just to better identify your activities.

key

the attribute name, or a callable object (a function) which must return the attribute name.

See Also

set_attribute, set_global

set_attribute, set_global

Examples

Run this code
env <- simmer()

traj <- trajectory() %>%

  # static delay
  timeout(3) %>%

  # dynamic, exponential delay
  timeout(function() rexp(1, 10)) %>%

  # dependent on an attribute
  set_attribute("delay", 2) %>%
  set_global("other", function() rexp(1, 2)) %>%
  timeout_from_attribute("delay") %>%
  timeout_from_global("other")

env %>%
  add_generator("dummy", traj, at(0)) %>%
  run() %>%
  get_mon_arrivals()

Run the code above in your browser using DataLab