variable

Contains classes for linear programming variables.

class pylp.variable.BinaryVariable(name: str = None)[source]

A variable that represents a binary variable.

ie: it only has two value: 0 or 1.

class pylp.variable.IntegerVariable(name: str = None)[source]

A variable that represents an integer number.

class pylp.variable.RealVariable(name: str = None)[source]

A variable that represents a real number.

class pylp.variable.Variable(*, name: str = None, category: str = 'Continuous')[source]

Represents a linear programming variable.

This is the parent class of all variable classes that you should be using. ie. do NOT use this class directly.

construct() → pulp.pulp.LpVariable[source]

Build the variable for use in the solver.

evaluate() → float[source]

The value of the variable found by the solver.

classmethod pulp_name() → str[source]

Return a unique name for a new variable.