ommx.adapter
============

.. py:module:: ommx.adapter


Attributes
----------

.. autoapisummary::

   ommx.adapter.SamplerInput
   ommx.adapter.SamplerOutput
   ommx.adapter.SolverInput
   ommx.adapter.SolverOutput


Exceptions
----------

.. autoapisummary::

   ommx.adapter.InfeasibleDetected
   ommx.adapter.NoSolutionReturned
   ommx.adapter.UnboundedDetected


Classes
-------

.. autoapisummary::

   ommx.adapter.SamplerAdapter
   ommx.adapter.SolverAdapter


Module Contents
---------------

.. py: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).


.. py: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.


.. py: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).


.. py:class:: SamplerAdapter(ommx_instance: ommx.v1.Instance)



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

   See the `implementation guide <https://jij-inc.github.io/ommx/en/user_guide/solver_adapter.html>`_ for more details.


   .. py:method:: decode(data: SolverOutput) -> ommx.v1.Solution
      :abstractmethod:



   .. py:method:: decode_to_sampleset(data: SamplerOutput) -> ommx.v1.SampleSet
      :abstractmethod:



   .. py:method:: sample(ommx_instance: ommx.v1.Instance) -> ommx.v1.SampleSet
      :classmethod:

      :abstractmethod:



   .. py:method:: solve(ommx_instance: ommx.v1.Instance) -> ommx.v1.Solution
      :classmethod:

      :abstractmethod:



   .. py:property:: sampler_input
      :type: SamplerInput

      :abstractmethod:



   .. py:property:: solver_input
      :type: SolverInput

      :abstractmethod:



.. py:class:: SolverAdapter(ommx_instance: ommx.v1.Instance)



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

   See the `implementation guide <https://jij-inc.github.io/ommx/en/user_guide/solver_adapter.html>`_ for more details.


   .. py:method:: decode(data: SolverOutput) -> ommx.v1.Solution
      :abstractmethod:



   .. py:method:: solve(ommx_instance: ommx.v1.Instance) -> ommx.v1.Solution
      :classmethod:

      :abstractmethod:



   .. py:property:: solver_input
      :type: SolverInput

      :abstractmethod:



.. py:data:: SamplerInput

.. py:data:: SamplerOutput

.. py:data:: SolverInput

.. py:data:: SolverOutput

