1
votes

I have a not so typical scenario for which I am not sure how to proceed:

  • There are two stations located at two different locations.
  • Both stations require the same resource.
  • The resource moves from station to station once released. So it keeps going from station 1 to station 2 to station 1, etc. until it is seized again. This is modeled by adding a link from the resource process port of the release block. So it is not completely released unless a condition applies. The condition is that there are agents waiting in the queue of the seize block of that same resource. So it should keep moving until it is needed again. The tricky part is that there are two seize blocks for that resource, one for each station. It is possible that agents are ready and waiting in the resource's seize element at both stations. I am adding an image of the resource's process at release. So at "selectOuput4" it checks whether station 1's seize element has agents waiting, if so, the resource is released and can be seized. Otherwise, it moves to station 2 and checks the same but for station 2.

enter image description here

My concern is that there might be a situation where both stations have agents waiting in their respective seize blocks. How can I make sure the resource will be seized by station 1's seize element and not station 2's, and vice versa. Is there a way to control where the resource is going in a case where two seize elements are waiting for it? Or is it always random?

I apologize for the long post, and I hope I managed to deliver my idea properly.

1
Another way to ask the question is as follows: Can seize element behavior be made conditional upon resource location? A potential solution I am thinking of is using a "Wait" block before the seize element. - Emile Zankoul
So the solution would be as follows: Add a queue block followed by a wait block of capacity 1 before each seize element. If the wait block contains 1 agent, thus the condition at "selectOutput4" would be true, so the resource would be released and the wait block before the concerned station would be freed of the agent. This way which seize element is seizing would be controlled. Does this make sense? - Emile Zankoul

1 Answers

1
votes

First, I think your design is a bit weird because you keep the resource always seized.

What I would do is first have a statechart in the resource that controls the resource movement from one place to the next so you have more control over it. The statechart would be used to move your resource ONLY when it's not seized. This will allow a case in which your resource is moving from station 1 to station 2 but something comes to station 1 queue and the resource can immediately react and come back to station 1 before it reaches station 2 (if you think it would be a good idea to do that)

The second is that the seize block defines the priority for a task when the agent arrives to the seize block, and your situation requires changing that priority dynamically, which can't be done as far as I know, so the wait block before the seize block is unfortunately a good option.