Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
Expand all | Collapse all

(CVRPTW) ERROR:CP cannot extract expression:

  • 1.  (CVRPTW) ERROR:CP cannot extract expression:

    Posted 07/17/09 12:40 AM

    Originally posted by: SystemAdmin


    [elastik said:]

    Hello Everyone,

    i'm trying to implement the CVRPTW using ILOG CP optimizer.
    Please take a look at the following extract from my code:


    using CP;
    ...

    {int} v= asSet(1..Cus + 2*Veh);

    ...

    //Distance Matrix

    float dist[i in v][j in v]=...;

    /*Decision Variables*/

    ...

    dvar int s[1..Cus + 2*Veh] in 1..Cus + 2*Veh;

    ...


    //Objective Function

    minimize(sum(i in v)dist[i,s[i]]);


    subject to{


    The programm runs very well with the variable "dist" defined as an integer.
    But in order to run the programm with more realistic values, i am obliged
    to define "dist" as a float variable. This leads to the following error messages:


    CP cannot extract expression: dist[i][s[(i)]]
    CP cannot extract expression: minimize sum(i in v)dist[(i)][(s[(i)])]



    I would be very grateful if someone could help me out. Thanks.

    Best Regards
    elastik
    #DecisionOptimization
    #OPLusingCPOptimizer


  • 2.  Re: (CVRPTW) ERROR:CP cannot extract expression:

    Posted 11/30/09 03:41 AM

    Originally posted by: Paul Shaw


    Hello,

    CP Optimizer does not currently support the element expression over
    floating-point values. Normally in such a situation data are multiplied
    by some factor (such as 10 or 100), then rounded to give 1 or 2 digits
    of precision. Would this be workable in your case?

    Regards,
    Paul
    #DecisionOptimization
    #OPLusingCPOptimizer