Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Defining Parameters in Cplex Studio

    Posted 03/07/18 05:06 PM

    Originally posted by: ZacS


    Hi there,

    I am a total beginner to CPLEX studio and will appreciate some help :) Currently trying to use it to solve an LP problem, and I'm having difficulties defining parameters when there are multiple indexes.

    For example, if I have 5 scenarios (q=1,2,3,4,5), and probabilities for each of these scenarios, I will simply write:

     

    range q=1..5;
    float prob[q]=...;

     

    and perform a connection to an excel sheet with a column for q values (1,2,3,4,5) and a column for probability values.

     

    The above example is where I have parameters of the form X_i. However, I am not sure how I can do the same for parameters of the form X_ij.

    For example, if in addition to q, I have another index j with values 1,2 or 3, so in my excel file, I will have a column for q, a column for j and a column for probability. Now I am trying to define parameters to get values for 

    prob_qj i.e. q_11, q_12, q_13, q_21, q_22 etc. 

     

    range q=1..5;
    range i=1..7;
    float prob[q][i]=...;???

     

    I am not sure how I can proceed above, and will appreciate if anyone has any suggestions. Thank you!

    Regards,

    Zac 


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: Defining Parameters in Cplex Studio

    Posted 03/08/18 03:36 AM

    Hi,

    you should clearly have a look at SheetRead in OPL and the oil example

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: Defining Parameters in Cplex Studio

    Posted 03/09/18 09:09 AM

    Originally posted by: ZacS


    Will do that, thanks!

     

    Regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer