Take the example SCIP code for ortools:
from ortools.linear_solver import pywraplp
solver = pywraplp.Solver.CreateSolver('SCIP')
infinity = solver.infinity()
# x and y are integer non-negative variables.
x = solver.IntVar(0.0, infinity, 'x')
y = solver.IntVar(0.0, infinity, 'y')
print('Number of variables =', solver.NumVariables())
# x + 7 * y <= 17.5.
solver.Add(x + 7 * y <= 17.5)
# x <= 3.5.
solver.Add(x <= 3.5)
print('Number of constraints =', solver.NumConstraints())
# Maximize x + 10 * y.
solver.Maximize(x + 10 * y)
I would like to export this as an MPS file. I can see
solver.ExportModelAsMpsFormat
exists but the only documentation I can find says
Signature: solver.ExportModelAsMpsFormat(fixed_format: 'bool', obfuscated: 'bool') -> 'std::string'
Docstring: <no docstring>
File: c:\users\csxrc\anaconda3\lib\site-packages\ortools\linear_solver\pywraplp.py
Type: method
I don't understand how to use it. For example how to specify the file name.
If I just wanted to save the model as an MPS file called "test.mps", say, what should I do?
Update
@Krerkkiat Chusap suggests calling the function to create a string that can be written separately. If I do
output_string = solver.ExportModelAsMpsFormat()
I get
TypeError: ExportModelAsMpsFormat() missing 2 required positional arguments: 'fixed_format' and 'obfuscated'
It seems both those arguments are Booleans. What do they signify?