1
votes

I am building a simulation model for a production line. There are two shifts (morning and night shift, 12 hours each) daily. Within each shift, the workers are split into 4 groups and each group goes for meal breaks at a staggered timing (eg. 4 workers in morning shift, first worker goes for break at 9am, second goes at 10am, etc.). These workers will also take ad-hoc breaks at random occurrences during their shift.

Not sure which method would work:

  1. Creating an individual schedule within the agent and let it change states according to the schedule?
  2. Use a common schedule for the entire resource pool, but will it be possible to pick which agent goes for break at the break time? Or will the agent be picked at random? Caus my concern is that i'll need the agents to take breaks but at staggered intervals.

Or should I generate this in a different approach?

1
Hi, welcome to SOF. Typically, you get the best results here if you avoid open "how do I do x" questions and rephrase into "I want to achieve x and already tried y and z". See some guidance here benjamin-schumann.com/blog/2021/4/1/… and here stackoverflow.com/help/how-to-ask .Benjamin

1 Answers

0
votes

Good question!

On option 2) If you use the resource pool you will not be able to choose a specific agent as shifts and breaks are created for the entire pool.

What you can do is to define the capacity of the resource pool using, multiple schedules

enter image description here

enter image description here

This can help you artificially define the staggered. nature of the break-taking for resources.

Refer to the help for more details - https://anylogic.help/library-reference-guides/process-modeling-library/resourcepool.html

I believe this answers your question already but here are my notes on the other option.

Option 1) If you require more advanced flexibility and control over the breaks and you do have the required Java skills (and time!) you can create custom code that controls when to send agents on a break and when to to return. You can use StateCharts inside your agents to build this logic. But then this will not be compatible with the resource pool since the resource pool will be oblivious to the state of the agents inside the pool and it will seize units that are taking a break...

So in this case your size delay and release will also be custom.

This is a lot of work and should only be attempted if you have the time, skills and require a level of flexibility and customization not offered by the resource pool.