Capture Waiting time using Zone

Capture Waiting time using Zone

lenny_c1
Not applicable
19 Views
7 Replies
Message 1 of 8

Capture Waiting time using Zone

lenny_c1
Not applicable

[ FlexSim 20.1.3 ]

Hi,

I have patients going into 2 different location but entering/leaving the same zone. When I attempt to track the respective waiting time of the tokens, only 1 is shown on the dashboard/statistic collector. It seems like only the data of 1 patient is being captured.

StatsCollection_Zones.fsm

0 Likes
Accepted solutions (1)
20 Views
7 Replies
Replies (7)
Message 2 of 8

eric_m3
Not applicable
Accepted solution

Hi @Lenny C, it looks like this is happening because all of the patients have the same delay of 1s. If you put a distribution into the delay, you'll see all 5 times show up.

statscollection-zones_1.fsm

0 Likes
Message 3 of 8

lenny_c1
Not applicable
Hi @Eric M, I'm having my patients enter in 1 second interval. Although they all have the same amount of delay, shouldn't their data appear in 1 second intervals after one another on the graph of staytime vs time? i.e 5 data points of 10seconds with 1second spacing apart.
0 Likes
Message 4 of 8

eric_m3
Not applicable

The current stats collector you're using only adds a new row when the Staytime value changes. Since it never changes, it only records data once. I added another stats collector and chart for how you might get the staytime for each patient.

statscollection-zones-2.fsm

0 Likes
Message 5 of 8

lenny_c1
Not applicable
Nice! Could you share how you set the new stats collector and chart up? Thank you!
0 Likes
Message 6 of 8

eric_m3
Not applicable

Definitely! I create an Enter and Exit event for the zone because I want to know the amount of time the token is in the zone (or if it was a specific activity, like a delay, you could use that instead). The Row Value will tell the data which row in the collector to update. I decided to use the Person label on the token that way each Person will have a designated row.

Then in the Columns tab, I record the person's name, enter time, exit time, and staytime. The Person and Enter are just added when the row is first created (which would be the same as when the token enters the zone). You'll notice in the bottom I have the Exit Time and Staytime columns being updated by the Exit event. So when the token enters the zone, a row is created in the Stats Collector specific to the Person label on the token and the time is recorded. The stats collector then sees when the token leaves the zone and records the time, then finds the difference between the two.

1628869698679.png

The code in the Event Value of the Staytime column is just treating the collector as a table and subtracting column3 - column2 (Exit - Enter). You can see the Table by going to the General tab and clicking View Table.

The chart is just a time plot in the base chart types section of the library. I connect it to the stats collector and then specify which columns I want to use for the x and y values.

I'll point you to some more information too if you ever want to learn more about how the stats collector works. Links to tutorial, section in the manual, and a helpful article.

0 Likes
Message 7 of 8

Jeanette_Fullmer
Community Manager
Community Manager

Hi @lenny.c, was Eric M's answers helpful? If so, please click the red "Accept" button at the bottom of the one that best answers your question. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always unaccept and comment back to reopen your question.

0 Likes
Message 8 of 8

lenny_c1
Not applicable
Thank you so much for the details!
0 Likes