Topic
IC4NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
3 replies Latest Post - ‏2013-04-02T19:25:25Z by SystemAdmin
SystemAdmin
SystemAdmin
1883 Posts
ACCEPTED ANSWER

Pinned topic Using settings ops file in main block

‏2013-04-02T08:48:44Z |
Hi,

I have an OPL main block running my model, like the following

code
main {
var operSource = new IloOplModelSource("MyModel.mod");
var operDef = new IloOplModelDefinition(operSource);
var operCplex = new IloCplex();
var operOpl = new IloOplModel(operDef,operCplex);
operOpl.addDataSource(thisOplModel.dataElements);
operOpl.generate();
operCplex.solve();
}
[/code]

How do I attach an existing settings ops file to that cplex run?

Thanks,
Zahar
Updated on 2013-04-02T19:25:25Z at 2013-04-02T19:25:25Z by SystemAdmin
  • AlexFleischer
    AlexFleischer
    1126 Posts
    ACCEPTED ANSWER

    Re: Using settings ops file in main block

    ‏2013-04-02T10:15:13Z  in response to SystemAdmin
    Hi,

    instead you should use an IloOplProject and use a run configuration that contains the .ops

    regards
    • AlexFleischer
      AlexFleischer
      1126 Posts
      ACCEPTED ANSWER

      Re: Using settings ops file in main block

      ‏2013-04-02T10:26:09Z  in response to AlexFleischer
      Hi,

      let me an example.
      If you have in the volsay example a run configuration, run configuration, then you can call the .ops that in in this run configuration with:

      main { 
        var prj = new IloOplProject("../volsay");
        var rc=prj.makeRunConfiguration("Basic Configuration");
        rc.oplModel.generate();
        rc.cplex.solve();
        rc.oplModel.postProcess();
        
      }
      
      Updated on 2014-03-26T05:49:48Z at 2014-03-26T05:49:48Z by AlexFleischer