-
-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Transfer/share resources and attributes between clones #207
Comments
Hehe, sorry - ignore my comment in #206 - great minds think alike! |
It might also be interesting to set some kind of clone index. |
@thigger The following may be of interest to you. Discussing a similar issue, I've come up with an alternative, more general way of dealing with this kind of situation: library(simmer)
t <- trajectory() %>%
seize("room") %>%
clone(
n = 3,
trajectory("controller") %>%
trap("clone end"),
trajectory("doctor") %>%
timeout(1) %>%
send("clone end"),
trajectory("nurse") %>%
timeout(2) %>%
send("clone end")) %>%
synchronize(wait = FALSE) %>%
wait() %>%
wait() %>%
timeout(0.5) %>%
release("room")
simmer() %>%
add_resource("room") %>%
add_generator("visit", t, at(0)) %>%
run() Particularly, in the case I was discussing, two units were seized at the beginning (one per clone), and then they were released one by one after each |
Currently, each cloned arrival is a separate entity that is reponsible for its own seized resources and attributes (which, e.g., makes parallel tasks a bit tricky). Some mechanism to transfer or share this responsibility may be interesting.
The text was updated successfully, but these errors were encountered: