-
-
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
reset() does not restore initial sources and trajectories #324
Labels
Comments
Enchufa2
changed the title
a generator stopped using set_source() does not get re-started in subsequent runs despite a reset()
reset() does not restore initial sources and trajectories
Sep 26, 2024
Here's a test case: library(simmer)
t0 <- trajectory() %>%
timeout(1)
t1 <- trajectory() %>%
set_source("gen", at(10)) %>%
set_trajectory("gen", t0)
env <- simmer() %>%
add_generator("gen", t1, at(0)) %>%
run()
df1 <- get_mon_arrivals(env)
env %>%
reset() %>%
run()
df2 <- get_mon_arrivals(env)
testthat::expect_equal(df1, df2) |
Great job !
Thank you !
Le ven. 27 sept. 2024 à 12:49, Iñaki Ucar ***@***.***> a
écrit :
… Closed #324 <#324> as completed
via bf93de6
<bf93de6>
.
—
Reply to this email directly, view it on GitHub
<#324 (comment)>, or
unsubscribe
<https:/notifications/unsubscribe-auth/AH4BFCJZEJ6YANIFOCXVHS3ZYUZ3LAVCNFSM6AAAAABO47ITUGVHI2DSMVQWIX3LMV45UABCJFZXG5LFIV3GK3TUJZXXI2LGNFRWC5DJN5XDWMJUGQZDSMRVGU4DAMI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In the following simulation, when the generator "Gen" is stopped using set_source, it remains permanently stopped in subsequent runs despite the simulation being resetted using reset() function.
Whereas it is re-started when using the function deactivate to stop the generator.
WITH set_source()
2 Gen0 0.0 100.0 100 TRUE 1
3 Gen1 1.0 101.0 100 TRUE 1
1 Stopper0 1.5 1.5 0 TRUE 1
4 Gen2 2.0 102.0 100 TRUE 1
1 Stopper0 1.5 1.5 0 TRUE 1
WITH deactivate()
2 Gen0 0.0 100.0 100 TRUE 1
3 Gen1 1.0 101.0 100 TRUE 1
1 Stopper0 1.5 1.5 0 TRUE 1
2 Gen0 0.0 100.0 100 TRUE 1
3 Gen1 1.0 101.0 100 TRUE 1
1 Stopper0 1.5 1.5 0 TRUE 1
The text was updated successfully, but these errors were encountered: