Closed
Description
From ?seize
:
preemptible: if the seize occurs in a preemptive resource, this parameter
establishes the minimum incoming priority that can preempt this
arrival (a seize with a priority equal topreemptible
or more
gains the resource; by default, any seize may cause preemption
in a preemptive resource).
In which case I would expect the first block of code below to have the same result as the second. Have I misunderstood? I would prefer the documented behaviour, since it allows implementation of LIFO servers without needing to assign priorities.
t0 <- create_trajectory() %>%
seize("dummy", 1, priority = 0, preemptible = 0) %>%
timeout(10) %>%
release("dummy", 1)
env <- simmer() %>%
add_generator("p0p0:", t0, at(0, 1)) %>%
add_resource("dummy", 1, preemptive=TRUE, preempt_order="lifo") %>%
run()
arrs <- env %>% get_mon_arrivals()
arrs_ordered <- arrs[order(arrs$name),]
arrs_ordered
#> name start_time end_time activity_time finished replication
#> 1 p0p0:0 0 10 10 TRUE 1
#> 2 p0p0:1 1 20 10 TRUE 1
t0 <- create_trajectory() %>%
seize("dummy", 1, priority = 1, preemptible = 0) %>%
timeout(10) %>%
release("dummy", 1)
env <- simmer() %>%
add_generator("p1p0:", t0, at(0, 1)) %>%
add_resource("dummy", 1, preemptive=TRUE, preempt_order="lifo") %>%
run()
arrs <- env %>% get_mon_arrivals()
arrs_ordered <- arrs[order(arrs$name),]
arrs_ordered
#> name start_time end_time activity_time finished replication
#> 2 p1p0:0 0 20 10 TRUE 1
#> 1 p1p0:1 1 11 10 TRUE 1
Just nitpicking really -- this is a marvellous package.