simmer (version 4.0.0)

simmer: Create a Simulator

Description

This method initialises a simulation environment.

Usage

simmer(name = "anonymous", verbose = FALSE, mon = monitor_mem(),
  log_level = 0)

Arguments

name

the name of the simulator.

verbose

enable showing activity information.

mon

monitor (in memory by default); see monitor for other options.

log_level

debugging level (see log_).

Value

Returns a simulation environment.

See Also

Available methods by category:

Examples

Run this code
# NOT RUN {
## a simple trajectory that prints a message
t0 <- trajectory("my trajectory") %>%
  log_("arrival generated")

## create an empty simulation environment
env <- simmer("SuperDuperSim")
env

## add a generator and attach it to the trajectory above
env %>% add_generator("dummy", t0, function() 1)

## run for some time
env %>% run(until=4.5)
env %>% now()           # current simulation time
env %>% peek()          # time for the next event
env %>% stepn()         # execute next event

# }

Run the code above in your browser using DataLab