pywr.solvers package — Pywr 0.5dev documentation

# pywr.solvers package

## Submodules

## pywr.solvers.cython_glpk module

class `pywr.solvers.cython_glpk.` `AbstractNodeData`

  Bases: `object`

  `id`
  `is_link`

class `pywr.solvers.cython_glpk.` `CythonGLPKSolver`

  Bases: `object`

  `dump_glpk`()
  `dump_lp`()
  `dump_mps`()
  `reset`()
  `retry_solve`
  `route_flows_arr`
  `routes`
  `save_routes_flows`
  `setup`()
  `solve`()
  `stats`
  `use_presolve`

## pywr.solvers.cython_lpsolve module

class `pywr.solvers.cython_lpsolve.` `CythonLPSolveSolver`

  Bases: `object`

  `route_flows_arr`
  `routes`
  `save_routes_flows`
  `setup`()
  `solve`()
  `stats`

## Module contents

This module contains a Solver baseclass and several implemented subclasses.

Solvers are used to with pywr.core.Model classes to solve the network allocation problem every time step.

Currently there are only linear programme based solvers using,
  - GLPK
  - LPSolve55

class `pywr.solvers.` `CythonGLPKSolver`(*args, **kwargs)

  Bases: `pywr.solvers.Solver`

  Python wrapper of Cython GLPK solver.

  This is required to subclass Solver and get the metaclass magic.

  `dump_glpk`(filename)
  `dump_lp`(filename)
  `dump_mps`(filename)
  `name` = 'glpk'
  `reset`()
  `retry_solve`
  `routes`
  `routes_flows_array`
  `save_routes_flows`
  `setup`(model)
  `solve`(model)
  `stats`

class `pywr.solvers.` `CythonLPSolveSolver`(*args, **kwargs)

  Bases: `pywr.solvers.Solver`

  Python wrapper of Cython LPSolve55 solver.

  This is required to subclass Solver and get the metaclass magic.

  `name` = 'lpsolve'
  `reset`()
  `routes`
  `routes_flows_array`
  `save_routes_flows`
  `setup`(model)
  `solve`(model)
  `stats`

class `pywr.solvers.` `Solver`(*args, **kwargs)

  Bases: `object`

  Solver base class from which all solvers should inherit

  `name` = 'default'
  `reset`()
  `setup`(model)
  `solve`(model)
  `stats`