Skip to content

Clarify the difference between capacity and queue_size #220

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

Closed
mtbakerguy opened this issue Nov 12, 2019 · 3 comments
Closed

Clarify the difference between capacity and queue_size #220

mtbakerguy opened this issue Nov 12, 2019 · 3 comments

Comments

@mtbakerguy
Copy link

When writing a simulation, it's easy to understand what capacity is. If you have four machines, you put four machines in capacity. However, it's less clear from the reference guide or the vignettes how you create a rejected seize request (in my case, this involved turning off queueing entirely). I found it eventually on the mailing list (https://groups.google.com/forum/#!topic/simmer-devel/povKK0WKyf4) but the right snippet of code or more details in the reference guide would've made it easier to understand.

@Enchufa2
Copy link
Member

Did you check the examples under ?seize? One of them demonstrates how to use the reject argument.

@mtbakerguy
Copy link
Author

I did. Perhaps the simplest thing to do would be something like the following in the example:

# set queue_size == 0 to ensure the reject path is taken
# when all capacity's used.
simmer() %>%
  add_resource("doctor", capacity=1, queue_size=0) %>%
  add_resource("nurse", capacity=10, queue_size=0) %>%
  add_generator("patient", traj, at(0, 1)) %>%
  run() %>% invisible

@Enchufa2
Copy link
Member

I'll add some comments in the manual then, maybe also in add_resource.

Note also that turning off the queue is not needed for rejections to occur. In general, it may happen when queue_size is finite. E.g., if capacity=1 and queue_size=2 and 4 arrivals try to seize the resource, 1 is served, 2 wait in the queue and the 4th is rejected.

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

No branches or pull requests

2 participants