Decision Optimization

Decision Optimization

Delivers prescriptive analytics capabilities and decision intelligence to improve decision-making.


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Error: IloNum is not integer

    Posted 04/15/13 04:14 PM

    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


  • 2.  Re: Error: IloNum is not integer

    Posted 04/16/13 06:10 AM

    Originally posted by: GGR


    Hi Hossein

     

    The first argument in the element expression is the index, that is an integer data. So, The behavior of CPO (in fact concert in this case) is correct.

     

    You have to use an IloIntArray or an IloIntVarArray as first argument of the element expression

     

    Hope that helps


    #CPOptimizer
    #DecisionOptimization


  • 3.  Re: Error: IloNum is not integer

    Posted 04/17/13 12:57 PM

    Originally posted by: Hosssein


    well, what if my data matrix (here PP45) contains float values? Actually this matrix contain pricing values of a column generation method and cannot be replaced by IloIntArray.


    #CPOptimizer
    #DecisionOptimization


  • 4.  Re: Error: IloNum is not integer

    Posted 04/17/13 01:40 PM

    Originally posted by: GGR


    Hi Hossein

    I think i made a mistake in the IloElement syntax. The first array is the values and the second array is the index. So the first array can contains floating point values (beside the intention is clearly having an numerical objective term). As well the operator [ ] should work. I see in the documentation:

    public IloNumExprArg IloElement(IloNumArray a, IloIntExprArg x)

    public IloNumExprArg operator[](IloIntExprArg anIntegerExpr) const

    Which version of CPO do you use?

     

    Thanks

     


    #CPOptimizer
    #DecisionOptimization


  • 5.  Re: Error: IloNum is not integer

    Posted 04/17/13 02:14 PM

    Originally posted by: Hosssein


    It is IBM ILOG CPLEX Optimization Studio V12.3.


    #CPOptimizer
    #DecisionOptimization


  • 6.  Re: Error: IloNum is not integer

    Posted 04/18/13 05:23 AM

    Originally posted by: GGR


    Hi Hossein

     

    I think floating point element constraint had problem in this and sooner version

    I suggest you upgrade your system in the last V12.5 version

     

    Hope that helps

     

     


    #CPOptimizer
    #DecisionOptimization