question

Yunjukuo avatar image
0 Likes"
Yunjukuo asked Fengjun0113 commented

How to set number of operator for each shift by Global Table?

In this case, the operators are divided into day shifts and night shifts. The maximum number of operator in each shift is 5, so there should be a total of 10 operators in day and night shifts. But for the convenience of generating charts, I set 5 operators working for 24 hours in the model.

Day shift working hours: 7:00~19:00

Night shift work hours: 19:00~next day7:00

Each person has a rest time following the TimeTable setting.

I want to use GlobalTable to set the number of operator working in day shift and night shift. How can I do this in FlexSim?

In the table below, each row represents the day of the month, and each column represents which person is on the day shift or night shift. 1 means working, 0 means not working

For example, row "Day 5" column "Day OP_B" is 1 means operatorB must work on the 5th day of this month.

1660407402106.png

https://drive.google.com/file/d/1Mg577vHXRjEMAoagDcksjB-zONzXFCwA/view?usp=sharing

FlexSim 16.1.2
global tableoperatorshift schedule
1660407402106.png (14.2 KiB)
· 3
5 |100000

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

Joerg Vogel avatar image Joerg Vogel commented ·
There exists already a timetable tool wherein you can choose down and uptime. And you can select members connected to this timetable.

PLEASE use this tool! It is always better to follow methods than inventing new one. If you want to replace timetables, then you setup for example a repeating user event, which loops through your table to stop or resume involved operators.

0 Likes 0 ·
Yunjukuo avatar image Yunjukuo Joerg Vogel commented ·

Can you please demonstrate how to use TimeTable to achieve the function of the above situation? The daily rest time of each operator is fixed. The users of this model hope to have a function such as a table that can easily set staff shifts without changing member of TimeTable each time.

Or is there a code function/command to change the members of the TimeTable, so that I can put operator into the TimeTable that Shedule_Down all day according to the GlobalTable setting every shift.

0 Likes 0 ·
Andrew O avatar image Andrew O commented ·

Hi @Yunjukuo, was Felix Möhlmann's answer helpful? If so, please click the "Accept" button at the bottom of their answer. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always unaccept and comment back to reopen your question.

0 Likes 0 ·

1 Answer

Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered Fengjun0113 commented

What you could do is create a time table for each shift, with each operator being a member of both time tables. In the down/resume-function you can then add a condition based on the Shift table that controls if the operator is actually stopped or not.

Because this controls if the down time happens or not, the marked times in the time table are inverted: In the night shift table, the night hours are marked as inactive and vice versa.

The code below determines the correct row by reading the current date and converting the day into a number. To get the column it's probably easiest to just write those onto labels of the operators and read them from there.

1660549108270.png

Only if the shift is marked with a "0" in the table, will the condition evaluate to true and the operator will be stopped. Otherwise nothing happens and the operator remains active.

1660548986237.png

(In the screenshot I use the default "Stop Object" logic. You can also use other logic such as the "Travel To Object, Delay Until Down Time Complete". Just change the option before you edit the code and then enclose everything after the variable definitions (up to line 6) in the condition as seen above)


1660548986237.png (81.0 KiB)
1660549108270.png (5.0 KiB)
· 13
5 |100000

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

Fengjun0113 avatar image Fengjun0113 commented ·

Hi @Felix MöhlmannI tried to take reference of your code. But, According to the situation of this case, I chose "Travel To Delay Until Down Time Complete" instead of "Stop Object". However, I observed two unormal things. First, these two operators will go to "Rest" directly. Some of them should NOT go to "Rest" based on the setting in "Global Table-Shift". Second, for this case I think we should consider operators should work or not ("Global Table-Shift") then dicide these operators going to "Rest"(Time Table). But, your logic just consider operators going to "Rest" when they are in both "Down Time" and not work. Belows is the link of the model.

1661006866519.png

https://drive.google.com/file/d/1DKwubrQbJnRgqT4pSH7VATbpiNEhV1AW/view?usp=sharing

0 Likes 0 ·
1661006866519.png (839.3 KiB)
Felix Möhlmann avatar image Felix Möhlmann Fengjun0113 commented ·

When reading the value from the the global table you set the name of the table as "shift" instead of "Shift". Because of this the command always returns 0 since no table with the given name exists. This then causes the down function to execute.

I don't quite understand what you mean by your second point. What you describe is functionally the same as what the time table is doing: At given points in time (when the down time starts) it checks if the operator works or not and sends them to "Rest" in the latter case.

In newer versions of FlexSim you could also do this with only a single time table that contains both shifts. But since in 16.1 the time table only supports increments of 5min, two down shifts that follow directly after each other would be merged into one.

You will always need a timed trigger to check whether the operator should start its down time or not. I believe using the down time of the time tables for this is convenient since all you need to do is to not run the default code depending on the value in the table. For example the time table automatically handles the case of the model starting during a shift, which you would have to account for separately in a custom logic.

If you think handling this logic from the time tables would be better, then you can of course set up a timer in a process flow that checks the value of the respective columns every 12 hours and runs the same code as the down function would, if the operator is supposed to be off shift.

0 Likes 0 ·
Fengjun0113 avatar image Fengjun0113 Felix Möhlmann commented ·

Thanks for your reply


For the first point, I edited "shift" to "Shift", but these operators still go to "Rest".


For seconf point, what I mean is I want operators go to "Rest" in two conditions. There are marked 0 in "Shift" and Down Time in Time Table. consider operators should work or not ("Global Table-Shift") then dicide these operators going to "Rest"(Time Table). But your logic makes operaors go to "Rest" go to "Rest" in only one condition which is marked 0 in "Shift" and Down Time in Time Table happened at the same time.

https://drive.google.com/file/d/1DKwubrQbJnRgqT4pSH7VATbpiNEhV1AW/view?usp=sharing


0 Likes 0 ·
Show more comments