Decision Optimization

Decision Optimization

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

 View Only
  • 1.  Running OPL using CPLEX

    Posted Tue August 07, 2012 07:12 PM

    Originally posted by: osarood


    Hello

    I am new to optimization and solvers. How can I run the blending example found at:
    ibm/ILOG/CPLEX_Studio124/opl/examples/opl/blending

    What command do I need to give. Or is there any documentation that I can read?
    Thanks
    Osman
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: Running OPL using CPLEX

    Posted Tue August 07, 2012 07:46 PM

    Originally posted by: SystemAdmin


    The documentation is available here: http://pic.dhe.ibm.com/infocenter/cosinfoc/v12r4/index.jsp (as well as in your installation directory CPLEX_Studio124/doc

    You can execute the sample with the executable oplrun:
    oplrun -p ibm/ILOG/CPLEX_Studio124/opl/examples/opl/blending
    


    or on Linux and Windows, you can import the example in the IDE and solve it there.

    Hope this helps
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: Running OPL using CPLEX

    Posted Mon August 13, 2012 10:41 PM

    Originally posted by: osarood


    Thanks a lot for the reply

    I am trying put a simple indicator constraint in the blending problem. I add a boolean array

    dvar boolean xxMetals;

    and put the following indicator constraint:
    ct3:
    forall( j in Metals) xx[j]==1 => m[j]>0;

    It gives the following error:

    • ERRORGENERATE_022 at 57:28-47 /opt/ibm/ILOG/CPLEX_Studio124/opl/examples/opl/blending/blending.mod: Function operator>(dvar float,int) not available in context CPLEX.
      1. OPL exception: Impossible to load model.
    Can you point out the problem? Thanks
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 4.  Re: Running OPL using CPLEX

    Posted Wed August 15, 2012 12:42 AM

    Originally posted by: SystemAdmin


    The ">" is not supported in the constraint declaration.
    You have to have a ">=".
    Therefore, you should write your constraint as
    ct3:
    forall( j in Metals) xx[j]==1 => m[j]>=0.000001;
    


    Hope this wil help.
    Regards
    Norbert
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 5.  Re: Running OPL using CPLEX

    Posted Wed August 15, 2012 10:08 AM

    Originally posted by: osarood


    Thanks

    It still doesnt produce the correct results.

    I declared xx as boolean:
    dvar boolean xx Metals ;

    and am using the exact same constraint mentioned:
    ct3:
    forall( j in Metals) xx[j]==1 => m[j]>=0.000001;
    but I am getting xx as all zeros whereas it should be all 1's
    m = http://3.55 24.85 42.6;
    xx = 0 0 0;
    Is there something I am missing?

    Thanks
    Osman
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 6.  Re: Running OPL using CPLEX

    Posted Wed August 15, 2012 10:18 AM

    Originally posted by: osarood


    sorry the values for m and x are

    m = 3.55 24.85 42.6;
    xx = 0 0 0;
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 7.  Re: Running OPL using CPLEX

    Posted Wed August 15, 2012 01:48 PM

    Originally posted by: SystemAdmin


    Where is the problem?
    Your constraints just says that when x=1 the m should be positive.
    In your solution all x are 0, thus no restriction on the m.

    Regards
    Norbert
    #DecisionOptimization
    #OPLusingCPLEXOptimizer