ScalarData
(class from pyomo.contrib.mpc.data.scalar_data
)
- class pyomo.contrib.mpc.data.scalar_data.ScalarData(data, time_set=None, context=None)[source]
Bases:
_DynamicDataBase
An object to store scalar data associated with time-indexed variables.
- __init__(data, time_set=None, context=None)[source]
Arguments:
- data: dict or ComponentMap
Maps variables, names, or CUIDs to lists of values
Methods
__init__
(data[, time_set, context])Arguments: data: dict or ComponentMap Maps variables, names, or CUIDs to lists of values
contains_key
(key[, context])Returns whether this object's dict contains the given key.
extract_variables
(variables[, context, ...])Return a new object that only keeps data values for the variables specified.
get_cuid
(key[, context])Get the time-indexed CUID corresponding to the provided key
get_data
()Return a dictionary mapping CUIDs to values
get_data_from_key
(key[, context])Returns the value associated with the given key.
Convert to json-serializable object.
update_data
(other[, context])Updates this object's data dict.
Member Documentation
- contains_key(key, context=None)
Returns whether this object’s dict contains the given key.
- extract_variables(variables, context=None, copy_values=False)
Return a new object that only keeps data values for the variables specified.
- get_cuid(key, context=None)
Get the time-indexed CUID corresponding to the provided key
- get_data()
Return a dictionary mapping CUIDs to values
- get_data_from_key(key, context=None)
Returns the value associated with the given key.
- update_data(other, context=None)
Updates this object’s data dict.