0

I want to halt patients (agents) from seizing treatment rooms (resource) from two resource pools until one of the pools has one room available. This because once the patient has seized from one pool, it will be blocked to evaluate seizure from the other. I've tried to use "recalculateResourceChoiceConditions()" to fix this problem.

Now, I tried using a Hold block which in my head should work perfectly as long as the blocking condition is "(TreatmentRooms.idle() + TreatmentRooms1.idle()) == 0 ". This, however, yields a logical error saying that the agent cannot leave the previous block. Is there another block I can use to emulate the wanted logic, or is there something I can do with the Hold block to circumvent this error?

Picture of the flow chart and showing the error message

Gaute
  • 49
  • 7

1 Answers1

1

You need a queue ahead of the hold block. "Hold" does not come with its own queue.

Benjamin
  • 10,603
  • 3
  • 16
  • 28
  • Thanks for the suggestion. Doing this revealed the underlying problem: The Hold block will not open even though the 'Blocking condition' don't hold anymore. It seems that I have to do something more in order to get it open.. – Gaute Aug 17 '20 at 17:04
  • 1
    Well, Benjamin that did the trick! All I had to do was to set up a cyclic event with hold.recalculateConditions(). Now, my model seems to work, all because of all the help you have given me. Thank you so much! – Gaute Aug 17 '20 at 17:14