Announcements

Community notifications may experience intermittent interruptions between 10–12 November during scheduled maintenance. We appreciate your patience.

how to query current staytime

how to query current staytime

niphon_jeepjua
Explorer Explorer
71 Views
2 Replies
Message 1 of 3

how to query current staytime

niphon_jeepjua
Explorer
Explorer

[ FlexSim 20.1.2 ]

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.

32514-1599839601012.png

--> 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

0 Likes
Accepted solutions (1)
72 Views
2 Replies
Replies (2)
Message 2 of 3

JordanLJohnson
Autodesk
Autodesk
Accepted solution

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.

.


Jordan Johnson
Principal Software Engineer
>

0 Likes
Message 3 of 3

niphon_jeepjua
Explorer
Explorer

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

0 Likes