Documentation

tupledict()


tupledict()

tupledict ( args, kwargs )

tupledict constructor. Arguments are identical to those of a Python dict constructor.

Note that you will typically use Model.addVars to build a tupledict.

Arguments:

args: Positional arguments.

kwargs: Named arguments.

Return value:

A tupledict object.

Example usage:

  d = tupledict([((1,2), 'onetwo'), ((1,3), 'onethree'), ((2,3), 'twothree')])
  print(d[1,2]) # prints 'onetwo'