ommx.adapter#

Attributes#

Exceptions#

InfeasibleDetected

Raised when the problem is proven to be infeasible.

NoSolutionReturned

Raised when no solution was returned.

UnboundedDetected

Raised when the problem is proven to be unbounded.

Classes#

SamplerAdapter

An abstract interface for OMMX Sampler Adapters, defining how samplers should be used with OMMX.

SolverAdapter

An abstract interface for OMMX Solver Adapters, defining how solvers should be used with OMMX.

Module Contents#

exception InfeasibleDetected#

Raised when the problem is proven to be infeasible.

This corresponds to Optimality.OPTIMALITY_INFEASIBLE and indicates that the mathematical model itself has no feasible solution. Should not be used when infeasibility cannot be proven (e.g., heuristic solvers).

exception NoSolutionReturned#

Raised when no solution was returned.

This indicates that the solver did not return any solution (whether feasible or not) (e.g., due to time limits). This does not prove that the mathematical model itself is infeasible.

exception UnboundedDetected#

Raised when the problem is proven to be unbounded.

This corresponds to Optimality.OPTIMALITY_UNBOUNDED and indicates that the mathematical model itself is unbounded. Should not be used when unboundedness cannot be proven (e.g., heuristic solvers).

class SamplerAdapter(ommx_instance: Instance)#

An abstract interface for OMMX Sampler Adapters, defining how samplers should be used with OMMX.

See the implementation guide for more details.

abstract decode(data: SolverOutput) Solution#
abstract decode_to_sampleset(data: SamplerOutput) SampleSet#
classmethod sample(ommx_instance: Instance) SampleSet#
Abstractmethod:

classmethod solve(ommx_instance: Instance) Solution#
Abstractmethod:

property sampler_input: SamplerInput#
Abstractmethod:

property solver_input: SolverInput#
Abstractmethod:

class SolverAdapter(ommx_instance: Instance)#

An abstract interface for OMMX Solver Adapters, defining how solvers should be used with OMMX.

See the implementation guide for more details.

abstract decode(data: SolverOutput) Solution#
classmethod solve(ommx_instance: Instance) Solution#
Abstractmethod:

property solver_input: SolverInput#
Abstractmethod:

SamplerInput#
SamplerOutput#
SolverInput#
SolverOutput#