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

Install the release version from CRAN:

install.packages("simmer")

The installation from GitHub requires the devtools package.

devtools::install_github("Bart6114/simmer")

Please note that the package contains some C++ code and thus you need a development environment to build the package (e.g. Rtools for Windows).

Learning simmer

To get started, please read the intro vignette:

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

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,276

Version

3.1.2.9000

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Iaki Ucar

Last Published

September 28th, 2024

Functions in simmer (3.1.2.9000)

get_head

Get the first activity
get_capacity

Get the capacity
add_generator

Add a generator
create_trajectory

Create a trajectory
add_resource

Add a resource
get_mon_arrivals

Get arrival statistics
needs_attrs

Checks if attributes should be supplied
peek

Peek the next event's time
get_n_activities

Get the number of activities
get_n_generated

Get the number of arrivals generated
plot_attributes

Plot evolution of attribute data
from

Generate arrivals starting at a specified time
get_server_count

Get the server count
get_next_activity

Get the next activity
get_mon_attributes

Get attribute statistics
plot_resource_utilization

Plot utilization of resources
print_activity

Print an activity
get_prev_activity

Get the previous activity
at

Arrivals at specific times
show_trajectory

Print a trajectory (deprecated)
set_attribute

Add a set attribute activity
simmer

Create a simulator
get_queue_count

Get the queue count
branch

Add a branch activity
show_activity

Print an activity (deprecated)
run

Run the simulation
get_queue_size

Get the queue size
seize

Add a seize activity
get_mon_resources

Get resource statistics
now

Get the current time
get_tail

Get the last activity
onestep

Step the simulation
reexports

Objects exported from other packages
timeout

Add a timeout activity
release

Add a release activity
wrap

Wrap a simulation environment
plot_evolution_arrival_times

Plot evolution of arrival times
plot_resource_usage

Plot usage of a resource over time
reset

Reset a simulator
rollback

Add a rollback activity