Decision Optimization

Decision Optimization

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

 View Only
  • 1.  OPL CP: How to assign a discrete domain to a decision variable in CP.

    Posted Thu August 18, 2011 03:26 PM

    Originally posted by: bindasmariner


    In CP we can define discrete domains for any decision variable, theoretically. e.g. The domain of a dec. variable X may be D(X) = (100,200,...,4000). How can we define such a domain in the ILOG-OPL code.

    I have gone through some part of OPL-CP tutorial and till now haven't come across any such case. Please help me out on this.

    Regards
    Saurabh Chandra
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: OPL CP: How to assign a discrete domain to a decision variable in CP.

    Posted Sun August 21, 2011 05:12 PM
    Hi

    could the following code help you?

    using CP;
     
    dvar int x;
     
    {int} S={20,40,400};
     
    subject to
    {
     x in S; 
    }
    


    Alex
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: OPL CP: How to assign a discrete domain to a decision variable in CP.

    Posted Mon August 22, 2011 12:34 PM

    Originally posted by: bindasmariner


    Hi

    Sorry Alex. it does not work that way. It was the first thing I tried. S term you have shown can only be a range type.

    Although I have found a way by assigning indices to each value in the domain and using the integer indices as dec.Variables. I use the corresponding domain values in the objective and constraint terms. But I thought that there must be a direct method of assigning a discrete domain in CP.

    Regards
    Saurabh
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 4.  Re: OPL CP: How to assign a discrete domain to a decision variable in CP.

    Posted Mon September 05, 2011 11:21 AM
    Hi

    so could the following help?

    using CP;
     
    dvar int x;
     
    {int} S={20 * i | i in 1..20};
     
    subject to
    {
     x in S; 
    }
    


    Alex
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 5.  Re: OPL CP: How to assign a discrete domain to a decision variable in CP.

    Posted Tue September 06, 2011 05:45 PM

    Originally posted by: davidoff


    At least in Cplex Optimization Studio V12.3 , the code Alex provided works fine : there is no limitation for S , it can absolutely be a set.

    David
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 6.  Re: OPL CP: How to assign a discrete domain to a decision variable in CP.

    Posted Tue September 06, 2011 11:37 PM

    Originally posted by: bindasmariner


    yes the suggested code works fine. thanks for the same

    regards
    #DecisionOptimization
    #OPLusingCPLEXOptimizer