Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  help with constraint

    Posted 02/05/09 07:03 PM

    Originally posted by: SystemAdmin


    [daniel said:]

    hello,

    I use to work with version 3.7 of OPL. I'm finally migrating to the latest version. I encountered a problem while trying to write a constraint.

    In version 3.7 I use to write something like:

    forall(i in Areas)
      Volume[i]*Harvest[i] = sum( <i,j> in Connections: c.i =i) HauledVolume[c];

    I could specify in the summation "such as c.i=i". By doing this, I do a summation on j.

    In version 6.x I wrote:

    forall(i in Areas)
      Volume[i]*Harvest[i] == sum( <i,j> in Connections: c.i ==i) HauledVolume[c];

    the "c" in "c.i" is always underlined in red. I don't know why. What am I doing wrong? Is it because we cannot use the "such as..." in a constraint?
    #DecisionOptimization
    #MathematicalProgramming-General


  • 2.  Re: help with constraint

    Posted 02/05/09 07:07 PM

    Originally posted by: SystemAdmin


    [alain.chabrier said:]

    Hi,

    I think you can do :


    forall(i in Areas)
      Volume*Harvest == sum( <i,j> in Connections) HauledVolume[<i,j>];

    slicing on i is implicit.

    or

    forall(i in Areas)
      Volume*Harvest == sum( c in Connections: c.i ==i) HauledVolume[c];

    slicing in implicit

    hope this helps,

    Alain
    #DecisionOptimization
    #MathematicalProgramming-General


  • 3.  Re: help with constraint

    Posted 02/05/09 07:44 PM

    Originally posted by: SystemAdmin


    [daniel said:]

    the first code seems to work. The second does not.

    Thank you for your help.

    Daniel
    #DecisionOptimization
    #MathematicalProgramming-General