linopy.solvers.Solver#
- class linopy.solvers.Solver(model=None, io_api=None, options=<factory>)#
Abstract base class for solving a given linear problem.
Subclasses provide
_build_direct/_run_direct(when supporting the direct API) and_run_file(when supporting LP/MPS files). Construction goes viaSolver.from_name()orSolver.from_model().- __init__(model=None, io_api=None, options=<factory>)#
Methods
__init__([model, io_api, options])close()from_model(model[, io_api, options])Instantiate and build the solver against
model.from_name(name, model[, io_api, options])Construct and build the solver subclass registered as
name.Return True if this solver's package/binary is importable.
Probe license/runtime availability.
Features whose availability depends on the installed solver version or runtime environment.
safe_get_solution(status, func)Get solution from function call, if status is unknown still try to run it.
solve(**run_kwargs)Run the prepared solver and return a
Result.solve_problem([model, problem_fn, ...])Deprecated.
solve_problem_from_file(problem_fn[, ...])Deprecated shim that caches
problem_fnand runs via_run_file.solve_problem_from_model(model[, ...])Deprecated shim that builds via
_build_directand runs via_run_direct.All features supported by this solver, static plus runtime.
supports(feature)Check if this solver supports a given feature.
update_solver_model(model, **kwargs)Attributes
accepted_io_apisdisplay_nameenvfeaturesio_apimodelsensesolver_namesolver_optionsBack-compat alias for
self.options.options