Originally posted by: llattila
I'm trying to create a QP model but for some reason my code cannot extract the minimization function. Getting the following error code:
CPLEX(default) cannot extract expression: minimize distance.
Here I have listed the pieces of code, which have an impact on the distance expression.
tuple target{
int id;
float x;
int day;
}
{object} objects = ...;
{target} targets = ...;
dvar float locationX
http://0..maxDaysobjects;
dvar boolean objectAndTarget
objectstargets;
dexpr float distance = sum (o in objects, t in targets) objectAndTarget[o][t] * locationX
http://t.day[o]^2 + (other conditions come here)
As soon as put the locationX
http://t.day[o] to the second power, it gives the error message. Other parts of the distance functions seems to be working (such as (t.x)^2 ).
Basically the targets have a day between 1 to maxDays and the locationX is a different value for different days for different objects. I have included day 0 for the location as well as that is the initial location of my objects. objectAndTarget is a boolean value, true if a specific object chooses a specific target.
I'm using IBM ILOG CPLEX Optimization Studio 12.3 on Windows 7.
#DecisionOptimization#OPLusingCPLEXOptimizer