Decision Optimization

Decision Optimization

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

 View Only
  • 1.  Quick Syntax Question

    Posted Tue July 28, 2009 07:18 PM

    Originally posted by: SystemAdmin


    [seizer said:]

    Can someone help with understanding what this particular code does especially with the == sign? I'm not sure since transportCost is not used anywhere in the .mod except for what is shown in the excerpt here.

    [b]dvar float transportCost;

    minimize transportCost;

    subject to {

      orderDeliveryCost == sum (orders in orderPaths)
                                      cost[orders] * orderValidPath[orders];
    // Forall loops, other logic here...
    }[/b]
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: Quick Syntax Question

    Posted Tue August 11, 2009 11:58 PM

    Originally posted by: SystemAdmin


    [jalloyd said:]

    "==" is used in constraints to specify the the Left-hand side (LHS) must equal the RHS in a feasible solution to your optimization problem.

    In your example, the orderDeliveryCost is defined by the RHS of that equation and the two must be equal in a feasible solution.

    I'm assuming orderDeliveryCost is also a variable in your model?  Alternatively, this constraint could be written as a descision expression instead, by defining:

    [b]    dexpr float orderDeliveryCost = sum (orders in orderPaths) cost[orders] * orderValidPath[orders];[/b]

    Notice that this expression has a single "=" sign, denoting an assignment of the RHS to the decision expression variable on the LHS.
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: Quick Syntax Question

    Posted Wed August 12, 2009 12:00 AM

    Originally posted by: SystemAdmin


    [jalloyd said:]

    one more thing... in the case that the RHS of the decision expression contains only input data (no variables), then you don't even need a decision expression -- you can defined the orderDeliveryCost as another input parameter and set it to the computed value of the RHS.  I'm not sure this is the case in your model, but thought I would throw that out there.
    #DecisionOptimization
    #OPLusingCPLEXOptimizer