默认情况下是这样。要获取此信息,只需get_mon_arrivals
使用参数调用per_resource=TRUE
。快速示例:
library(simmer)
patient_traj <- trajectory(name = "patient_trajectory") %>%
select(resources = c("doctor1", "doctor2", "doctor3"), policy = "round-robin") %>%
set_capacity_selected(1) %>%
seize_selected(amount = 1) %>%
timeout(5) %>%
release_selected(amount = 1)
simmer() %>%
add_resource("doctor1") %>%
add_resource("doctor2") %>%
add_resource("doctor3") %>%
add_generator("patient", patient_traj, at(0, 1, 2, 3)) %>%
run() %>%
get_mon_arrivals(per_resource = TRUE)
#> name start_time end_time activity_time resource replication
#> 1 patient0 0 5 5 doctor1 1
#> 2 patient1 1 6 5 doctor2 1
#> 3 patient2 2 7 5 doctor3 1
#> 4 patient3 3 10 5 doctor1 1