generate_names

(function from pyomo.kernel.util)

pyomo.kernel.util.generate_names(node, convert=<class 'str'>, prefix='', **kwds)[source]

Generate names relative to this object for all objects stored under it.

This function is useful in situations where names are used often, but they do not need to be dynamically regenerated each time.

Parameters:
  • node – The root object below which names are generated.

  • convert (function) – A function that converts a storage key into a string representation. Default is str.

  • prefix (str) – A string to prefix names with.

  • **kwds – Additional keywords passed to the preorder_traversal function.

Returns:

A component map that behaves as a dictionary mapping objects to names.