Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  ODBC Write of Solver Statistics

    Posted 09/21/08 11:13 PM

    Originally posted by: SystemAdmin


    [UDOPS said:]

    Hello, I am back after a month attending to teaching tasks.

    My ongoing model is working nicely, reading data via ODBC and writing the solution back again. However, I also wish to write to a database table the objective value, solver result code, solver time, number of variables, constraints, etc. I suppose I would define a tuple for these data components, then create a single member set with the values and a database record key, and then put the update statement in my .dat file.

    Where can I find the keywords to retrieve these values from cplex, and what is their syntax within OPL script? Do they need to be within an execute (postprocess) script?
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: ODBC Write of Solver Statistics

    Posted 09/22/08 04:42 AM

    Originally posted by: SystemAdmin


    [UDOPS said:]

    Update: well, I have some partial answers

    I found how to make .getObjValue() and .getCplexStatus() work. I have to define the data objects outside the execute statement, and then assign values to the objects within the execute statement, and finally the "ProblemSolution" object is then accessible to the odbc call in my .dat file.

    I am still looking for an accurate reference to these "methods". For example, .getVersion() does not appear to work in OPL. Where can I find a key to the meaning of the Cplex status codes?


    tuple solverresult {int solve_code; float obj_value; int problem_id;}
    float currObj; int currResult;
    {solverresult} ProblemSolution={<currResult, currObj, p> | p in {Problem[1].problem_id}}; //problem_id is defined earlier in the model

    execute {
    currObj=cplex.getObjValue();
    currResult=cplex.getCplexStatus();
    } //end of execute
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: ODBC Write of Solver Statistics

    Posted 09/22/08 12:30 PM

    Originally posted by: SystemAdmin


    [alain.chabrier said:]

    Hi,
    the value correspond to the IloCPLEX::CplexStatus enum.
    You can find the correspondence in the CPELX reference manual, or look at cplex.h for all the CPX_STAT_ identifiers.

    Alain
    #DecisionOptimization
    #OPLusingCPLEXOptimizer