Commit f55a7eb9 authored by 张晓彤's avatar 张晓彤

二次调度异常处理

parent 8794c315
......@@ -49,7 +49,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
......
......@@ -1002,7 +1002,7 @@ class ReDispatcher:
current_excavator_id = truck_info.get_combined_excavator()
current_load_area_id = truck_info.get_combined_load_area()
self.logger.info(current_load_area_id)
self.logger.info(f'current_load_area_id {current_load_area_id}')
self.logger.info(f'truck_id {truck_id}')
self.logger.info(f'current_excavator_id {current_excavator_id}')
......@@ -1028,7 +1028,10 @@ class ReDispatcher:
best_excavator_id = self.get_best_excavator(current_excavator_id, truck_id, load_area_dict)
next_excavator_id = best_excavator_id
if next_excavator_id == current_excavator_id:
self.logger.info(f'best_excavator_id: {best_excavator_id}')
self.logger.info(f'current_excavator_id {current_excavator_id}')
if next_excavator_id != current_excavator_id:
truck_dispatch[truck_id] = [next_excavator_id, current_unload_area_id]
self.logger.info(f'二次调度结果 {truck_id}')
......
......@@ -194,7 +194,7 @@ class DispatchInfo:
for item in session_mysql.query(DispatchSetting).filter_by(isdeleted=0).all():
# add group_excavators
excavator_state = session_mysql.query(Equipment).filter_by(id=item.exactor_id).first()
if excavator_state is not None and excavator_state.disabled == 1:
# if excavator_state is not None and excavator_state.disabled == 1:
if item.group_id not in cls.group_excavator_dict.keys():
cls.group_excavator_dict[item.group_id] = [item.exactor_id]
else:
......@@ -212,7 +212,7 @@ class DispatchInfo:
# add dump
dump_state = session_mysql.query(Equipment).filter_by(id=item.dump_id).first()
if dump_state is not None and dump_state.disabled == 1:
# if dump_state is not None and dump_state.disabled == 1:
# add group_dumps
if item.group_id not in cls.group_dump_dict.keys():
cls.group_dump_dict[item.group_id] = [item.dump_id]
......@@ -223,7 +223,7 @@ class DispatchInfo:
# add truck
truck_state = session_mysql.query(Equipment).filter_by(id=item.truck_id).first()
if truck_state is not None and truck_state.disabled == 1:
# if truck_state is not None and truck_state.disabled == 1:
if item.group_id not in cls.group_truck_dict.keys():
cls.group_truck_dict[item.group_id] = [item.truck_id]
else:
......@@ -231,8 +231,8 @@ class DispatchInfo:
cls.group_truck_dict[item.group_id].append(item.truck_id)
cls.truck_group_dict[item.truck_id] = item.group_id
print("存在的分组")
print(cls.group_excavator_dict.keys())
logger.info("存在的分组")
logger.info(cls.group_excavator_dict.keys())
except Exception as es:
logger.error("挖机/卸载区/矿卡与group_id映射更新异常")
logger.error(es)
......
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