Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  stochastic programming

    Posted 07/08/16 08:46 AM

    Originally posted by: sandeepsinghchauhan


    Does Cplex  has any stochastic programming example?

     


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: stochastic programming

    Posted 07/08/16 08:58 AM

    Hi,

    yes

    in CPLEX_Studio1263\opl\examples\opl\models\YieldStochastic

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: stochastic programming

    Posted 07/13/16 11:41 AM

    Originally posted by: sandeepsinghchauhan


    In Yield stochastic model after model equations (line number 125) why these many tuples are there?

    Are they playing any role in model? please help


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 4.  Re: stochastic programming

    Posted 04/04/18 02:12 PM

    Originally posted by: Kamran_Sr


    Hi,

     

    Can someone advise me if there is a possibility to solve a two stage stochastic programming in Cplex? I have looked at the yield management and stochastic scheduling examples in Cplex, however they are not a two stage approach.

     

    I would be appreciated if anyone can help me with this.

     

    Regards,

    Kamran


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 5.  Re: stochastic programming

    Posted 04/05/18 03:47 AM

    Hi,

    you have a very nice example in python at

     

    https://dataplatform.ibm.com/analytics/notebooks/fbd32016-7d11-4ecf-8945-7d5e7f714896/view?access_token=38d63d50b379997fd3a008c59e610dfea801af9b42bca85ab25c39c64cbbc54b

     

    Let me quote:

    The general idea is that you have to fulfill some initially unknown demand of goods (whatever). You can buy these goods early and cheap, or more expensive later, after you know the demand.

    And this can be written in OPL:

    range scenarii=1..4;

    float DEMANDS[scenarii] = [10, 12, 14, 20];
    float PROBABILITIES[scenarii]  = [1./4, 1./4, 1./4, 1./4];

    assert sum(s in scenarii) PROBABILITIES[s]==1;

    float C1=1;
    float C2=2;

    dvar int+ x;
    dvar int+ y[scenarii];

    dvar float obj;

    minimize obj; // cost
    subject to
    {

    // supply more than demand
    forall(s in scenarii) x+y[s]>=DEMANDS[s];

    // cost formula
    obj==C1*x+C2*sum(s in scenarii) PROBABILITIES[s]*y[s];

    }

    which gives

    obj = 17;
    x = 12;
    y = [0 0 2 8];

    regards

     

    https://www.linkedin.com/pulse/what-optimization-how-can-help-you-do-more-less-zoo-buses-fleischer/


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 6.  Re: stochastic programming

    Posted 04/05/18 12:04 PM

    Originally posted by: Kamran_Sr


    Dear Alex,

     

    Thanks for your useful respond. My two stage model is as follows:

     

    Where the pi(s) is the probability of scenario s and fiXi is the first-stage objective function. In this objective function, the term Z(X,C,s) is the minimized objective function of the model for each scenario s. In other words, for each s we need to run a model with the variables who are dependant on scenario s. I was wondering how I should consider the Z(X,C,s) in the objective function? because Cplex does not support a minimize term inside another minimization function.

    I have attached a file for clarification of Z(X,C,S).

    I would be appreciated if you could help me with this.

    Regards,

    Kamran

     


    #DecisionOptimization


  • 7.  Re: stochastic programming

    Posted 04/05/18 01:26 PM

    Hi,

    in a main you could solve the sub models for each scenarii and get the Z values and then use them in the master model.

    See

    Tutorial: Flow control and column generation

    Shows how to use flow control and multiple searches to create more complex flow control scripts that involve several model definitions.

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 8.  Re: stochastic programming

    Posted 04/28/18 08:02 AM

    Offline, an optimization expert asked me to comment

    "12 to 14 are indeed the value for X with best expected objective value!"

    in

    https://dataplatform.ibm.com/analytics/notebooks/fbd32016-7d11-4ecf-8945-7d5e7f714896/view?access_token=38d63d50b379997fd3a008c59e610dfea801af9b42bca85ab25c39c64cbbc54b

    For that, let me use https://www.ibm.com/developerworks/community/forums/html/topic?id=d8d12e36-3150-4e1c-a956-d707d17f274c&ps=25

    The best objective is 17 and let us find all x that give this result:

     

        range scenarii=1..4;

        float DEMANDS[scenarii] = [10, 12, 14, 20];
        float PROBABILITIES[scenarii]  = [1./4, 1./4, 1./4, 1./4];

        assert sum(s in scenarii) PROBABILITIES[s]==1;

        float C1=1;
        float C2=2;

        dvar int+ x;
        dvar int+ y[scenarii];

        dvar float obj;

        //minimize obj; // cost
        subject to
        {
        
        obj==17;    
        

        // supply more than demand
        forall(s in scenarii) x+y[s]>=DEMANDS[s];

        // cost formula
        obj==C1*x+C2*sum(s in scenarii) PROBABILITIES[s]*y[s];

        }
        
        execute
        {
        writeln("x=",x);    
        }
        
         main {
    cplex.solnpoolintensity=4;

        thisOplModel.generate();
        cplex.solve();
        if (cplex.populate()) {
          var nsolns = cplex.solnPoolNsolns;
          
          
          writeln("Number of solutions found = ",nsolns);
          writeln();
          for (var s=0; s<nsolns; s++) {
            write("solution ",s+1," ");      
          
            thisOplModel.setPoolSolution(s);
            thisOplModel.postProcess();
          }
        }
    }

     

    which gives

    Number of solutions found = 3

    solution 1 x=14
    solution 2 x=13
    solution 3 x=12

    which is inline with

    "12 to 14 are indeed the value for X with best expected objective value!"

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


Global message icon