Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Variable Ranges

    Posted 10/09/11 09:25 AM

    Originally posted by: NYCK_Kai_Schaal


    Hello everybody,

    I'm a new user of OPL.

    I've got a question on how to define a variable range.

    I defined a set of products and a parameter 'parameter' which is depending on products.

    {string} products = ...;
    int parameter products = ...;

    I now want to define a variable range. This means that this range shall also depend on the product. The range shall always reach from parameter (which is depending on the product, see above) + 1 until 10.

    It tried the following approach but it didn't work:

    +range RANGEproducts = parameter+1 .. 10+

    Can anybody help me here? Thank you very much

    Kai
    #DecisionOptimization
    #OPLusingCPOptimizer


  • 2.  Re: Variable Ranges

    Posted 10/09/11 09:28 AM

    Originally posted by: NYCK_Kai_Schaal


    Obviously the brackets are not displayed correctly in my post above.. Sorry for that.
    #DecisionOptimization
    #OPLusingCPOptimizer


  • 3.  Re: Variable Ranges

    Posted 10/10/11 07:51 AM
    Hello,

    I think that arrays of range do not exist but you can use arrays of tuples with a start and an end:

    
    
    {string
    } products = 
    {
    "A",
    "B"
    };; 
    
    int parameter [products] = [2,3];   tuple Range 
    { 
    
    int s; 
    
    int e; 
    }     Range RANGE[i in products] = <parameter[i] ,10>;
    


    Regards

    Alex
    #DecisionOptimization
    #OPLusingCPOptimizer