Understanding fragments of a Python/PuLP code -
i have adopt existing script used pulp package. need know how result of following line looks like:
unit = ["one", "two", "three"] time = range(10) status=lpvariable.dicts("status",[(f,g) f in unit g in time],0,1,lpbinary)
how keys/values looks like?
status["one"] = [0,1,1,1...]?
thank help!
from pulp import * unit = ["one", "two"] time = range(2) status=lpvariable.dicts("status",[(f,g) f in unit g in time],0,1,lpbinary)
leads
>>> status {('two', 1): status_('two',_1), ('two', 2): status_('two',_2), ('one', 2): status_('one',_2), ('one', 0): status_('one',_0), ('one', 1): status_('one',_1), ('two', 0): status_('two',_0)}
so, there no entry key "one".
Comments
Post a Comment