(class from pyomo.contrib.pyros.uncertainty_sets)
pyomo.contrib.pyros.uncertainty_sets
Bases: UncertaintySet
UncertaintySet
A discrete set of finitely many uncertain parameter realizations (or scenarios).
scenarios ((M, N) array_like) – A sequence of M distinct uncertain parameter realizations.
Examples
2D set with three scenarios:
>>> from pyomo.contrib.pyros import DiscreteScenarioSet >>> discrete_set = DiscreteScenarioSet( ... scenarios=[[1, 1], [2, 1], [1, 2]], ... ) >>> discrete_set.scenarios [(1, 1), (2, 1), (1, 2)]
Initialize self (see class docstring).
Methods
__init__(scenarios)
__init__
compute_auxiliary_uncertain_param_vals(point)
compute_auxiliary_uncertain_param_vals
Compute auxiliary uncertain parameter values for a given point.
is_bounded(config)
is_bounded
Return True if the uncertainty set is bounded, and False otherwise.
is_nonempty(config)
is_nonempty
Return True if the uncertainty set is nonempty, else False.
is_valid(config)
is_valid
Return True if the uncertainty set is bounded and non-empty, else False.
point_in_set(point)
point_in_set
Determine whether a given point lies in the discrete scenario set.
set_as_constraint([uncertain_params, block])
set_as_constraint
Construct a block of Pyomo constraint(s) defining the uncertainty set on variables representing the uncertain parameters, for use in a two-stage robust optimization problem or subproblem (such as a PyROS separation subproblem).
Attributes
dim
Dimension N of the discrete scenario set.
geometry
Geometry of the discrete scenario set.
parameter_bounds
Bounds in each dimension of the discrete scenario set.
scenarios
Uncertain parameter realizations comprising the set.
type
Brief description of the type of the uncertainty set.
Member Documentation
Compute auxiliary uncertain parameter values for a given point. The point need not be in the uncertainty set.
point ((N,) array-like) – Point of interest.
solver (Pyomo solver, optional) – If needed, a Pyomo solver with which to compute the auxiliary values.
aux_space_pt – Computed auxiliary uncertain parameter values.
numpy.ndarray
By default, the discrete scenario set is bounded, as the entries of all uncertain parameter scenarios are finite.
point ((N,) array-like) – Point (parameter value) of interest.
True if the point lies in the set, False otherwise.
bool
uncertain_params (None, Var, or list of Var, optional) – Variable objects representing the (main) uncertain parameters. If None is passed, then new variable objects are constructed.
block (BlockData or None, optional) – Block on which to declare the constraints and any new variable objects. If None is passed, then a new block is constructed.
A collection of the components added or addressed.
UncertaintyQuantification
int
Geometry of the discrete scenario set. See the Geometry class documentation.
List, length N, of 2-tuples. Each tuple specifies the bounds in its corresponding dimension.
list of tuples
Uncertain parameter realizations comprising the set. Each tuple is an uncertain parameter realization.
Note that the scenarios attribute may be modified, but only such that the dimension of the set remains unchanged.
str