psamm.lpsolver.qsoptex – QSopt_ex LP solver

Linear programming solver using QSopt_ex.

class psamm.lpsolver.qsoptex.Constraint(prob, name)

Represents a constraint in a qsoptex.Problem

class psamm.lpsolver.qsoptex.Problem(**kwargs)

Represents an LP-problem of a qsoptex.Solver

add_linear_constraints(*relations)

Add constraints to the problem

Each constraint is represented by a Relation, and the expression in that relation can be a set expression.

define(*names, **kwargs)

Define variable in the problem

Variables must be defined before they can be accessed by var() or set(). This function takes keyword arguments lower and upper to define the bounds of the variable (default: -inf to inf). The keyword argument types can be used to select the type of the variable (Only Continuous is suported).

has_variable(name)

Check whether variable is defined in the model.

qsoptex

The underlying qsoptex.ExactProblem object

set_linear_objective(expression)

Set linear objective of problem

set_objective(expression)

Set linear objective of problem

set_objective_sense(sense)

Set type of problem (maximize or minimize)

solve(sense=None)

Solve problem

class psamm.lpsolver.qsoptex.Result(prob)

Represents the solution to a qsoptex.Problem

This object will be returned from the Problem.solve() method or by accessing the Problem.result property after solving a problem. This class should not be instantiated manually.

Result will evaluate to a boolean according to the success of the solution, so checking the truth value of the result will immediately indicate whether solving was successful.

get_value(expression)

Return value of expression

status

Return string indicating the error encountered on failure

success

Return boolean indicating whether a solution was found

unbounded

Whether the solution is unbounded

class psamm.lpsolver.qsoptex.Solver

Represents an LP solver using QSopt_ex

create_problem(**kwargs)

Create a new LP-problem using the solver