Learn R Programming

⚠️There's a newer version (4.4.7) of this package.Take me there.

simmer

by Bart Smeets (bartsmeets86@gmail.com), Iñaki Ucar (i.ucar86@gmail.com)

simmer is a Discrete-Event Simulation (DES) package for the R language designed to be a generic framework like SimPy or SimJulia. Although R alone is definitely not made for DES, we use Rcpp to boost the performance of simmer. This faces us with an important trade-off between flexibility and performance, depending on how much code remains in R or goes to C++ respectively.

Our implementation solves this problem by introducing the concept of trajectory: a common path in the simulation model for arrivals of the same type. As we will see, it is pretty flexible and simple to use, and leverages the chaining/piping workflow introduced by the magrittr package. In terms of performance, simmer is faster than SimPy when it comes to simulating queue networks.

Installation

The installation from GitHub requires the devtools package.

devtools::install_github("Bart6114/simmer")

Please note that the package contains some C++ code and you thus need a development environment to build the package (e.g. Rtools for Windows). If you don't want to build the package yourself and you're on Windows you could try a pre-built binary package here.

Learning simmer

To get started, please read the intro vignette:

vignette("introduction", package = "simmer")

Roadmap

  • Refine queue discipline (add priorities).
  • Time-specific resource availability.

Contact

For bugs and/or issues, create a new issue on GitHub. For other questions or comments, do not hesitate to contact us by email.

Copy Link

Version

Install

install.packages('simmer')

Monthly Downloads

1,403

Version

3.0.0

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Iaki Ucar

Last Published

September 28th, 2024

Functions in simmer (3.0.0)

get_n_activities

Get the number of activities
get_mon_resources

Get resource statistics
get_next_activity

Get the next activity
create_trajectory

Create a trajectory
get_queue_count

Get the queue count
peek

Peek the next event's time
get_server_count

Get the server count
plot_resource_usage

Plot usage of a resource over time
get_head

Get the first activity
get_queue_size

Get the queue size
reset

Reset a simulator
add_generator

Add a generator
seize

Add a seize activity
show_trajectory

Show a trajectory
simmer

Create a simulator
add_resource

Add a resource
branch

Add a branch activity
get_tail

Get the last activity
plot_resource_utilization

Plot utilization of resources
release

Add a release activity
timeout

Add a timeout activity
onestep

Step the simulation
now

Get the current time
show_activity

Show an activity
wrap

Wrap a simulation environment
get_mon_arrivals

Get arrival statistics
plot_evolution_arrival_times

Plot evolution of arrival times
get_capacity

Get the capacity
reexports

Objects exported from other packages
run

Run the simulation