Commit a9c7933a authored by 虢奥's avatar 虢奥

增加二次调度

parent 9a5b62cd
......@@ -8,8 +8,7 @@
},
"mysql": {
"host": "172.16.0.51",
"port": "3306",
"user": "root",
"user": "root",
"password": "Huituo@123",
"database": "ht_zhunneng"
},
......
......@@ -583,6 +583,7 @@ class GroupDispatcher:
# 车辆位于装载区内, 调度车辆前往卸载区
elif truck_task in [0, 1, 2]:
# 判断是否开启穿越装载区调度
if truck_task == 0 and self.gothrough_active and truck_locate is not None:
self.logger.info("穿越装载区调度开启")
self.gothroghdispatcher.update_lanes_info()
......@@ -605,15 +606,33 @@ class GroupDispatcher:
if excavator_prise_location[0] != -1 and \
truck_prise_location[0] != -1 and \
haversine(excavator_prise_location, truck_prise_location) > 0.010 and \
haversine(excavator_prise_location, truck_prise_location) > 0.000 and \
truck_locate in self.gothroghdispatcher.closer_area_backtrack_lanes:
self.gothroghdispatcher.redispatch_request(request_truck_id=truck_id, truck=self.group.truck, truck_dispatch=truck_dispatch)
# 判断是否开启二次调度
elif self.group.topo is not None and truck_locate is not None:
self.logger.info("潜在二次调度车辆状态")
# 车辆当前位于交叉路口前,且排队等待
self.logger.info(f'车辆 {truck_name}')
self.logger.info(f'车辆位置 {truck_locate}')
self.logger.info(f'车辆状态 {self.group.truck.truck_current_state[truck_id]}')
self.logger.info(f'车辆临时 {truck_is_temp}')
self.logger.info(self.group.topo.cross_bf_lanes)
self.logger.info(self.group.truck.truck_current_state)
if (truck_locate in self.group.topo.cross_bf_lanes) and (not truck_is_temp):
self.logger.info("触发二次调度")
else:
self.logger.info("正常空载行驶,执行空载周期调度")
self.empty_period_dispatch(s, truck_dispatch, truck_id, truck_info, truck_trip)
try:
truck_info.redispatch =\
self.redispatcher.redispatch_to_excavator(truck_id, truck_dispatch, truck_locate,
truck_trip, truck_info)
except Exception as es:
self.logger.error("二次调度至装载点失败")
self.logger.error(es)
# 穿越调度和二次调度均不触发,正常空载调度
else:
self.logger.info("装载区内,执行空载周期调度")
self.logger.info("正常空载行驶,执行空载周期调度")
self.empty_period_dispatch(s, truck_dispatch, truck_id, truck_info, truck_trip)
# TODO:车辆在空载状态是否应该如何计算,是计算下一次卸载区还是继续计算当前最优挖机
......
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