LegacySolverWrapper

(class from pyomo.contrib.solver.common.base)

class pyomo.contrib.solver.common.base.LegacySolverWrapper(**kwargs)[source]

Bases: object

Class to map the new solver interface features into the legacy solver interface. Necessary for backwards compatibility.

__init__(**kwargs)[source]

Methods

__init__(**kwargs)

api_version()

Return the public API supported by this interface.

available([exception_flag])

Returns a bool determining whether the requested solver is available on the system.

config_block([init])

Preserves config backwards compatibility; allows new solver interfaces to be used in the pyomo solve call

default_variable_value()

license_is_valid()

Test if the solver license is valid on this system.

set_options(options)

Method to manually set options; can be called outside of the solve method

solve(model[, tee, load_solutions, logfile, ...])

Solve method: maps new solve method style to backwards compatible version.

warm_start_capable()

Member Documentation

classmethod api_version()[source]

Return the public API supported by this interface.

Returns:

A solver API enum object

Return type:

SolverAPIVersion

available(exception_flag=True)[source]

Returns a bool determining whether the requested solver is available on the system.

config_block(init=False)[source]

Preserves config backwards compatibility; allows new solver interfaces to be used in the pyomo solve call

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:

bool

set_options(options)[source]

Method to manually set options; can be called outside of the solve method

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