Natdanai I.
Natdanai I.

Reputation: 49

CPLEX : OPL cannot extract expression

I get this error,"opl cannot extract expression", for an expression in my objective function.

    +(cost_lateness*((sum(r in request)delay[r])
            +(sum (p in plant, r in request, m in deliveries : m > 1 , k in truck, 
                   k1 in truck : k != k1, j in jobs, j1 in jobs : j != j1)
    (x[p][r][m+1][k][j]*start_pour[k][j] - x[p][r][m][k1][j1]*end_pour[k1][j1]))));

Thank you.

Upvotes: 1

Views: 228

Answers (1)

Alex Fleischer
Alex Fleischer

Reputation: 10059

What about changing

: m > 1

into

: (m > 1) && (m!=last(deliveries))

in order to make sure m+1 does not lead to out of range?

Upvotes: 2

Related Questions