DefaultInitializer

(class from pyomo.core.base.initializer)

class pyomo.core.base.initializer.DefaultInitializer(initializer, default, exceptions)[source]

Bases: InitializerBase

Initializer wrapper that maps exceptions to default values.

Parameters:
  • initializer (:py:class`InitializerBase`) – the Initializer instance to wrap

  • default – the value to return inlieu of the caught exception(s)

  • exceptions (Exception or tuple) – the single Exception or tuple of Exceptions to catch and return the default value.

__init__(initializer, default, exceptions)[source]

Methods

__init__(initializer, default, exceptions)

constant()

Return True if this initializer is constant across all indices

contains_indices()

Return True if this initializer contains embedded indices

indices()

Return a generator over the embedded indices

Attributes

verified

Member Documentation

constant()[source]

Return True if this initializer is constant across all indices

contains_indices()[source]

Return True if this initializer contains embedded indices

indices()[source]

Return a generator over the embedded indices

This will raise a RuntimeError if this initializer does not contain embedded indices