Originally posted by: Petr Vilím
Hello,
so when Position is 0 then it is necessary to create three optional intervals for the operation: one will represent the case when the operation is performed by machine 1, second by machine 2 and third by machine 3. And then you need to combine those three sub-operations by constraint "alternative".
I'm guessing that you're referring to OPL example sched_jobshopflex (there is also C++ example with the same name). And it seems to me that you don't understand the data format. So let me explain:
Operations are defined as in sched_jobshopflex.dat as:
tuple Operation {
int id; // Operation id
int jobId; // Job id
int pos; // Position in job
};
{Operation} Ops = ...;
So each operation has a unique id, it is used later to specify possible modes for the operation. The id could be any number, but in our case it is simply number of the operation counted from 1. Jobs has also unique ids, again it is just simply a number starting to from 1. Each operation specifies to which job it belongs (by jobId) and its position within the job (by pos). Positions seems to be counted from 0. For example, here is part of sched_jobshop.dat file:
Ops = {
<1,1,0>,
<2,1,1>,
<3,1,2>,
<4,1,3>,
<5,1,4>,
All the operations above are from the same job (jobId=1). First line specifies first operation of the job 1 (position=0), second line second operation (position=1) etc. Notice the operation ids are really unique, for example there is only one operation with id=1, the same operation id cannot be reused another operation (even in another job).
Now Modes specifies possible machine allocations for operations. It is defined as:
tuple Mode {
int opId; // Operation id
int mch; // Machine
int pt; // Processing time
};
{Mode} Modes = ...;
For given operation (specified by opId) there could be multiple records in Modes, each record specifies a machine and processing time. From the data file:
Modes = {
<1,3,13>,
<1,7,12>,
<2,8,9>,
<2,9,17>,
So for operation with id=1 there are two modes. First mode is using machine 3 and has duration 13, second mode is using machine 7 and has duration 12. Considering the model, the solver will have to chose one of the modes (and therefore one of those machines and accordingly the duration). Similarly for operation with id=2 there also two modes: machine 8 and duration 8 or machine 9 and duration 17.
I hope it helps.
Petr
#ConstraintProgramming-General#DecisionOptimization