LegacySolverWrapper
(class from pyomo.contrib.solver.base
)
- class pyomo.contrib.solver.base.LegacySolverWrapper(**kwargs)[source]
Bases:
object
Class to map the new solver interface features into the legacy solver interface. Necessary for backwards compatibility.
Methods
__init__
(**kwargs)available
([exception_flag])Returns a bool determining whether the requested solver is available on the system.
config_block
([init])Test if the solver license is valid on this system.
set_options
(options)solve
(model[, tee, load_solutions, logfile, ...])Solve method: maps new solve method style to backwards compatible version.
Member Documentation
- available(exception_flag=True)[source]
Returns a bool determining whether the requested solver is available on the system.
- license_is_valid() bool [source]
Test if the solver license is valid on this system.
Note that this method is included for compatibility with the legacy SolverFactory interface. Unlicensed or open source solvers will return True by definition. Licensed solvers will return True if a valid license is found.
- Returns:
available – True if the solver license is valid. Otherwise, False.
- Return type:
- solve(model: BlockData, tee: bool = False, load_solutions: bool = True, logfile: str | None = None, solnfile: str | None = None, timelimit: float | None = None, report_timing: bool = False, solver_io: str | None = None, suffixes: Sequence | None = None, options: Dict | None = None, keepfiles: bool = False, symbolic_solver_labels: bool = False, raise_exception_on_nonoptimal_result: bool = False, solver_options: Dict | None = None, writer_config: Dict | None = None)[source]
Solve method: maps new solve method style to backwards compatible version.
- Returns:
Legacy results object
- Return type:
legacy_results