Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Optimizer status

    Posted 07/14/10 02:55 PM

    Originally posted by: Boon_Ilog


    Hi,

    I am using OPL 6.3 with cplex 12.1.

    I have written a model in OPL. My data is coming from MS Access. I use the .dat file to import and export data between Access and the model.

    What I would like to do is to be able to export a problem status (or cplex status, or optimizer status) to the Access. Basically what I want to know is whether the model is optimized (including true optimized, or tolerance) or not. I do not know what syntax or code I need to use to get this. I tried to use "cplex.getcplexstatus", but not quite understand how meaning is. Sometimes I get the value of 102??

    I expect to see something like Yes or No. No would mean infeasible, unbounded,... problems.

    thank you for your help!
    Boon
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: Optimizer status

    Posted 07/14/10 06:14 PM
    Hi

    in your .mod file after the subject to block you may write

    main
    {
    thisOplModel.generate();
    if (cplex.solve())
    {
    writeln("yes");
    }
    else
    {
    writeln("no");
    }
    }

    Alex
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: Optimizer status

    Posted 07/16/10 10:10 AM

    Originally posted by: Boon_Ilog


    Alex,

    You are the man! Your code works fine but it didn't solve my problem. Actually part of it is my fault. I didn't explain my problem completely....

    Let me explain clearly my problem.

    My OPL code read the data from Access, and it will export the result back to Access as well. I use the tuple to export results back into Access. When I pasted your code in my .mod file, the scripting displays correctly (yes or no). But the model did not export the results back to Access. I tried to change the "main" to "execute". but it didn't work. it was an error...

    Ultimately I will run this model via oplrun in command prompt.

    thanks so much,
    Boon
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 4.  Re: Optimizer status

    Posted 07/16/10 02:41 PM
    Ok then you could write

    main
    {
    thisOplModel.generate();
    if (cplex.solve())
    {
    writeln("yes");
    }
    else
    {
    writeln("no");
    writeln(thisOplModel.printRelaxation());
    }
    thisOplModel.postProcess();
    }
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 5.  Re: Optimizer status

    Posted 08/22/11 12:00 PM

    Originally posted by: pradeepram80


    I know this is an old thread. But I'm in a similar spot. Is there a way to export the relaxation information along with the rest of the results back to SQL (not access in my case)? writeln either writes to a text file or a console. Couldn't find a way to populate the tuples with relaxation info..

    Thanks.
    #DecisionOptimization
    #OPLusingCPLEXOptimizer