4
$\begingroup$

I have a model written in CPLEX OPL. Is there a way to export the model to .cpo extension?

In Python docplex module the syntax is as:

mdl.export_as_cpo()

But I could not find an equivalent command for the OPL in the OPL User's manual.

$\endgroup$
  • 1
    $\begingroup$ Does this address your question ibm.com/support/knowledgecenter/SSSA5P_12.10.0/… ? $\endgroup$ – Mark L. Stone Dec 22 '19 at 21:46
  • $\begingroup$ @MarkL.Stone Thanks a lot. I think that would work. Probably I have confused .cpo and .ops that I could not find it. $\endgroup$ – Mostafa Dec 22 '19 at 22:03
  • 1
    $\begingroup$ @MarkL.Stone or Mostafa: Since the provided link seems to answer the question, would any of you mind writing that as an answer so that it can be voted/accepted? $\endgroup$ – EhsanK Dec 27 '19 at 21:14
  • 1
    $\begingroup$ @ EhsanK You can have the honor. To produce my comment above, I jdid a couple of sec of Googling and don't know a damn thing about it - hence I asked whether that link addressed the question, because I wasn;t sure. $\endgroup$ – Mark L. Stone Dec 27 '19 at 21:31
4
$\begingroup$

The steps taken from the IBM Knowledge Center are:

  • Create a new settings file
  • Change the export format to CPO
  • Add the settings file to the default run configuration
  • Run the run configuration

Thanks to @Mark L. Stone who provided the link.

$\endgroup$
4
$\begingroup$

Other options:

  1. Run your model from the command line using oplrun. Using option -d you can specify to dump your model into a cpo file.
  2. Specify environment variable ILC_MODEL_DUMP_FILE. Before solving the model CP Optimizer tests this variable and if present it dumps the current model into the specified file (the variable can also specify the path to the file). It works for all applications that are using CP Optimizer, not only for OPL.
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.