simmer: Create a Simulator

Description Usage Arguments Value See Also Examples

View source: R/simmer-methods.R

Description

This method initialises a simulation environment.

Usage

1
2
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## 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

r-simmer/simmer documentation built on Dec. 13, 2018, 1:16 p.m.