Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Creating and Managing Text Output Files

    Posted 06/08/10 12:05 PM

    Originally posted by: UDOPS


    With reference to this example from the documentation:

    execute {
    var f = new IloOplOutputFile();
    f.open("output.txt");
    if (f.isOpen) writeln("f is open");
    else writeln("f is closed");
    f.writeln("Hello World");
    f.close();
    if (f.isOpen) writeln("f is open");
    else writeln("f is closed");
    }
    I believe whenever I call the first line, it creates a new file that replaces any file with the same name. What if I want to save the contents of the existing file and append to it?
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: Creating and Managing Text Output Files

    Posted 06/10/10 10:16 AM

    Originally posted by: Olivier Binckly


    I don't think it's possible to append in the current version of OPL (maybe it will in a future version).
    However you may be able to achieve this with some external JAVA calls.
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: Creating and Managing Text Output Files

    Posted 06/11/10 01:41 AM

    Originally posted by: SystemAdmin


    UDOPS,

    good question !! I would be interested in a solution as well. The only
    pure OPL-workaround I am aware of is reading the file, storing it in an
    array of strings and rewrite it - definitely a hack!!

    Maybe someone of the OPL team can clarify this and put this feature
    onto the wish list ...

    The suggestion with the Java-code is probably the best workaround.

    Best regards
    Norbert
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 4.  Re: Creating and Managing Text Output Files

    Posted 06/11/10 03:55 AM

    Originally posted by: ArnaudS


    This feature will be available in CPLEX Studio 12.2
    (i.e: the release after OPL 6.3)

    Regards,
    Arnaud
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 5.  Re: Creating and Managing Text Output Files

    Posted 06/11/10 04:02 AM

    Originally posted by: SystemAdmin


    Thanks for the info.

    Norbert
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 6.  Re: Creating and Managing Text Output Files

    Posted 06/11/10 11:46 AM

    Originally posted by: UDOPS


    Thanks! Looking forward to version 12.2!
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 7.  Re: Creating and Managing Text Output Files

    Posted 03/28/11 05:06 PM

    Originally posted by: IbrahimC


    Hi all,

    I was not able to append the output file.
    I am using version 12.2 build id: b00030.

    Here is the part of the code:
    var ofile= new IloOplOutputFile();
    ofile.open("L://Result//test.txt", append);

    Thanks in advance.
    #DecisionOptimization
    #OPLusingCPLEXOptimizer