Originally posted by: kcapt
Hello good people!
As I said before I'm new to Cplex and programming languages so I'm sorry in advance If I don't understand something.
The example sched_jobshopflex works wonderfull for jobs that have 3 or more operations, and for that I'm thankfull.
However, when a job has only 2 operations ( Position 0 and Position 1). I want to create a this restriction:
When a job has got only 2 operations.
Cplex can choose the first machine to perform the first operation (Position 0).
However, the second operation (Position 1) must be carried out on a machine that is dependent position 0.
To be more precise, when a job has got ONLY 2 OPERATIONS it can be either one of these cases:
-
Machine 1 perfoms the first operation (position 0) and the machine 6 perfomns the second (position 1).
-
Machine 2 perfoms the first operation (position 0) and the machine 7 perfomns the second (position 1).
-
Machine 3 perfoms the first operation (position 0) and the machine 8 perfomns the second (position 1).
Take a look in the image below, it will help to understand.
I have also attached the files. Thanks!
----------------------------------------------------------------------------------------
I have tried to do something like this but this won't work...
forall (j in Jobs, m1 in Modes, m2 in Modes: m1.opId==j && m2.opId==1+m1.opId , o1 in Ops, o2 in Ops: o1.jobId==j && o2.jobId==j && o1.pos==0 && o2.pos==1)
if(m1.mch==2){
m2.mch==7;
}
----------------------------------------------------------------------------------
Can a alternative opl constrain or a presenceOf solve this problem? I'm really lost...
#ConstraintProgramming-General#DecisionOptimization