0

I was wondering if anyone could guide me to obtain a kind of document that specifically contains all syntax of CPLEX library on Python 2.7. and probably an example to show the arguments. The syntax I am looking for is that I need to see just one or a range of constraints, but the following command presents all the model:

print(mdl.export_to_string())

I need to only see constraints e.g. in range 10 to 20. Thanks,

MOAR
  • 15
  • 6
  • Just to clarify it looks like you are using docplex rather than the CPLEX Python API. See [this](https://stackoverflow.com/questions/54891266) stackoverflow question for details on the differences. – rkersh Jun 27 '19 at 16:03
  • As far as I know, there is no way to export only a certain part of the model. However, if you use the [Model.export_to_stream](http://ibmdecisionoptimization.github.io/docplex-doc/mp/docplex.mp.model.html#docplex.mp.model.Model.export_to_stream) method you could potentially filter out the constraints you are interested in based on the naming pattern of your constraints. – rkersh Jun 27 '19 at 16:06

1 Answers1

1

The documentation for docplex.mp.model.Model is at http://ibmdecisionoptimization.github.io/docplex-doc/mp/docplex.mp.model.html. And the rest of the documentation is available from http://ibmdecisionoptimization.github.io/docplex-doc/.

Xavier Nodet
  • 5,033
  • 2
  • 37
  • 48
  • Since this is unrelated to the original question and code formatting is not done properly in comments, I suggest you start a new question. – Daniel Junglas Jun 28 '19 at 06:31
  • Also note that in a Python shell you can use the `help` function to get the reference documentation for all docplex classes. – Daniel Junglas Jun 28 '19 at 06:32