Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  opl studio information

    Posted 02/03/10 10:54 AM

    Originally posted by: biaigo


    hello,

    i'm a new user of opl studio. I have a problem. i don't know how to calculate a value of a variable in opl script. i need to calculate it into the minimize problem (on-line). i want know if it's possible
    #CPOptimizer
    #DecisionOptimization


  • 2.  Re: opl studio information

    Posted 02/05/10 04:49 AM

    Originally posted by: Didier Vidal


    Hello biaigo,

    Here is an example that initializes data in two ways - with an OPL statement (started) and with script (now and startTime).
    Hope this helps,

    Didier.

    
    using CP;     range tasks = 0..10; dvar interval myIntervals[tasks] size 4;   
    // Example of data initialization with an OPL statement - random value between 0 and 1 
    
    int started[t in tasks] = rand(2);   
    
    int startTime[tasks]; 
    
    int now; 
    // Example of initialization of a variable in script execute 
    { var current = 0; var t; 
    
    for (t = 0; t<= 10; t++) 
    
    if (started[t] == 1) 
    { startTime[t] = current; current += 5; 
    } 
    
    else started[t] = -1; now = current; 
    }   minimize max(t in tasks) endOf(myIntervals[t]); constraints 
    { forall(t in tasks : started[t] == 1) startOf(myIntervals[t]) == startTime[t]; noOverlap(myIntervals); 
    }
    

    #CPOptimizer
    #DecisionOptimization