question

Joe avatar image
0 Likes"
Joe asked Joe answered

Replace null values of a Milestone Collector with simulation run end time

I was wondering if it is possible to replace 'null' values within a Milestone Collector via it's properties? I am collecting the time an operating room is occupied between 7:20AM and 3PM using milestones in my patient flow. If a patient is still in the operating room at 3PM, I would like the null value to read 3PM for the calculations I do on this milestone collector. Below are the screen shots from my Milestone Collector, its output, and the patient flow.

1740405726620.png

FlexSim 25.0.0
statistic collectormilestone collector
1740405726620.png (156.9 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.

Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered Felix Möhlmann edited

You could write code into a user event (or use other means to have it execute just before the stop time) that loops through the table and replaces any null values with the current model datetime.

fill-in-stats-collector-example.fsm

(Note that rows and columns are 0-indexed when accessing the table through the bundle commands.)


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

Joe avatar image Joe commented ·

Hi Felix. Thank you for the response. When I added the user event I am seeing some interesting results. If I put in 600 as the 'First Time Event' I do not get any of the nulls filled in. If I change it to 559.99 most of the nulls are completed but not with the 3PM end time it replaces them with 2:19PM. Also the last null is not replaced. Is there an error in my code?

1740485057662.png

1740485264060.png

0 Likes 0 ·
1740485057662.png (128.7 KiB)
1740485264060.png (117.4 KiB)
Felix Möhlmann avatar image Felix Möhlmann Joe commented ·

In the first case, the event only fires after the stop. In my model I actually used 3599.999 because of this, but the interface rounds this to 3600.

So you had the right idea. But I guess you were thinking in the hh:mm format when choosing the other value by accident (5:59 != 559). That is also why the last row is not filled in. It was created after the event fired. And .99 represents 59.4 seconds which will get rounded to 59 in the code.

If you use 599.999 it should work. Again the interface will display 600 but the original value is still there. If you want, you can increase the number of decimals displayed in the Model Settings.

capture1.png

0 Likes 0 ·
capture1.png (3.5 KiB)
Joe avatar image
0 Likes"
Joe answered

Thank you so much! Working well!

5 |100000

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