question

Marc R5 avatar image
0 Likes"
Marc R5 asked Felix Möhlmann commented

get the total off shift amount of time

Hello,

I have a simulation that can last multiple weeks with a timetable configured as well.

From the total amount of simulation time, I need to substract the off shift time to know the number of days or hours or minutes producing.

It is a simulation involving multiple processors working in parallel or in series, so I cannot get the info from processors stats or whatever. Besides there is logistics flows within moving items, etc.

I just need to get the total amount of time from start to end of simulation according to timetable.

Thanks.

FlexSim 22.2.2
timetablesoff shift
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

Jacob W2 avatar image
0 Likes"
Jacob W2 answered Felix Möhlmann commented

Hi @Marc R5,

If I understand your question, you are trying to get the total time that your system is being used based on the time tables. For example if your model runs for a day, but only 8 hours of the day are workable hours, you want to be able to see the 16 hours off-shift. In the model I am attaching, I have set up a statistics collector that looks at when the time table tells the model to stop and when it resumes. I then write the start and stop time of each of those events to the table. Once I have that data I am able to use a calculated table to grab the sum of those two columns and then find the total time off-shift.

Total off Shift Amount.fsm


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

Marc R5 avatar image Marc R5 commented ·
Hello Jacob,

Thanks! this seems to work. However, how can I access this value to use it in custom scripts etc?

Thanks you very much.

0 Likes 0 ·
Felix Möhlmann avatar image Felix Möhlmann Marc R5 commented ·

You can read values from a calculated table as you would from a global table.

Table("CalculatedTable1")[row][column]

One possible issue with the method above is that the measured "Off Shift" time will lag behind the actual time while the model is currently in an "Off" phase, because the table only updates when the next active shift starts. So depending on when you access the value it might not always result in the correct "active" time.

Another simple way to get the total active time directly is to add a dummy object to the time table and read its state. This object will only ever be in one of two states: "Idle" and the state that is assigned to the off-shift time. So the "Idle" time directly corresponds to the active time in the model and can be read with

Model.find("DummyObject").as(Object).stats.state().getTotalTimeAt(1)

total-off-shift-amount-fm.fsm

0 Likes 0 ·