Originally posted by: ThomasGh
Dear all,
We are writing a MIQP we would like to solve with CPLEX using the concert technology and Scala. When calling solve, the value of our variables are called and here we get an UnknownObjectException for the variables that contain a zero coefficient in the objective.
Can we allow variables with a 0 coefficient in the objective? Are there some parameters we should use in CPLEX to allow this and to avoid the IloCplex UnknownObjectException?
In attached the mathematical program we want to solve and below some code of where the error is occuring:
val opt = solve flatMap {
w =>
val accepted = for ((o,v)<-x;
accept=v.value;
acceptedVolume=accept*o.volume;
if (abs(acceptedVolume)>volTol))
yield (o,accept)
def value = try {
cplex.getValue(cplexVar)
} catch {
case e: IloCplex.UnknownObjectException =>
throw new Exception("Error: variable "
name" not defined in the problem.")
}
Anyone an idea?
Many thanks in advance,
Thomas
#CPLEXOptimizers#DecisionOptimization