Jump to content
Simio Forum

Welcome to the Simio Forum

Welcome to the Simio Forum! Experience the full experience of the forum by becoming a Simio Insider! You must be an Insider to post on any forum!

Click_Here_button.png

New Software Release

Our latest release, Simio 11, is here!

ablanke

Resource KEEP RESERVED IF Condition

Recommended Posts

Hey guys, have a question that someone can hopefully help me out with. Or maybe a variety of solutions can be offered.


Im trying to use the "Keep reserved if" control for secondary resources. As its something I have never worked with before, Im not sure how to exactly reference what I want my condition to be. An example is below.


Entity completes processing with ResourceA. If reservations are turned off, ResourceA checks its allocation queue for the next entity that is calling it. Currently, I have ResourceA selection rule as choosing the entity with the highest priority. Assume Entity1 (priority 10) just released ResourceA and ResourceA's allocation queue contains Entity2 (priority 7), Entity3 (priority 6), and Entity4 (priority 3). Normally, Resource A would be seized by Entity2. However, Entity1 still has a priority 10. I can use the KEEP RESERVED IF statement so that when Entity1 continues processing, ResourceA will be reserved by Entity1. Additionally, I could have that reservation time-out in case Entity1 is unable to seize capacity of the next server or any similar situation.


A problem I am having is that after Entity1 processes, its priority may drop to Priority5, which makes Entity2 the next that should seize the resource. Using the KEEP RESERVED IF condition then gets me into a pickle. When Entity1 moves to the next server and is able to begin processing, the reservation keeps ResourceA for Entity1 even though Entity2 should get it. Likewise, the situation could be reversed where I have reservations turned off, and the entity releasing the resource could have a priority jump that should send it to the top of the allocation queue list.


What kind of CONDITIONAL "Keep reserved if" statement can I use to say "Keep reserved if (the releasing entity) has a higher priority than any other entity in ResourceA's allocation queue"?


Many thanks for the suggestions.

Share this post


Link to post
Share on other sites

Try the Keep Reserve If expression: Math.If(ResourceA.AllocationQueue.NumberWaiting>0,ModelEntity.Priority>=ResourceA.AllocationQueue.FirstItem.ModelEntity.Priority,1). This is assuming Resource A's Ranking Rule is Largest Value for Entity.Priority and the priority of the waiting Entities do not change after they enter the queue. Then the first entity in the allocation queue has the highest priority of the waiting entities. If the current entity has a higher priority than the first in queue it results in 1, but if it's lower priority then it results in 0. If no entities in allocation queue, it results in 1. 1 means the entity reserves the resource , 0 means it doesn't. This condition is checked when the Resource is released, so change the Entity's priority before that (like AfterProcessing Assign or Addon process).

Share this post


Link to post
Share on other sites

×
×
  • Create New...