Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  cannot extract expression

    Posted 01/16/09 09:04 PM

    Originally posted by: SystemAdmin


    [o_O said:]

    Hi All,

    It's my first time to use this language for programming. The purpose of the following codes is to block material flow with high cost penalty (store = 0 and ship = 1).

    dvar boolean store[products][distributionCenters];                       
    dvar boolean ship[orders][distributionCenters];
    // 0:Stored in plant warehouse, 1 Otherwise     
    // 0:Shipped from plant warehouse, 1 Otherwise                                                                                                     
    dvar float+ inv[distributionCenters][products][timePeriods];     
    dvar float+ production[products][timePeriods];         

    // Objective Function Terms
    // Shuttle Costs
    dexpr float ShuttleCosts=
           sum(d in demands, t in timePeriods, pr in products, dc1 in distributionCenters, dc2 in distributionCenters, ol in orderlines, s in ShuttlCosts: d.order==ol.order && d.product==ol.product && s.name==dc1 && s.period==t && d.period==t)
           (d.demand*(2*store[ol.product][dc1]-ship[ol.order][dc2])*s.cost + 0.01/(store[ol.product][dc1]-ship[ol.order][dc2] + 1.01));   

    The error message:

    The algorithm cannot extract expression: 0.01/(store[ol.product][dc1]+ship[ol.order][dc2]*(-1) + 1.01).


    Please help.


    #DecisionOptimization
    #OPLusingCPOptimizer


  • 2.  Re: cannot extract expression

    Posted 01/27/09 04:58 PM

    Originally posted by: SystemAdmin


    [Didier Vidal said:]

    Do you want to solve this problem with CPLEX(Math Programming) or with CP Optimizer(Constraint Programming) ?

    If you want to use CPLEX, you can't divide by decision variables (this term is illegal for CPLEX: 0.01/(store[ol.product][dc1]-ship[ol.order][dc2] + 1.01) )

    If you want to use CP, then there is an other restriction: only discrete decision variables are supported (all dvar must be either int or boolean. They can't be float). In addition, you should start your model with 'using CP;'

    Hope this helps.

    Didier.
    #DecisionOptimization
    #OPLusingCPOptimizer