optunity.solvers.solver_registry module

Module to take care of registering solvers for use in the main Optunity API.

Main functions in this module:

Module author: Marc Claesen

optunity.solvers.solver_registry.get(solver_name)[source]

Returns the class of the solver registered under given name.

Parameters:solver_name – name of the solver
Returns:the solver class
optunity.solvers.solver_registry.manual()[source]

Returns the general manual of Optunity, with a brief introduction of all registered solvers.

Returns:the manual as a list of strings (lines)
optunity.solvers.solver_registry.register_solver(name, desc_brief, desc_full)[source]

Class decorator to register a optunity.solvers.Solver subclass in the registry. Registered solvers will be available through Optunity’s main API functions, e.g. optunity.make_solver() and optunity.manual().

Parameters:
  • name – name to register the solver with
  • desc_brief – one-line description of the solver
  • desc_full – extensive description and manual of the solver returns a list of strings representing manual lines
Returns:

a class decorator to register solvers in the solver registry

The resulting class decorator attaches attributes to the class before registering:

_name:the name using which the solver is registered
_desc_full:extensive description and manual as list of strings (lines)
_desc_brief:attribute with one-line description

These attributes will be available as class properties.

optunity.solvers.solver_registry.solver_names()[source]

Returns a list of all registered solvers.