Originally posted by: Ayan00
Hi Rogerie,
Thanks for your reminding and I was thinking about it.
(1) For the work shift, in my case there are 3 shifts during a day: 6:00-14:00, 14:00-22:00, 22:00-6:00.
There are same skilled and numbers of workers in each shift so I think it can be just regarded as one worker since no any interruption.
I had a look at the example you answered previously:
https://www.ibm.com/developerworks/community/forums/html/topic?id=74edca48-608a-4e83-b582-3accdc3033f1
I think it is for non deterministic worker number and shift hours.
(2) For rest, in my case, workers doing same functions won't have a rest together, and then I assume they can help each other have a look.
For interest, I checked the example sched_calendar then simulated as following:
I assume for each worker type, the break is same, then it works correctly; However, when I tried with alternative of sequence model
of workers ( for each worker with different break time) by adding main code below:
dvar interval workers[w in Workers] optional in w.releaseT..(maxint div 2)-1
intensity Calendar[w.id];
for (md in Modes)
alternative(modes[md], all (w in Workers: md.workerTid == w.workerT) workers[w]);
forall(w in Workers) {
forbidStart(workers[w], Calendar[w.id]);
forbidEnd (workers[w], Calendar[w.id]);
}
And I deleted previous cumul functions about worker usages <= C[t]. The result shows:
! Conflict refining terminated
! ----------------------------------------------------------------------------
! Conflict status : Terminated normally, conflict found
! Conflict size : 3 constraints
! Number of iterations : 27
! Total memory usage : 785.5 kB
! Conflict computation time : 0.07s
! ----------------------------------------------------------------------------
There is no warning indicating where is the problem. Do i miss something?
(There is full version of code in the attachment)
(3) Additionally, in my case, there is only one worker able to do setup operation during each shift. So setup worker is
a critical resource. To add constraint that the setup worker cannot work on 2 setup operations at a time. I define setup
interval like following (there is operation without machine needed, so I define mid equal to 0):
tuple Setup {
int tOps; // change to Ops
int pt; // setup time needed to change from another mode into the mold op "id" is using.
}
{Setup} Setups = ...;
dvar interval setups [st in Setups] optional size st.pt;
dvar int typeOfPrevResult[md in Modes];
dvar sequence mchs[m in 1..nMchs] in all (md in Modes:md.mId==m) modes[md]
types all(md in Modes, op in Ops: md.mId==m && md.opId==op.id) op.moldId;
cumulFunction wSetup = sum (st in Setups: st.pt>0) pulse(setups[st], 1);
// constraint: limit setup worker resource to one
forall ( md in Modes, m in Mchs, o in Ops:
o.jobId!=0 && md.mId!=0 && md.mId == m && o.id==md.opId) {
typeOfPrevResult[md] == typeOfPrev(mchs[m], modes[md], -1, 0);
forall(st in Setups: st.tOps==o.moldId) {
(typeOfPrevResult[md]!=o.moldId) =>
presenceOf(setups[st])==1;
startAtEnd(ops[o], setups[st]);
}
}
forall (m in Mchs: m!=0) {
noOverlap(mchs[m]);
wSetup <= 1;
}
I wrote by my own and it seems working through result. I am not very confident in it because i didn't find
other similar solutions online. Could you give me some opinions?
Thanks a lot!
#DecisionOptimization#OPLusingCPOptimizer