-
|
I like the simmer library. A great tool even for not so experienced. I Want to simulate one scenario. We have an outpatient clinic with long waiting times. We have to kind of patients:
I now want to simulate the influence of one counter especially for SV-patients. I have to templates: ... WV have priority = 1 Is there a better way to assign a counter to a special group of patients and if idle give the counter to other patients? Would a new policy: "if-idle" make a difference? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
First-available is what you are looking for, right? library(simmer)
t_fv <- trajectory() |>
select(c("counter2", "counter1"), policy = "first-available") |>
seize_selected() |>
log_(function() paste("Selected: ", get_selected(env))) |>
timeout(10) |>
release_selected()
env <- simmer() |>
add_resource("counter1", 1) |>
add_resource("counter2", 1) |>
add_generator("dummy", t_fv, at(0))
env |>
run() |>
invisible()
#> 0: dummy0: Selected: counter2vs. env <- simmer() |>
add_resource("counter1", 1) |>
add_resource("counter2", 0) |> # no room, but Inf queue
add_generator("dummy", t_fv, at(0))
env |>
run() |>
invisible()
#> 0: dummy0: Selected: counter1 |
Beta Was this translation helpful? Give feedback.
First-available is what you are looking for, right?
vs.