Commit 7dff71d4 authored by 张晓彤's avatar 张晓彤

添加实时调度, 添加代码注释

parent 88ffe739
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -12,7 +12,7 @@ from equipment.excavator import * ...@@ -12,7 +12,7 @@ from equipment.excavator import *
from para_config import * from para_config import *
class PriorityController(): class PriorityController:
def __init__(self, dump, excavator, truck): def __init__(self, dump, excavator, truck):
# 设备类 # 设备类
......
...@@ -18,6 +18,11 @@ from dispatcher import Dispatcher, PreSchedule ...@@ -18,6 +18,11 @@ from dispatcher import Dispatcher, PreSchedule
def process(dispatcher): def process(dispatcher):
"""
周期调度进程
:param dispatcher: (Dispatch Class) 矿卡调度类对象
:return: None
"""
try: try:
# 更新周期参数 # 更新周期参数
...@@ -41,14 +46,9 @@ def process(dispatcher): ...@@ -41,14 +46,9 @@ def process(dispatcher):
# 周期更新 # 周期更新
dispatcher.dispatcher_period_update() dispatcher.dispatcher_period_update()
# try:
# 调度计算 # 调度计算
dispatcher.schedule_construct() dispatcher.schedule_construct()
# except Exception as es:
# logger.error("更新不及时")
# logger.error(es)
logger.info("#####################################周期更新结束#####################################") logger.info("#####################################周期更新结束#####################################")
...@@ -101,7 +101,7 @@ if __name__ == "__main__": ...@@ -101,7 +101,7 @@ if __name__ == "__main__":
pre_sch = PreSchedule(truck, excavator, dump) pre_sch = PreSchedule(truck, excavator, dump)
# 实例化矿卡调度器 # 实例化矿卡调度器
dispatcher = Dispatcher(dump, excavator, truck, pre_sch) dispatcher = Dispatcher(dump, excavator, truck, pre_sch, False)
logger.info(" ") logger.info(" ")
logger.info("调度系统启动") logger.info("调度系统启动")
......
...@@ -121,7 +121,7 @@ def build_equipment_uuid_name_map(): ...@@ -121,7 +121,7 @@ def build_equipment_uuid_name_map():
raise Exception("无卸载设备可用") raise Exception("无卸载设备可用")
except Exception as es: except Exception as es:
logger.warning(es) logger.warning(es)
return excavator_uuid_to_name_dict,dump_uuid_to_name_dict return excavator_uuid_to_name_dict, dump_uuid_to_name_dict
def update_deveices_map(unload_area_uuid_to_index_dict, load_area_uuid_to_index_dict): def update_deveices_map(unload_area_uuid_to_index_dict, load_area_uuid_to_index_dict):
......
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