Decision Optimization

Decision Optimization

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

 View Only
  • 1.  Random parameter , expected value

    Posted Mon March 15, 2021 06:29 AM
    Hello everyone,
    I am a beginner in CPLEX , i have a question how to declare a random parameter , i have A(i,t) is a random parameter : the amount of arrival bags , i declare it like this it is correct !! 

    float A[i in flights][t in Horizon]=rand(1,10); ​

    and i have the expected amount of the arrival bags : 
      I couldn't arrive how to declare this expectation in CPlex , any help please.
    and thank you in advance. 






    ------------------------------
    SiwSiw
    ------------------------------

    #DecisionOptimization


  • 2.  RE: Random parameter , expected value

    Posted Mon March 15, 2021 06:52 AM
    Hi

    range flights=1..5;
    range Horizon=1..10;
    float A[i in flights][t in Horizon]=rand(10);
    
    execute
    {
      writeln(A);
    }​

    works fine



    ------------------------------
    [Alex] [Fleischer]
    [EMEA CPLEX Optimization Technical Sales]
    [IBM]
    ------------------------------



  • 3.  RE: Random parameter , expected value

    Posted Mon March 15, 2021 06:58 AM
    Hello Dear Alex , 

    Thank you for your response , 
    but what about the expectation of A how to express it in CPLEX.

    ------------------------------
    Siwar
    ------------------------------



  • 4.  RE: Random parameter , expected value

    Posted Mon March 15, 2021 07:19 AM
    later on you can use A in your constraints

    range flights=1..5;
    range Horizon=1..10;
    float A[i in flights][t in Horizon]=rand(10);
    
    execute
    {
      writeln(A);
    }
    
    dvar int x[flights][Horizon];
    
    subject to
    {
      forall(i in flights, t in Horizon) x[i][t]==A[i][t];
    }​

    works fine



    ------------------------------
    [Alex] [Fleischer]
    [EMEA CPLEX Optimization Technical Sales]
    [IBM]
    ------------------------------



  • 5.  RE: Random parameter , expected value

    Posted Mon March 15, 2021 08:59 AM
    Thank you again Dear Alex , 

    But you don't answer me about the expectation of A  ( E(A)) how to express it in Cplex ??

    ------------------------------
    Siwar
    ------------------------------



  • 6.  RE: Random parameter , expected value

    Posted Mon March 15, 2021 09:10 AM
    Hi

    range flights=1..5;
    range Horizon=1..10;
    
    int nbScenarii=5;
    range scenarii=1..nbScenarii;
    
    
    float A[i in flights][t in Horizon][s in scenarii]=rand(10);
    
    float EofA[i in flights][t in Horizon]=1/nbScenarii*sum(s in scenarii) A[i][t][s];
    
    execute
    {
      writeln(A);
      writeln(EofA);
    }
    
    dvar int x[flights][Horizon];
    
    subject to
    {
      forall(i in flights, t in Horizon) x[i][t]==EofA[i][t];
    }​

    can be a starting point

    Many examples at https://www.linkedin.com/pulse/making-decision-optimization-simple-alex-fleischer/



    ------------------------------
    [Alex] [Fleischer]
    [EMEA CPLEX Optimization Technical Sales]
    [IBM]
    ------------------------------