Originally posted by: Hosssein
Hi,
I get this Error from CP optimizer:
Error: IloNum is not integer
By debugging, I found out that this error is related to an IloElement Expression in my Objective Function:
IloIntVarArray W(env, 5, 0, 9);
PP45= IloNumArray(env, 10);
IloNumExpr OBJECTIVE = IloNumExpr(env,0);
for(i = 0; i < 5; i++)
{
OBJECTIVE += -IloElement(PP45,W[i]);
}
This error happens only when array PP45 contains some fractional values. I also test the following code to build the objective function but got the same error.
for(i = 0; i < 5; i++)
{
OBJECTIVE += -PP45[W[i]];
}
IloElement constraint does not work when PP45 contain float values. Right? Is there any way to handle it?
Thank you
#CPOptimizer#DecisionOptimization