add_resource {simmer} | R Documentation |
Define a new resource in a simulation environment.
add_resource(.env, name, capacity = 1, queue_size = Inf, mon = TRUE, preemptive = FALSE, preempt_order = c("fifo", "lifo"), queue_size_strict = FALSE, queue_priority = c(0, Inf))
.env |
the simulation environment. |
name |
the name of the resource. |
capacity |
the capacity of the server, either a numeric or a
|
queue_size |
the size of the queue, either a numeric or a
|
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 |
queue_size_strict |
if the resource is preemptive and preemption occurs,
this parameter controls whether the |
queue_priority |
the priority range required to be able to access the queue if there is no room in the server (if a single value is provided, it is treated as the minimum priority). By default, all arrivals can be enqueued. |
Returns the simulation environment.
Convenience functions: schedule
.