-
Notifications
You must be signed in to change notification settings - Fork 1
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
Select/seize, select/release multiple resources #17
Comments
Can you provide a small example that illustrates the problem and that we can work on to see alternatives, please? |
Sure. In essence, what I want to do is include in Here is what I want to be able to do:
The trajectory fails with Here is my workaround with the trajectory:
When using this trajectory, I get the desired result as can be seen when I print
It's manageable for this small example, but in practice this gets very complicated to manage. |
The thing is that every resource has its own queue. So this depends on whether you want several doctors with a single queue or whether each doctor must have their own queue. If you want the former (one resource; several servers, single queue), then tracking which server was assigned is not possible right now because:
If you want the latter (several resources; several servers, several queues), seizing several different resources from a single activity would be problematic. Activities are the unit of action. When you call So from the description of what you want to achieve, I think that your second example (or some variation) is definitely the way to go. It gets complicated, yes. But then a generalisation of this pattern could be encapsulated into a brick (see https://github.com/r-simmer/simmer.bricks) to make it more manageable. |
In other words, we could create activities that do many things (even to the point to encapsulate whole simulation models), but we try to keep things simple. I'm willing to complicate the design to add some functionality if it's not achievable in any way. If there's some pattern of existing activities that solves the problem, then |
Thanks @Enchufa2 I figured as much. I may try and abstract the problem into a brick as you suggested - I've already done so to some extent but in my current use case it's already started to get a bit unwieldy. |
Issue transferred then. :) |
I renamed the issue to better reflect what I'd like to accomplish. |
Related: https://groups.google.com/g/simmer-devel/c/7M52Ivj4p6g/m/luFL71bWAgAJ. We definitely could write down this pattern in a brick. |
I've been using simmer for a few months and love it. There's one consistent challenge I encounter though and it has to do with monitoring individual resource entities within a group.
Let's say you're simulating a hospital with 3 doctors and you want to track the activity of each doctor individually. I know it's possible to provide a vector of names to
add_resource
. But this creates some challenges. Sometimes I want to allow an arrival to take one or more of a resource type (in this example, take one or more doctors depending on some attribute). In this case, I can't simply useselect
andseize_selected
, I now have torollback
and select/seize again as needed. It'd be much easier if I could useseize("doctor", amount = \() get_attribute(env, "num_to_seize"))
while still being able to know exactly which doctors were seized inget_mon_arrivals
/get_mon_resources
using some kind of id.I've usually been able to create work-arounds for this using rollbacks over select/seize, but it'd be great if there was an easier way.
Love the package and looking forward to your response!
The text was updated successfully, but these errors were encountered: