question

Patrick Zweekhorst avatar image
0 Likes"
Patrick Zweekhorst asked Jordan Johnson answered

Problem in getTotalTimeAt at tracked variable

Hi,

We have found a small bug in the getTotalTimeAt function on the trackedVariable. Attached is a model that shows the problem. When you run the model to the stop time (105) the history of the tracked variable will be:

The time at value 1 is correct, 60. The problem is at the value that the tracked variable currently has (in this case 2). Asking the total time at value 2 returns 55, but it should be 25. Testing different situations seems to show that always the current state returns invalid

Thanks,

Patrick

GetTotalTimeAt.fsm

FlexSim 20.2.0
flexsim 20.2.0tracked variablegettotaltimeat
1597736425875.png (12.3 KiB)
gettotaltimeat.fsm (28.1 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.

1 Answer

Jordan Johnson avatar image
0 Likes"
Jordan Johnson answered

Yes, this does look like a bug. I'll get it on the dev list.

If you need a workaround, try asserting a profile. I'm not quite sure what types you need or are using, so it might not be a good solution for you, but getTotalTimeAt() attempts to get that data from the profile node before summing the history.

5 |100000

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