Commit f124d78c authored by Allvey's avatar Allvey

调度算法优化

parent cb912b81
...@@ -4,7 +4,9 @@ ...@@ -4,7 +4,9 @@
"empty_speed": 10, "empty_speed": 10,
"heavy_speed": 10, "heavy_speed": 10,
"dump_target_mass": 5000, "dump_target_mass": 5000,
"excavator_target_mass": 5000 "excavator_target_mass": 5000,
"loading_time": 10,
"unloading_time": 20
}, },
"mysql": { "mysql": {
"host": "172.16.0.51", "host": "172.16.0.51",
......
...@@ -133,6 +133,8 @@ class PreSchedule: ...@@ -133,6 +133,8 @@ class PreSchedule:
excavator_uuid_to_name_dict = get_value("excavator_uuid_to_name_dict") excavator_uuid_to_name_dict = get_value("excavator_uuid_to_name_dict")
excavator_uuid_to_index_dict = get_value("excavator_uuid_to_index_dict")
try: try:
now = float( now = float(
...@@ -192,10 +194,11 @@ class PreSchedule: ...@@ -192,10 +194,11 @@ class PreSchedule:
count = 0 count = 0
self.logger.info("excavator_avl_ls") self.logger.info("excavator_avl_ls")
for excavator_id in self.excavator.excavator_uuid_to_index_dict.keys(): for excavator_id in excavator_uuid_to_index_dict.keys():
excavator_index = excavator_uuid_to_index_dict[excavator_id]
excavator_name = excavator_uuid_to_name_dict[excavator_id] excavator_name = excavator_uuid_to_name_dict[excavator_id]
self.logger.info(f'{excavator_name} {excavator_avl_ls[count]}') self.logger.info(f'{excavator_name} {excavator_avl_ls[excavator_index]}')
count += 1
# self.logger.info(get_value("dynamic_excavator_set")) # self.logger.info(get_value("dynamic_excavator_set"))
# self.logger.info(excavator_avl_ls) # self.logger.info(excavator_avl_ls)
except Exception as es: except Exception as es:
...@@ -232,6 +235,8 @@ class PreSchedule: ...@@ -232,6 +235,8 @@ class PreSchedule:
dump_uuid_to_name_dict = get_value("dump_uuid_to_name_dict") dump_uuid_to_name_dict = get_value("dump_uuid_to_name_dict")
dump_uuid_to_index_dict = get_value("dump_uuid_to_index_dict")
# try: # try:
now = float( now = float(
...@@ -264,12 +269,12 @@ class PreSchedule: ...@@ -264,12 +269,12 @@ class PreSchedule:
# if abs(self.truck_avl_time[int(tmp[truck_id][1])] - now) > 60: # if abs(self.truck_avl_time[int(tmp[truck_id][1])] - now) > 60:
# self.truck_avl_time[int(tmp[truck_id][1])] = now # self.truck_avl_time[int(tmp[truck_id][1])] = now
count = 0
self.logger.info("dump_avl_ls") self.logger.info("dump_avl_ls")
for dump_id in get_value("dynamic_dump_set"): for dump_id in dump_uuid_to_index_dict.keys():
dump_index = dump_uuid_to_index_dict[dump_id]
dump_name = dump_uuid_to_name_dict[dump_id] dump_name = dump_uuid_to_name_dict[dump_id]
self.logger.info(f'{dump_name} {dump_avl_ls[count]}') self.logger.info(f'{dump_name} {dump_avl_ls[dump_index]}')
count += 1
# self.logger.info(get_value("dynamic_dump_set")) # self.logger.info(get_value("dynamic_dump_set"))
# self.logger.info(dump_avl_ls) # self.logger.info(dump_avl_ls)
# except Exception as es: # except Exception as es:
......
...@@ -85,7 +85,7 @@ class DumpInfo(WalkManage): ...@@ -85,7 +85,7 @@ class DumpInfo(WalkManage):
# except Exception as es: # except Exception as es:
# self.logger.error(f"卸载设备 {dump_id} 卸载时间信息缺失, 已设为默认值(1min)") # self.logger.error(f"卸载设备 {dump_id} 卸载时间信息缺失, 已设为默认值(1min)")
# self.logger.error(es) # self.logger.error(es)
self.unloading_time[self.dump_uuid_to_index_dict[dump_id]] = 5.00 self.unloading_time[self.dump_uuid_to_index_dict[dump_id]] = unloading_time
# print("average_unload_time: ", self.unloading_time[self.dump_uuid_to_index_dict[dump_id]]) # print("average_unload_time: ", self.unloading_time[self.dump_uuid_to_index_dict[dump_id]])
# 更新卸载设备出入时间 # 更新卸载设备出入时间
......
...@@ -83,7 +83,7 @@ class ExcavatorInfo(WalkManage): ...@@ -83,7 +83,7 @@ class ExcavatorInfo(WalkManage):
self.logger.info(self.loading_time) self.logger.info(self.loading_time)
self.logger.info("excavator_uuid_to_index_dict") self.logger.info("excavator_uuid_to_index_dict")
self.logger.info(self.excavator_uuid_to_index_dict) self.logger.info(self.excavator_uuid_to_index_dict)
self.loading_time[self.excavator_uuid_to_index_dict[excavator_id]] = 3.00 self.loading_time[self.excavator_uuid_to_index_dict[excavator_id]] = loading_time
# 更新挖机设备出入时间 # 更新挖机设备出入时间
def update_excavator_entrance_exit_time(self): def update_excavator_entrance_exit_time(self):
......
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