Decision Optimization

Decision Optimization

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


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

Changing Constraints Using OPL Script

  • 1.  Changing Constraints Using OPL Script

    Posted 08/05/15 01:34 AM

    Originally posted by: nicholas1234


    Hi

     

    Is it possible to change constraints in a Constraint Programming modlel using OPL script?

    I am aware of setCoef(dvar, coef)

    However I receive the error  : Scripting runtime error: undefined method 'setCoef'

    It seems setCoef only works for CPLEX models.

     

    Thanks in advance

    Nick


    #DecisionOptimization
    #OPLusingCPOptimizer


  • 2.  Re: Changing Constraints Using OPL Script

    Posted 08/05/15 09:01 AM

    Originally posted by: rdumeur


    Dear Nicholas124,

    I don't see a way to modify a constraint when using CP on OPL, since when you name a constraint 'foo', accessing it in OPL script using thisOplModel.foo will return null (instead of the constraint when using CPLEX).

    As a workaround, I suggest that instead you modify the data from which your model is generated.

    I hope this helps.

    Cheers,

     

              Renaud

     

     


    #DecisionOptimization
    #OPLusingCPOptimizer