Originally posted by: LeonFTW
Hi Domenico,
thank you for your fast reply! My model is the implementation of Fliedner and Boysen (2008): Solving the car sequencing problem via Branch & Bound.
{string} O = ...; //set of options relevant for seqeuncing
int M = ...; //number of different car models
int a [1..M][O]= ...; // option allocation: which model of car requires which option
int d[1..M]=...; //demand per model, or the number of cars from this model that need to be sequenced
int H[O]=...; // the max number of cars with option o allowed in any subsequence of length N[o]
int N[O]=...; // length of the subsequence to check for rule violations for option o
int T = sum(m in 1..M)d[m]; //total number of takts
dvar boolean x[1..M][1..T]; //decision variable: 1 if model m is produced in takt t, 0 otherwise
dvar float+ v[O]; // number of rule violations caused by option o
execute {
cplex.tilim = 600;
}
minimize sum(o in O) (v[o]);
subject to {
forall (o in O){ //counting logic for rule violations
ct0: v[o] == sum(t in 1..T: t<=(T-H[o])) minl ((sum(m in 1..M)(a[m][o]*x[m][t])), maxl (sum(ts in t..(minl((t+N[o]-1),T)),m in 1..M)(a[m][o]*x[m][ts])-H[o],0));
}
forall (m in 1..M) // demand has to be met exactly
ct1: sum (t in 1..T)x[m][t] == d[m];
forall (t in 1..T) // max 1 car can be assigned to one takt.
ct2:
sum (m in 1..M)x[m][t]== 1;
}
This is the main model. Actually its followed by a short execute block to output some data, but I guess this should not affect the solving.
Looking forward to your ideas.
Leon
#DecisionOptimization#MathematicalProgramming-General