Originally posted by: SystemAdmin
Hello,
"Horizon" is not really important in the model. It could be any large value. It is used in the definition of interval variables
occupyMagazine to define the domain of the size of the interval. The maximum size ("Horizon") is not really important. what is more important is the minimal size. Interval variable
occupyMagazine represents the time interval during which a given tool stays in the magazine of a machine. It would be sufficient to set a minimal size of
1 for such an interval. In the attached model, it is slightly optimized by the fact that if a tool is in the magazine of a machine for performing a job, the duration of such an interval of time will be at least the minimal duration of all jobs requiring this tool on the machine. This is why the min size is stated to be
minJobDuration[tj.tool]. As the OPL syntax for defining a min size also requires a value for the max, that's the reason for introducing "Horizon".
In the model I attached there is no transition time on the machine beside the tool transition constraint. And a transition between tools does not necessarily imply a transition between consecutive jobs on the machine (but this is because of the interpretation I did of your description of the tool change constraint). Look at the example I gave:
For instance, with your example of sequence on machine 1: J1-J5-J4-J6-J10. If the capacity of the magazine is 2, we have 4 tools T1..T4 and if we have the following tool requirements by jobs: J1:{T1,T2}, J5:{T2,T3}, J4:{T1,T3}, J6:{T3,T4}, J10:{T1,T4}. Let's suppose the jobs are all 10 and that when the magazine capacity is exceeded it requires 30 units of time to install a new tool. A solution could be:
J1 executes on [0,10) with T1 and T2, magazine usage is 2
J5 executes on [10,20) with T2 and T3, T1 needs to be removed from the magazine in order not to exceed the capacity so it won't be available until 10+30=40
J4 executes on [40,50) with T1 (that has been put back in the magazine which explains the delay) and T3 (already in magazine), magazine is full, so T1 needs to be removed again from the magazine in order not to exceed the capacity, it won't be available until 50+30=80
There is indeed no transition time between the first two jobs J1 and J5. It is because in my interpretation, if the capacity of the magazine is 2, switching from {T1,T2} to {T2,T3} does not require any delay between the jobs: moving T1 out of the magazine can be done in parallel with installing T3. It is only when T1 will have to be re-installed in the magazine that it will require some time, but this re-installation can be done without interrupting the machine, it will only delay the time a new job requiring tool T1 can start (like the subsequent job J4 in the above example).
Your question when looking at the solution shows that my interpretation of the tool change constraint is probably not the right one. This is why I asked if you can formalize this tool change constraint so that there is no ambiguity about its possible interpretation. Note that the attached model with cumul function can be adapted to other interpretations of the tool change constraint. The chain of intervals
occupyMagazine really represent the set of time intervals during which the tool needs to stay in the machine magazine in order to perform some jobs. You can for instance add addition intervals in the chain of intervals
occupyMagazine to represent activities related with tool removal/installation in the machine magazine. These interval variables could require the machine and even, why not, other resources.
Philippe
#DecisionOptimization#OPLusingCPOptimizer