# simulation.py中的全局变量
# reservoir basic height
RESERVOIR_BASIC_HEIGHT = float(250.35)
PATTERN_TIME_STEP = None # 浮点数
# 实时数据类：element_id和api_query_id对应
reservoirs_id = {}
tanks_id = {}
fixed_pumps_id ={}
variable_pumps_id = {}
pressure_id = {}
demand_id = {}
quality_id = {}
# 实时数据类：pattern_id和api_query_id对应
source_outflow_pattern_id = {}
realtime_pipe_flow_pattern_id = {}
pipe_flow_region_patterns = {}  # 根据realtime的pipe_flow，对non_realtime的demand进行分区
# 分区查询
source_outflow_region = {}  # 以绑定的管段作为value
source_outflow_region_id = {}  # 以api_query_id作为value
source_outflow_region_patterns = {}  # 以associated_pattern作为value
# 非实时数据的pattern
non_realtime_region_patterns = {}  # 基于source_outflow_region进行区分
realtime_region_pipe_flow_and_demand_id = {}  # 基于source_outflow_region搜索该分区中的实时pipe_flow和demand的api_query_id，后续用region的流量 - 实时流量计的流量
realtime_region_pipe_flow_and_demand_patterns = {}  # 基于source_outflow_region搜索该分区中的实时pipe_flow和demand的associated_pattern，后续用region的流量 - 实时流量计的流量
# ---------------------------------------------------------
# 历史数据访问相关全局变量
# 全局变量，用于存储不同类型的 realtime api_query_id
reservoir_liquid_level_realtime_ids = []
tank_liquid_level_realtime_ids = []
fixed_pump_realtime_ids = []
variable_pump_realtime_ids = []
source_outflow_realtime_ids = []
pipe_flow_realtime_ids = []
pressure_realtime_ids = []
demand_realtime_ids = []
quality_realtime_ids = []
# transmission_frequency的最大值
transmission_frequency = None
hydraulic_timestep = None # 时间字符串
reservoir_liquid_level_non_realtime_ids = []
tank_liquid_level_non_realtime_ids = []
fixed_pump_non_realtime_ids = []
variable_pump_non_realtime_ids = []
source_outflow_non_realtime_ids = []
pipe_flow_non_realtime_ids = []
pressure_non_realtime_ids = []
demand_non_realtime_ids = []
quality_non_realtime_ids = []

# api_query_id和associated_element_id对应，不包含液位和泵
scheme_source_outflow_ids = {}
scheme_pipe_flow_ids = {}
scheme_pressure_ids = {}
scheme_demand_ids = {}
scheme_quality_ids = {}
