question

Lorenz N avatar image
0 Likes"
Lorenz N asked Jeanette F edited

Flexsim HC 2021 Stop model when last patient or X amount of patients leaves

I want to end the simulation when either the last patient leaves or when x amount of patient leaves the system. (Or any condition in general) Before in older versions of Flexsim HC you had this function in the entry/exit triggers. How is this done in the current version?

Here are some reference links on how it was done previously.

https://answers.flexsim.com/questions/41556/how-can-i-record-time-of-last-patient-exit.html

https://answers.flexsim.com/questions/45251/stop-the-model-when-last-piece-is-out-of-the-syste.html

Attached is a sample model where 14 patients go through the system.

Sample Project.fsm

FlexSim 21.0.6
flexsim healthcareflexsim 21.0.6patientstopmodel
sample-project.fsm (71.7 KiB)
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

Jacob Gillespie avatar image
0 Likes"
Jacob Gillespie answered Jeanette F edited

I edited the sample model so that it stops after 14 patients leave the system. Whenever someone leaves the model, I increment a variable. When the variable reaches 14, an event is triggered which stops the model.

sample-project_Jacob.fsm


· 2
5 |100000

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

Lorenz N avatar image Lorenz N commented ·
Hello, thank you for this very simple example. While not fully savvy, I can kind of understand how it works. I will try this out in my more advanced model and get back to you. As a question, is there a reason why this variable counting looping system you built had to be in the Arrivals Process Flow and not the Patient flow? Is it because you had to use a token tokens and not patient tokens? (I am still not fully informed on both cause I mostly use HC stuff)
0 Likes 0 ·
Jeanette F avatar image Jeanette F ♦♦ Lorenz N commented ·

The arrival process flow is not instanced like the patient flow is. This basically means that for every patient, they technically have their own copy of the patient process flow. To read more about what an instance is please read our manual.

If we were to place the increment in the patient process flow, it would only increment once. While in the arrivals process flow, each patient token has to pass through, so it is incremented correctly.

1 Like 1 ·