question

Nip J avatar image
0 Likes"
Nip J asked Nip J commented

how to query current staytime

G´day community,

I hope you can help me out with the following problem, which concerns having a live value of the current stay time of a floor spot:

The dashboard does show the MIN, MAX and AVG value of a floor spot, but only is able to provide the data after a patient has left the floor spot. My idea is to have a value which is automatically updated and can be queried, for example in a table, while the patient is still processing within the floor spot. I tried different approaches: Create Trigger on Entry, User Command (global (in the toolbox), and in patient flow), setting labels and loops in the patient flow, statistic collecors....

Writing a global User Command seems to be my best shot, since here, a while loop is able to be completed ( no freezing): Problem here: Simulation does not run the command, unfortunatelly.

--> My main challange is to continously substract the entering time at the floor spot from the Model.time in a way that this value can be recalled. I´d be helpful for any advice. best regards!

Patient_IN_OUT.fsm

FlexSim 20.1.2
flexsim 20.1.2staytime
1599839601012.png (14.0 KiB)
patient-in-out.fsm (55.6 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

Jordan Johnson avatar image
0 Likes"
Jordan Johnson answered Nip J commented

You can use a Statistics Collector:

patient-in-out_1.fsm

The Statistics Collector in this model listens to when people enter and exit. When they enter, it make a row for that person. Each row in the stats collector can have labels, which can store metadata about that row. In this case, I cache of the entry time in a row label.

The stats collector also has a Staytime column. This column updates whenever you access it, so it appears that it is continuously up to date.

When a person exits the floor spot, I make sure to finish the row. This "freezes" the values that update when the row is accessed.

You can make a chart based on this stats collector. Or you can access it with the Table() API:

Table("FloorSpotStaytime")[1][2]

Either way, when you get the value, it will do the subtraction you want.


· 1
5 |100000

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

Nip J avatar image Nip J commented ·

thanks a lot @jordan.johnson. This is exactly what I was looking for.

0 Likes 0 ·