Skip to content
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

Renege-timer error "not previously seized" #268

Closed
thigger opened this issue Oct 21, 2021 · 4 comments
Closed

Renege-timer error "not previously seized" #268

thigger opened this issue Oct 21, 2021 · 4 comments
Labels

Comments

@thigger
Copy link

thigger commented Oct 21, 2021

simmer 4.4.3 on R 4.04 on Windows 64-bit

As mentioned on the list - I've now managed to create a reproducible example (from the bank) which is attached

   39.0866 |      task: Renege-Timer     |          :                  | 
   39.0866 |  resource: BRI pen          |   arrival: Customer13       | DEPART
   39.0866 |  resource: BRI counter      |   arrival: Customer13       | DEPART
   39.0866 |  resource: BRI counter      |   arrival: Customer13       | DEPART
Error: 'Renege-Timer' at 39.09:
 'BRI counter' not previously seized

Like my hospital example, this can be fixed by switching the order of the seize of "counter" and "notepad". I assume it has something to do with the fact we're seizing two counters on occasion.

crashattempt.R.txt

@Enchufa2
Copy link
Member

From the highlighted trace, it looks like an incorrect double dispatch of the departure routine on the counter resource. The second departure should be on the notepad resource instead. This is very useful, thanks, will investigate.

@Enchufa2
Copy link
Member

Enchufa2 commented Oct 21, 2021

Shorter MCVE:

library(simmer)

t <- trajectory() %>%
  renege_in(5) %>%
  seize("res1") %>%
  seize("res2") %>%
  seize("res3") %>%
  wait()

simmer(verbose=TRUE) %>%
  add_resource(paste0("res", 1:3)) %>%
  add_generator("dummy", t, at(0)) %>%
  run()
#>          0 |    source: dummy            |       new: dummy0           | 0
#>          0 |   arrival: dummy0           |  activity: RenegeIn         | 5, 0, 0 paths
#>          0 |   arrival: dummy0           |  activity: Seize            | res1, 1, 0 paths
#>          0 |  resource: res1             |   arrival: dummy0           | SERVE
#>          0 |   arrival: dummy0           |  activity: Seize            | res2, 1, 0 paths
#>          0 |  resource: res2             |   arrival: dummy0           | SERVE
#>          0 |   arrival: dummy0           |  activity: Seize            | res3, 1, 0 paths
#>          0 |  resource: res3             |   arrival: dummy0           | SERVE
#>          0 |   arrival: dummy0           |  activity: Wait             | 
#>          5 |      task: Renege-Timer     |          :                  | 
#>          5 |  resource: res1             |   arrival: dummy0           | DEPART
#>          5 |  resource: res3             |   arrival: dummy0           | DEPART
#>          5 |  resource: res3             |   arrival: dummy0           | DEPART
#> Error: 'Renege-Timer' at 5.00:
#>  'res3' not previously seized

@Enchufa2
Copy link
Member

This was a subtle one. Please, try the current master branch.

@thigger
Copy link
Author

thigger commented Oct 21, 2021

Brilliant, all fixed! Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants