LegacySolverWrapper
(类来自 pyomo.contrib.solver.base)
- class pyomo.contrib.solver.base.LegacySolverWrapper(**kwargs)[source]
基础类:
object将新求解器接口功能映射到旧求解器接口的类。为了向后兼容性是必要的。
方法
__init__(**kwargs)available([exception_flag])返回一个布尔值,确定请求的求解器是否在系统上可用。
config_block([init])测试此系统上的求解器许可证是否有效。
set_options(options)solve(model[, tee, load_solutions, logfile, ...])解决方法:将新的解决方法样式映射到向后兼容的版本。
成员文档
- license_is_valid() bool[source]
测试此系统上的求解器许可证是否有效。
请注意,此方法是为了与旧版SolverFactory接口兼容而包含的。未授权或开源的求解器将默认返回True。如果找到有效的许可证,授权的求解器将返回True。
- Returns:
available – 如果求解器许可证有效,则为True。否则为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]
解决方法:将新的解决方法样式映射到向后兼容的版本。
- Returns:
旧版结果对象
- Return type:
legacy_results