Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  write engine log to a .txt

    Posted 02/19/09 11:57 PM

    Originally posted by: SystemAdmin


    [daniel said:]

    hello, I run a model in OPLRUN. I would like to write the engine log to a text file. I can't find anything on this matter.

    I tried this at the end of the model file:

    execute {
    var f = new IloOplOutputFile();
    f.open("output.txt");
    f.write(cplex.LogFile);
    f.close();
    }

    it returns "undefined" in the text file. What should it be instead of cplex.LogFile????

    Daniel
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: write engine log to a .txt

    Posted 02/20/09 04:23 PM

    Originally posted by: SystemAdmin


    [Can_T_OM said:]

    Hi Daniel,

    You will find a simplistic model (examples\opl\mulprod\mulprod_main.mod) model that pushes the solution into a text file. You will probably have to customize it to collect more data.

    Best regards,

    Nourredine.

    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: write engine log to a .txt

    Posted 02/23/09 06:05 PM

    Originally posted by: SystemAdmin


    [daniel said:]

    that's the problem, I don't know how. I use to work with OPL version 3.7. It was simply:

    setting cplexLogFile = // with the directory and file name .txt

    I don't know what are the command lines in version 6.x
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 4.  Re: write engine log to a .txt

    Posted 02/23/09 06:29 PM

    Originally posted by: SystemAdmin


    [Can_T_OM said:]

    Let assume you have:

    Hi Daniel,

    Here is a quick explanation that will help with your issue. I just modified an output script that I wrote in OPL6.1

    Try it and let me know.


    tuple T
    {
    string a;
    string b;
    int c;
    }

    {T} S=...;

    dvar boolean x[S];

    .
    .
    .

    execute Output_Script
    {
    writeln();     
      writeln("==============================");     
      writeln("Starting Output Script");
      writeln("==============================");     
      writeln();     

      var ofile = new IloOplOutputFile("C://Documents and Settings//Daniel//My Documents//Model_Directory//OutpuFile.txt");
    //Where  "C://Documents and Settings//Daniel//My Documents//Model_Directory//OutpuFile.txt" is a path on your drive (example C Drive)
      ofile.writeln("Field1", ",","Field2", ",","Field3");
    //You may want to use a space as a separator between 2 consecutive fields, then use this statement ofile.writeln("Field1", " ","Field2", " ","Field3");
    for( var data in S)
        {
    if(x[data]==1) ofile.writeln(data.a,",", data.b,",",data.c);               
        }
    }
    #DecisionOptimization
    #OPLusingCPLEXOptimizer