Decision Optimization

Decision Optimization

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

 View Only
  • 1.  Domain as a set?

    Posted Fri February 25, 2011 09:04 AM

    Originally posted by: SystemAdmin


    Is it possible to declare domains as a sets consisting of integers in OPL using CP engine?

    How can i do a dvar declaration which includes a domain as a set? something like x in 1,2,4

    Thanks!
    #DecisionOptimization
    #OPLusingCPOptimizer


  • 2.  Re: Domain as a set?

    Posted Fri February 25, 2011 10:17 AM

    Originally posted by: ChrisBr


    Hello Akemati,

    It is not possible to declare domains as sets directly.
    You have to use a constraint, as shown in the following code:
    
    
    {
    
    int
    } s = 
    {1, 2, 4
    }; dvar 
    
    int x in (min(i in s) i)..(max(i in s) i); subject to 
    { x in s; 
    }
    

    I hope this helps,

    Chris.
    #DecisionOptimization
    #OPLusingCPOptimizer


  • 3.  Re: Domain as a set?

    Posted Fri February 25, 2011 11:58 AM

    Originally posted by: SystemAdmin


    It help me a lot!

    Thank you!
    #DecisionOptimization
    #OPLusingCPOptimizer