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

Popular posts from this blog

java - Jasper subreport showing only one entry from the JSON data source when embedded in the Title band -

serialization - Convert Any type in scala to Array[Byte] and back -

SonarQube Plugin for Jenkins does not find SonarQube Scanner executable -