Originally posted by: Arnautarrago
Hi Alex,
I don't know but i can't upload the model itself, i only can upload the project file.
If you can't see the model i copy it here:
using CP;
// NETWORK+PARAMETERS
int trucks=...; // set of trucks
range truck= 1..trucks;
int times=...; // set of time windows
range time=1..times;
int capacity [truck]=...; // capacity of a truck
int WBs=...; // working bench (WB1,WB2)
range WB= 1..WBs;
int OCs=...; // ore crusher (OC1,OC2)
range OC= 1..OCs;
int nodes=...; // (WB1,WB2,OC1,OC2)
range node= 1..nodes;
int nodecalling [node][time]=...; // 1 if node n calls for truck t at time k
// VARIABLES
dvar boolean x [truck,node,time]; // 1 if truck t is at node n at time k, 0 otherwise
// OBJECTIVE FUNCTION
dexpr float totalproduction =
sum (t in truck, n in OC, k in time) x [t,n,k] * capacity [t];
maximize totalproduction;
//CONSTRAINTS
subject to {
forall(t in truck,n in node,k in time)
ct1: x[1,1,1]==1 || x[1,2,1]==1;
ct2: x[2,1,1]==1 || x[2,2,1]==1;
forall (k in time) ct3:(nodecalling [1,k]==1) =>
x [1,3,k+1] ==1 || x [2,3,k+1] ==1 || x [1,4,k+1] ==1 || x [2,4,k+1] ==1 || x [1,1,k] ==0 || x [2,1,k] ==0;
forall (k in time) ct4:(nodecalling [2,k]==1) =>
x [1,3,k+1] ==1 || x [2,3,k+1] ==1 || x [1,4,k+1] ==1 || x [2,4,k+1] ==1 || x [1,2,k] ==0 || x [2,2,k] ==0;
forall (k in time) ct5:(nodecalling [3,k]==1) =>
x [1,1,k+1] ==1 || x [2,1,k+1] ==1 || x [1,2,k+1] ==1 || x [2,2,k+1] ==1 || x [1,3,k] ==0 || x [2,3,k] ==0;
forall (k in time) ct6:(nodecalling [4,k]==1) =>
x [1,1,k+1] ==1 || x [2,1,k+1] ==1 || x [1,2,k+1] ==1 || x [2,2,k+1] ==1 || x [1,4,k] ==0 || x [2,4,k] ==0;
};
#DecisionOptimization#OPLusingCPLEXOptimizer