sasoptpy.Model.solve

Model.solve(self, **kwargs)[source]

Solves the model by calling CAS or SAS optimization solvers

Parameters
optionsdict, optional

Solver options as a dictionary object

submitboolean, optional

When set to True, calls the solver

namestring, optional

Name of the table

frameboolean, optional

When set to True, uploads the problem as a DataFrame in MPS format

dropboolean, optional

When set to True, drops the MPS table after solve (only CAS)

replaceboolean, optional

When set to True, replaces an existing MPS table (only CAS and MPS)

primalinboolean, optional

When set to True, uses initial values (only MILP)

verboseboolean, optional (experimental)

When set to True, prints the generated OPTMODEL code

Returns
solutionpandas.DataFrame

Solution of the optimization model

Notes

  • Some of the options listed under the options argument might not be passed, depending on which CAS action is being used.

  • The option argument should be a dictionary, where keys are option names. For example, m.solve(options={'maxtime': 600}) limits the solution time to 600 seconds.

  • See Solver Options for a list of solver options.

Examples

>>> m.solve()
NOTE: Initialized model food_manufacture_1
NOTE: Converting model food_manufacture_1 to DataFrame
NOTE: Added action set 'optimization'.
...
NOTE: Optimal.
NOTE: Objective = 107842.59259.
NOTE: The Dual Simplex solve time is 0.01 seconds.
>>> m.solve(options={'maxtime': 600})
>>> m.solve(options={'algorithm': 'ipm'})