Learn R Programming

simmer (version 3.2.1.9000)

add_resource: Add a resource

Description

Adds a resource to a simulation environment.

Usage

add_resource(env, name, capacity = 1, queue_size = Inf, mon = TRUE,
  preemptive = FALSE, preempt_order = "fifo")

Arguments

env

the simulation environment.

name

the name of the resource.

capacity

the capacity of the server.

queue_size

the size of the queue.

mon

whether the simulator must monitor this resource or not.

preemptive

whether arrivals in the server can be preempted or not based on seize priorities.

preempt_order

if the resource is preemptive and preemption occurs with more than one arrival in the server, this parameter defines which arrival should be preempted first. It must be `fifo` (First In First Out: older preemptible tasks are preempted first) or `lifo` (Last In First Out: newer preemptible tasks are preempted first).

Value

Returns the simulation environment.

See Also

Convenience functions: schedule. Other methods for dealing with a simulation environment: simmer, reset, now, peek, onestep, run, add_generator, get_mon_arrivals, get_mon_attributes, get_mon_resources, get_n_generated, get_capacity, get_queue_size, get_server_count, get_queue_count.