Module coinor.grumpy.examples.Dippy
Expand source code
from __future__ import print_function
DEBUGGING = False
import sys
#sys.path.append("C:\\COIN\\GIMPy\\GrUMPy\\trunk")
#sys.path.append("C:\\COIN\\GIMPy\\trunk")
from pulp import *
from coinor.dippy import DipProblem, Solve
prob = DipProblem("Dippy Example", display_mode = 'matplotlib',
display_interval = 1)
x1 = LpVariable("x_1", 0, None, LpInteger)
x2 = LpVariable("x_2", 0, cat=LpInteger)
prob += -x1 - x2, "min"
prob += -2 * x1 + 2 * x2 >= 1
prob += -8 * x1 + 10 * x2 <= 13
Solve(prob, {
'CutCGL': 0,
})
for var in prob.variables():
print(var.name, "=", var.value())
prob.Tree.display()
Functions
def maketrans(...)
-
Return a translation table usable for str.translate().
If there is only one argument, it must be a dictionary mapping Unicode ordinals (integers) or characters to Unicode ordinals, strings or None. Character keys will be then converted to ordinals. If there are two arguments, they must be strings of equal length, and in the resulting dictionary, each character in x will be mapped to the character at the same position in y. If there is a third argument, it must be a string, whose characters will be mapped to None in the result.