i have a situation where my model runs for one week.Each day have 3 shifts and each shifts have different number of workers every day.worker change every shift and also every day.How can i change the number of workers in the workerpool according to the day and shift??
Solved! Go to Solution.
you can not load worker dynamically during the simulation run. The workerpool will be filled at the start of the simulation according to the creation list of the workepool.
One way to solve your problem is to create each individual worker in the class library and assign to each worker a individual shiftcalendar. Then create all worker in the workerpool. The individual worker will work only in their working times.
Number of workers is not fixed each day every shift.Morning shift today can have less worker then morning shift tommorrow.how can i solve this situation,if i allot the shift to the worker it will be same for each day but it can be different different day .
only an idea. You can set the shiftcalendar dynamically with shiftcalendarObject in the workers. You could create 4 shiftcalendar objects (each only for one shift and one without working time). Create 15 workers in the workerpool. Then you set at the beginning of the shift the right shiftcalendar for the number of workers, all remaining workers get the shiftcalendar without working time...
To detect the shift change I have included in the shiftCalendar object between the shifts one minute unplanned time. Unplanned is observable. The control is in the ShiftCalendar - Tools - Observers. I observe the attribute unplanned, look for the day and the shift und set the shiftcalendar in the workers:
(attribute: string; oldValue: any)
if oldValue=true then
--start of new shift
--set the shiftcalendars
for i:=1 to .resources.worker.numChildren loop
if i<=numWorkers then
To set it for the start of the Simulation, set the start-time of the simulation 2 minutes before the start of a shift:
You can reset the statistics then after two minutes to delete the "warm-up" results.
The unplanned workers have a blue icon.