Originally posted by: Morkes.L
Hi,
I am modelling a CLSP - Extension that considers start and ending times of production run, including setup times.
I have assigned products to an individual machine through a tuple. Now, when I try to model start and ending times of a production run on one machine I am not able to "access" the full pool of variable assigned to the machines. This is necessary as I try to set all those in order. In the following an extract of the mod file.
Mod:
// Tuple Definition
tuple Machine_Product_Relationship {
string M; // Start point Resource
string K; // End point Product
}
//(Tuple)Sets
{Machine_Product_Relationship} Km = ...; // Set of products k produced on resource m
dvar boolean ga[K, M, T]; // Binary setup operation variable
dvar boolean w[K, M, T0]; // Binary linking variable
dvar int+ q[K, M, T]; // Production quantity
dvar float+ O[M, T]; // Overtime capacity used in t
dvar float+ et[K, M, T]; // End time of setup and production process
dvar float+ st[K, M, T]; // Start time of setup and productio process
// Part to coordinate the start and ending times of the production
// Defines starting point of production for k on the possible machine m in t (16)
forall(k in K, m in M, t in T, km in Km: km.K ==k && km.M ==m)
st[k, m, t] <= 1 - (tb[k] * q[k, m, t] + tr[k] * ga[k, m, t]) /(b[m, t]);
// Defines the end point of the setup and production process of product k (21)
forall (k in K, m in M, t in T, km in Km: km.K ==k && km.M ==m)
et[k, m, t] == st[k, m, t] + ((tr[k] * ga[k, m, t] + tb[k] * q[k, m, t])/ (b[m, t]));
Until here it works just fine as it assigns an inidividual start and end time to every product to machine relation.
The trouble starts with equation 17 and 18 as I try to model a sequence. The logic behind it is that every machine is blocked until the production process of the predecessor product has been finished. So far, the model does not allow multiple setups per product and OPL creates a relaxed solution.
// Defines the order of two products or more products(17)
forall (j, k in K, m in M, t in T, km in Km: km.K ==k && km.M ==m && j!=k)
st[j, m, t] <= (st[k, m, t]) - ((tb[j] * q[j, m, t] + tr[j] * ga[j, m, t])/ (b[m, t]+ CO[m, t])) + (1-ga[k, m, t]);
// Ensures that start points with setup carry-over are set (18)
forall (j, k in K, m in M, t in T, km in Km: km.K ==k && km.M ==m && j!=k)
(st[k, m, t]) >= (((tb[j] * q[j, m, t])/ (b[m, t]+ CO[m, t])) - (1-w[j, m, t-1]));
As I am relatively new to modelling with OPL any hint would be helpful.
If the provided code is not sufficient I will provide the whole model.
Thank you
#DecisionOptimization#OPLusingCPLEXOptimizer