Commit 07b16c59 authored by 张晓彤's avatar 张晓彤

周期读取路网数据更新

parent 01c5639d
......@@ -48,7 +48,8 @@ class Dispatcher:
self.truck.truck_para_period_update(self.dump, self.excavator)
self.truck.state_period_update()
if self.redispatch_active:
self.topo = graph_construct()
self.topo = Topo()
self.topo.generate_topo_graph()
else:
self.topo = None
......
......@@ -762,7 +762,7 @@ class GroupDispatcher:
truck_name = truck_uuid_to_name_dict[truck_id]
# 获取车辆当前派车计划
if truck_task in [0, 1, 5]:
if truck_task in [0, 1, 2]:
excavator_index = int(truck_trip[1])
dump_index = int(truck_trip[0])
......@@ -1214,6 +1214,7 @@ class GoThroughDispatcher:
def __init__(self, group: Group):
self.logger = get_logger("zxt.GoThroughDispatcher")
self.group = group
self.gothrough_check_lanes = []
def update_lanes_info(self):
......@@ -1397,75 +1398,6 @@ class GoThroughDispatcher:
self.logger.error(es)
return
# '''
# 2. 寻找车辆穿越装载区自动判定区域
# '''
# try:
# further_area_backtrack_node_id = further_entrance_node_id
# further_area_backtrack_lanes = []
# for truck_id in range(5):
# # 查询回溯路段对象
# item = session_postgre.query(Lane).filter_by(EndNodeId=further_area_backtrack_node_id).first()
# if item is None:
# break
# # 将路段Id加入回溯列表
# further_area_backtrack_lanes.append(str(item.Id))
# # 更新当前回溯节点
# further_area_backtrack_node_id = item.StartNodeId
#
# except Exception as es:
# self.logger.error("回溯近端装载路段异常")
# self.logger.error(es)
#
# try:
# lowest_common_ancestor = None
# closer_area_backtrack_node_id = closer_entrance_node_id
# closer_area_backtrack_lanes = []
# for truck_id in range(5):
# # 查询回溯路段对象
# item = session_postgre.query(Lane).filter_by(EndNodeId=closer_area_backtrack_node_id).first()
# if item is None:
# break
# # 若查询到共同祖先
# if str(item.Id) in further_area_backtrack_lanes:
# lowest_common_ancestor = item
# break
# # 将路段Id加入回溯列表
# closer_area_backtrack_lanes.append(str(item.Id))
# # 更新当前回溯节点
# closer_area_backtrack_node_id = item.StartNodeId
#
# # 交叉口路段
# cross_lane = str(lowest_common_ancestor.Id)
#
# except Exception as es:
# self.logger.error("回溯远端装载路段异常")
# self.logger.error(es)
# return
#
#
# self.logger.info("cross_lane")
# self.logger.info(cross_lane)
#
# # 截取远端入场点到交叉口的路段
# further_area_backtrack_lanes = further_area_backtrack_lanes[0:further_area_backtrack_lanes.index(cross_lane)]
#
# # 穿越装载区检查路段
# gothrough_check_lanes = [cross_lane]
#
# try:
# # 多回溯一个路段
# if lowest_common_ancestor.Length < 200:
# item = session_postgre.query(Lane).filter_by(EndNodeId=lowest_common_ancestor.StartNodeId).first()
# gothrough_check_lanes.append(item.Id)
#
# self.logger.info("gothrough_check_lanes")
# self.logger.info(gothrough_check_lanes)
#
# except Exception as es:
# self.logger.error("穿越装载区交叉口判断异常")
# self.logger.error(es)
'''
3. 调度判断逻辑
'''
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment