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

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

jgolob
Not applicable
28 Views
4 Replies
Message 1 of 5

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

jgolob
Not applicable

[ FlexSim 25.0.0 ]

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

0 Likes
Accepted solutions (1)
29 Views
4 Replies
Replies (4)
Message 2 of 5

moehlmann_fe
Observer
Observer
Accepted solution

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

0 Likes
Message 3 of 5

jgolob
Not applicable

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
Message 4 of 5

moehlmann_fe
Observer
Observer

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
Message 5 of 5

jgolob
Not applicable

Thank you so much! Working well!

0 Likes