You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Indeed. We didn't realise that the branch is the only activity without this functionality right now. Thanks for the report. I'll program this feature for the next release.
Feature implemented in the dev-main branch. You can try it out with the following code:
library(simmer)
t1<- create_trajectory("trajectory with a branch") %>%
# Decide whether to branch or not, store in attribute
set_attribute("branch", function() sample(1:2, 1)) %>%
# Branch or not depending on the attribute
branch(function(attrs) attrs[["branch"]], merge=c(T, T),
create_trajectory("branch1") %>%
timeout(function() { print("hi, I'm the first branch"); 0 }),
create_trajectory("branch2") %>%
timeout(function() { print("hi, I'm the second branch"); 0 })
) %>%
rollback(2, 10)
env<- simmer() %>%
add_generator("patient", t1, at(0)) %>%
run()
Activity
Enchufa2 commentedon Mar 7, 2016
Indeed. We didn't realise that the
branchis the only activity without this functionality right now. Thanks for the report. I'll program this feature for the next release.Enchufa2 commentedon Mar 14, 2016
Feature implemented in the
dev-mainbranch. You can try it out with the following code:close #42: provide attrs in branch activity
nacnudus commentedon Mar 15, 2016
Brilliant, thank you. It works for me.