question

Hemanth Sai Kumar avatar image
0 Likes"
Hemanth Sai Kumar asked Hemanth Sai Kumar answered

Operators Busy Count Time Plot

Hi Flesim Community,

I have a use case where I need to get the count of times the Operator is busy/occupied. I tried using a tracked variable updating on every task start, but I can't see the plot variable being updated. Can anyone help me with this or suggest an alternative option?

Thank you in advance for your time.

Below I am attaching my example model.

OperatorBusyCount.fsm

FlexSim 24.0.2
trackedvariableoperatorsbusystate
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

The issue in your code is how you update the global variable.

The "++" operator will increment a variable by one but the returned value is the old one. So your expression "OperatorBusy_Count = OperatorBusy_Count++" always sets the variable to 0. If you only use "OperatorBusy_Count++" or "OperatorBusy_Count += 1" your logic will work.

However, be aware that counting each indiviual task might overinflate the number. For example, transporting an item from one object to the next typically consists of 5 tasks: Move to item container, load item, break (allowing to interrupt this task sequence to load more items), move to destination and unload item.

So for what you might see as one task, moving the item, the tracked variable will get incremented five times.

Another possible approach might be to increment the TR whenever the operator changes from the "idle" state to a different one.

Or when the operator receives a new task sequence.

5 |100000

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

Hemanth Sai Kumar avatar image
0 Likes"
Hemanth Sai Kumar answered

Hi Felix,
Thanks for prompt reply and the briefing the solution.

5 |100000

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