时间序列数据
(类来自 pyomo.contrib.mpc.data.series_data)
- class pyomo.contrib.mpc.data.series_data.TimeSeriesData(data, time, time_set=None, context=None)[source]
基础类:
_DynamicDataBase一个用于存储与时间索引变量相关的时间序列数据的对象。
- Parameters:
data (dict 或 ComponentMap) – 将变量、名称或CUID映射到值列表
time (list) – 包含与变量数据点对应的时间点。
time_set (ContinuousSetData)
上下文 (BlockData)
方法
__init__(data, time[, time_set, context])concatenate(other[, tolerance])使用提供的TimeSeriesData中的时间点和变量值扩展时间列表和变量数据列表。
contains_key(key[, context])返回此对象的字典是否包含给定的键。
extract_variables(variables[, context, ...])仅保留指定的变量。
get_cuid(key[, context])获取与提供的键对应的时间索引CUID
get_data()返回一个将CUID映射到值的字典
get_data_at_time([时间, 容差])返回与提供的时间点或时间点相关联的数据。
get_data_at_time_indices(indices)返回此对象时间点列表中指定索引或索引处的数据。
get_data_from_key(key[, context])返回与给定键关联的值。
获取时间序列数据的时间点
shift_time_points(offset)对存储的时间点应用偏移量。
转换为可序列化为json的对象。
update_data(other[, context])更新此对象的数据字典。
成员文档
- concatenate(other, tolerance=0.0)[source]
使用提供的TimeSeriesData中的时间点和变量值扩展时间列表和变量数据列表。 新的时间点必须严格大于旧的时间点。
- contains_key(key, context=None)
返回此对象的字典是否包含给定的键。
- get_cuid(key, context=None)
获取与提供的键对应的时间索引CUID
- get_data()
返回一个将CUID映射到值的字典
- get_data_at_time(time=None, tolerance=0.0)[source]
返回与提供的时间点或时间点相关联的数据。 此函数尝试将时间点映射到索引,然后使用 get_data_at_time_indices 实际提取数据。如果提供的时间点 在时间索引映射中不存在,则使用二分搜索 在容差范围内找到最接近的值。
- Parameters:
time (Float 或 iterable) – 与返回数据对应的时间点或时间点集合。
tolerance (Float) – 我们将在此容差范围内搜索匹配的时间点。 默认值为0.0,意味着时间点必须精确指定。
- Returns:
仅包含指定时间点的TimeSeriesData 或将CUID映射到指定标量时间点值的字典。
- Return type:
- get_data_from_key(key, context=None)
返回与给定键关联的值。
- update_data(other, context=None)
更新此对象的数据字典。