Topic
  • 3 replies
  • Latest Post - ‏2014-05-22T08:12:57Z by AlexFleischer
viva0521
viva0521
32 Posts

Pinned topic OPL output file

‏2014-05-19T19:40:10Z |

Hi, there

I am wondering how can I open OPL output file which is generated by the command line:

"oplrun -o file_name.opl file_name.mode"

Any idea? Thanks in advance!

  • AlexFleischer
    AlexFleischer
    1270 Posts

    Re: OPL output file

    ‏2014-05-19T20:03:54Z  

    Hi

    oplrun -h gives you

     -o output-file      compile model

    I invite you to look at documentation

     

    IDE and OPL > CPLEX Studio IDE > IDE Reference > Processes and Procedures > Generating output files

     

    Generating a compiled model

    Describes how to generate a binary version of a model file.

    About this task

    From the IDE, you can generate a compiled model. A compiled model is a binary version of a .mod file.

    Keeping your models as compiled files may help you protect your intellectual property because these binary files are not human-readable.

    I hope this helps: you cannot read a .opl, you may run it

    regards

     

     

  • viva0521
    viva0521
    32 Posts

    Re: OPL output file

    ‏2014-05-21T19:42:32Z  

    Hi

    oplrun -h gives you

     -o output-file      compile model

    I invite you to look at documentation

     

    IDE and OPL > CPLEX Studio IDE > IDE Reference > Processes and Procedures > Generating output files

     

    Generating a compiled model

    Describes how to generate a binary version of a model file.

    About this task

    From the IDE, you can generate a compiled model. A compiled model is a binary version of a .mod file.

    Keeping your models as compiled files may help you protect your intellectual property because these binary files are not human-readable.

    I hope this helps: you cannot read a .opl, you may run it

    regards

     

     

    Alex,

    I took a close look at oplrun -h menu, there is nothing about how to display the detailed solutions. For example, if I am trying to solve a transportation problem, it just give me the objective value without any information about the path flow. Would you please explain this for me? Thanks for your patient and time! 

  • AlexFleischer
    AlexFleischer
    1270 Posts

    Re: OPL output file

    ‏2014-05-22T08:12:57Z  
    • viva0521
    • ‏2014-05-21T19:42:32Z

    Alex,

    I took a close look at oplrun -h menu, there is nothing about how to display the detailed solutions. For example, if I am trying to solve a transportation problem, it just give me the objective value without any information about the path flow. Would you please explain this for me? Thanks for your patient and time! 

    Hi,

    if you use the IDE you will see the result in the solution tab

    if you use oplrun, you may use an execute block to display the solution

    Example:

    dvar float+ Gas;
    dvar float+ Chloride;

    dexpr float objective=40 * Gas + 50 * Chloride;
    maximize objective;
     
    subject to {
      ctMaxTotal:     
        Gas + Chloride <= 50;
      ctMaxTotal2:    
        3 * Gas + 4 * Chloride <= 180;
      ctMaxChloride:  
        Chloride <= 40;
    }

    execute
    {
      writeln("Chloride =",Chloride);
    }

     

    will give

    OBJECTIVE: 2300
    Chloride =30

     

    regards