Decision Optimization

Decision Optimization

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

 View Only
Expand all | Collapse all

How to export the model to .LP file?

  • 1.  How to export the model to .LP file?

    Posted Mon November 10, 2008 06:04 PM

    Originally posted by: SystemAdmin


    [homarjun.agrahari@bnsf.co said:]

    How can I export the model to an .lp or .MPS file. I am using OPL IDE 6.0.1.
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: How to export the model to .LP file?

    Posted Mon November 10, 2008 07:48 PM

    Originally posted by: SystemAdmin


    [alain.chabrier said:]

    You can use the OPL setting in : Language / Run / Export format.

    Alain
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: How to export the model to .LP file?

    Posted Mon November 10, 2008 07:57 PM

    Originally posted by: SystemAdmin


    [jfk said:]

    hello there,
    in the IDE:
    1. you have to create a .ops (OPL setting file)
    2. put this .ops setting file into the runconfig from which you want to create an .lp file
    3. open the .ops file and go to the last element of the tree you see there named language>run
    4. at the end of the table you will see "export format" and the value is "no export"
    5. click on the value and choose the format what you like to generate in (there are lp, mps, sav, rlp, rew formats)
    6. run the runconfig: in the project browser the generated file should appear in your project directory among the files, but not under the runconfig from which you generated the file
    with oplrun:
    7. you can dump your model into the given extension mentioned above with oplrun: oplrun -e test.lp test.mod test.dat
    8. if the explanation above is too fuzzy please consult the doc at "ILOG OPL Development Studio 6.0 > Language > Parameters and settings in OPL > OPL language options" and "ILOG OPL Development Studio 6.1 > oplrun Command Line Interface > Syntax"

    I hope it helps
    cheers
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 4.  Re: How to export the model to .LP file?

    Posted Mon November 10, 2008 08:37 PM

    Originally posted by: SystemAdmin


    [homarjun.agrahari@bnsf.co said:]

    Thanks. It worked.
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 5.  Re: How to export the model to .LP file?

    Posted Sun May 20, 2012 05:26 AM

    Originally posted by: Maissa


    hi everyone,
    how can i export the matrix A,b and c in Excel file?
    Please help me SOON!
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 6.  Re: How to export the model to .LP file?

    Posted Sat October 25, 2014 10:55 PM

    Originally posted by: Afshin67


    Dear SystemAdmin,

     

    I want to run a constraint programming problem that I have created. I want to use the cplex which is installed in the servers of the university. I am connecting to the server using SSH Secure Shell, and by entering "cplex" the following comment are shown:

    Welcome to IBM(R) ILOG(R) CPLEX(R) Interactive Optimizer 12.5.1.0
      with Simplex, Mixed Integer & Barrier Optimizers
    **** ------- -A29 ****-Y48 ****-Y49 5724-Y54 5724-Y55 ****- ***
    Copyright IBM Corp. 1988, 2013.  All Rights Reserved.
     
    Type 'help' for a list of available commands.
    Type 'help' followed by a command name for more
    information on commands.
     

    The first question is how I can do the job?

    Also, as I imported my file and the related data on the server, I saw that I cannot use them on the cplex and it does not read mod file. Using above instruction I tried to change the file type, but I received the following error:

     

    {

    Bad extension passed to IloCP::exportModel
    }

     

    Also, as my search, I found the following script:

     

    main 
    { thisOplModel.generate(); cplex.exportModel(
    "f.lp"); cplex.exportModel(
    "f.mps"); 
    }

     

    By adding the script, I received the following error:

     

    {

    Execution of "main" failed: "C:\Users\Dell\AppData\Roaming\IBM\ILOG\CPLEX_Studio126\workspace\sched_flowshop\sched_flowshop.mod", line 49: unknown variable 'cplex'.

    }

     

    How I can execute my problem on the server? I could not find a proper command to this end. 

    Please guide me solve my problem.

     

    Thanks

    Afshin


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 7.  Re: How to export the model to .LP file?

    Posted Sun October 26, 2014 12:33 PM


  • 8.  Re: How to export the model to .LP file?

    Posted Sun October 26, 2014 01:04 PM

    Originally posted by: Afshin67


    Dear Alex,

     

    Thanks for your answer.

    using the instruction of the link, I created the CPO file. But when I want to upload my problem in the server of university, I only can use following file types using "read" command:

    'lp', 'mps', 'bas', 'min', 'net', 'prm', 'mst', 'ord', 'sav', or 'sol'.

    How, I can change my problem to one of these file types?

     

    Thanks,

    Afshin


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 9.  Re: How to export the model to .LP file?

    Posted Sun October 26, 2014 01:24 PM

    Hi

    then you should not use using CP; at the beginning of your mod file

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 10.  Re: How to export the model to .LP file?

    Posted Sun October 26, 2014 01:37 PM

    Originally posted by: Afshin67


    Hi Alex, 

     

    Is there any other way?

    Or, generally in Interactive Optimizer is it possible to run CP model or CP model that uses "Using CP"?

    My model is based on some variables that only work by "using CP;", and I cannot change them simply. It requires change all of my model. 

     

    Thanks,

    Afshin


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 11.  Re: How to export the model to .LP file?

    Posted Sun October 26, 2014 02:28 PM

    Hi

    in interactive you cannot call CP models

    But on your server you could run the .mod and the .dat

    Why do not you do that ?

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 12.  Re: How to export the model to .LP file?

    Posted Sun October 26, 2014 02:41 PM

    Originally posted by: Afshin67


     

    Hi Alex,

     

    I have some model in CP and I dont have licence in my pc. I can connect to the server and run my file, but there is still a problem.

    In addition, I am a teaching assistant for a course. Students must use CP in their course projects and they do not have the licence. and they cannot connect to the server directly and only can connect using interactive optimizer. I am responsible to create a situation that they connect to the servers and solve their problems.

    Is there any solution?

     

    Thanks,

    Afshin

     


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 13.  Re: How to export the model to .LP file?