question

Santi avatar image
0 Likes"
Santi asked Santi commented

Track XY of patients and staff at a time interval

Is there a way to create a statistics collector that collects the XY coordinates of each patient, doctor and nurse in a healthcare simulation, at a given time interval?

For instance every 10 seconds. For an 8-hour simulation, that would be less than 3000 rows of data per person. That's a very manageable size of data for me to analyze.

I already know the number of patients that will be created throughout the span of the simulation.
Ideally, the statistics collector would include a column for each person, which contains the XY coordinates as a string. But it could also be structured differently.

How would I go about defining such a statistics collector?
I don't know how to query the X and Y coordinate values of an agent, nor how to capture the data at given time intervals.

FlexSim 23.2.3
coordinates
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

·
Regan Blackett avatar image
0 Likes"
Regan Blackett answered Santi commented

I think you will actually need two stats collectors for this, one for the Staff and one for the Patients.

The Staff one is a little easier to set up. from the '+' menu on a Statistics Collector Event tab, choose "Create an Enumerate Event (on reset)". Click the images to enlarge the settings.

1706656043156.png

In the Objects pane to the right choose your "Staff" group (or any other group if you only care about the position for certain staff rather than all Staff).

On the Columns tab, I'd create three columns, one for the staff name, one for the X-Axis and Y-Axis locations.

1706656128859.png

Configure the Staff name column as shown in the image.

1706656209427.png

Set the X-Axis Column as shown above, the Y-axis column will be the same except for the expression for the value will be data.rowValue.location.y.

When you run with the table shown you should see the X and Y coordinates update in real-time, you don't have to do it on an interval of time if you don't really need to.

The Collector to do the same thing for the Patients is a little trickier. Create a new Collector and choose "Listen to objects by requirement."

1706656522188.png

Set the options on the tab like this. For the "Event" menu you will need to use the Sampler to grab the On Person Created event from a Create Person Activity. The Requirement, Condition and Row Value will have to be typed in by you.

On the Columns tab, I would again make three columns; PID X-Axis and Y-Axis. The PID column is a column that the other Collectors have to help cross reference between different stats, not required but good for consistency with the built in Collectors. Configure as Below.

1706656884039.png

The X Axis and Y Axis Columns are the same here as the Staff Collector.


1706656043156.png (68.7 KiB)
1706656128859.png (64.7 KiB)
1706656209427.png (60.8 KiB)
1706656522188.png (79.0 KiB)
1706656884039.png (68.1 KiB)
· 4
5 |100000

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

Santi avatar image Santi commented ·
Many thankls Regan!

I'll try this out.

0 Likes 0 ·
Santi avatar image Santi commented ·

Hi Regan,

I created the statistics collector for the staff, as you described.

I do need to collect the coordinates at a given time interval, to record the history of the locations for each staff member.

I looked at the StaffHistoryCollecter. Is this how I should set that up?
I'm not sure I understand the set up, but I'll give it a try.
If you could provide any guidance, that would be most appreciated.

Santi

0 Likes 0 ·
Regan Blackett avatar image Regan Blackett ♦ Santi commented ·

For a history of locations while the model ran you'd actually have to set it up a little differently than my original suggestion.

In a fresh stats collector add a "Timer Event", with your first event time (likely time zero or the beginning of the model) and your repeat interval (in terms of your model's time unit). In the Row Value specify your staff member or group of staff whose coordinates you want to track:

1706823662781.png

Your columns you'd set like before. I added a Time Stamp column here in case you want to know what time the people were at those coordinates. the other big difference is these column values are updated by the timer event:

1706823827632.png

1706823840915.png

2024-02-01-14-47-55.png2024-02-01-14-49-44.png

0 Likes 0 ·
Santi avatar image Santi Regan Blackett ♦ commented ·
Many thanks again @Regan Blackett
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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