Hi!
I am new to OPL and CPLEX and I'm trying to formulate an objective function where I want to maximize the number of products delivered within a time limit.
Some of my input and decision variables:
int d[S][T] = ...; // demand from site i at time t
int l = ...; // time limit in which the product needs to be at the depot after demand is available (240 minutes)
int l2 = ...; // time limit 2 (360 minutes)
dvar boolean x[S][T][V][R]; // equal to 1 if products at site i at time t are picked up by vehicle v in route r, 0 otherwise
dvar int+ w[V][R]; // arrival time of vehicle v at depot after completing route r
So when the demand becomes available, the products needs to be at the depot within 'l' minutes, otherwise penalties will occur.
If the product arrives:
- within the limit (240 minutes) --> no penalty
- between 241 and 360 minutes --> penalty1 occurs (p1)
- after 361 minutes --> penalty2 occurs (p1)
Right now I have this objective function, but it won't work because I put a decision variable as condition in the sum.
maximize sum (i in S, t in T : w[v][r] <= t + l, v in V, r in R) d[i][t] * x[i][t][v][r]
+ sum (i in S, t in T : w[v][r] => t + l && w[v][r] <= t + l2, v in V, r in R) d[i][t] * x[i][t][v][r] * p1
+ sum (i in S, t in T : w[v][r] => t + l2, v in V, r in R) d[i][t] * x[i][t][v][r] * p2
Is something like this possible in CPLEX?
Thank you in advance!
------------------------------
Floor M
------------------------------
#DecisionOptimization