question

Tee Hiett avatar image
0 Likes"
Tee Hiett asked Tee Hiett commented

Why doesn't the Stop Model Based on Condition work in the attached HC model

idbc-triage-room-05-09-17-c.fsm

I have a Stop Model Based on Condition in the PatientExit1 object but the model still runs to the end of simulation time. The condition is:

int condition = /**/getthroughput(model) >= content(var(PatientArrivals1, VAR_ScheduledArrivals)).

It seems the getthroughput side of the equation is working properly.

Thanks,

Tee

FlexSim HC 5.1.0
healthcarecondition
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

Matthew Gillespie avatar image
0 Likes"
Matthew Gillespie answered Tee Hiett commented

This is because at the time you're checking (in the On Entry trigger of the Exit) the patient leaving the model is still in the model. That means getthroughput(model) will be one less than it will be as soon as this code fires and then the patient actually leaves the model. So when the last (41st) patient enters the Exit, this code fires and you end up checking:

  1. if(40 >= 41)
  2. finishreplication();

So this condition is never satisfied, even on the last patient, so it runs the full time. You could change the condition to:

  1. int condition = /**/getthroughput(model) + 1 >= content(var(PatientArrivals1, VAR_ScheduledArrivals))
· 3
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.