Commit 35b28e4c authored by Allvey's avatar Allvey

new branch

parent 7376b7ca
#!E:\Pycharm Projects\Waytous
# -*- coding: utf-8 -*-
# @Time : 2021/7/26 14:35
# @Author : Opfer
# @Site :
# @File : path_plannner.py
# @Software: PyCharm
import numpy
from settings import *
from static_data_process import *
load_area_uuid_to_index_dict, unload_area_uuid_to_index_dict, \
load_area_index_to_uuid_dict, unload_area_index_to_uuid_dict = build_work_area_uuid_index_map()
load_area_num, unload_area_num = len(load_area_uuid_to_index_dict), len(unload_area_uuid_to_index_dict)
class PathPlanner:
def __init__(self):
# 路线行驶成本
self.rout_cost = np.array((unload_area_num, load_area_num))
# 路段集合
self.lane_set = {}
# 车辆长度
self.truck_length = 10
def path_cost_generate(self, path_id):
pass
def lane_cost_generate(self, lane_id):
# 道路长度
lane_length = 100
# 路段实际矿卡速度
actual_speed = 20
# 车辆自由行驶时的速度
clear_speed = 25
# 1. 计算阻塞时车辆密度
truck_density = lane_length / self.truck_length
# 2. 读取实际车流速度
actual_speed = 20
# 3. 计算路段阻塞程度
lane_blockage = (1 - actual_speed / clear_speed) * truck_density
This diff is collapsed.
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
# 数据库设备, redis设置, 日志设置 # 数据库设备, redis设置, 日志设置
from tables import * from tables import *
from urllib.parse import quote from urllib.parse import quote
import logging.handlers import logging.handlers
......
...@@ -124,7 +124,7 @@ def update_deveices_map(unload_area_uuid_to_index_dict, load_area_uuid_to_index_ ...@@ -124,7 +124,7 @@ def update_deveices_map(unload_area_uuid_to_index_dict, load_area_uuid_to_index_
load_area_uuid_to_index_dict[load_area_id] load_area_uuid_to_index_dict[load_area_id]
excavator_num = excavator_num + 1 excavator_num = excavator_num + 1
if excavator_num < 1 or dump_num < 1: if excavator_num < 1 or dump_num < 1:
raise Exception("无动态派车计划可用-动态派车挖机/卸映射失败") raise Exception("无动态派车计划可用-动态派车挖机/卸载设备映射失败")
except Exception as es: except Exception as es:
logger.warning(es) logger.warning(es)
...@@ -191,7 +191,7 @@ def update_autodisp_excavator(): ...@@ -191,7 +191,7 @@ def update_autodisp_excavator():
for item in session_mysql.query(Dispatch).filter_by(isdeleted=0, isauto=1).all(): for item in session_mysql.query(Dispatch).filter_by(isdeleted=0, isauto=1).all():
dynamic_excavator_list.append(item.exactor_id) dynamic_excavator_list.append(item.exactor_id)
if len(dynamic_excavator_list) < 1: if len(dynamic_excavator_list) < 1:
raise Exception("无动态派车计划可用-动态派车挖机/卸集合读取异常") raise Exception("无动态派车计划可用-动态派车挖机/卸载设备集合读取异常")
except Exception as es: except Exception as es:
logger.warning(es) logger.warning(es)
...@@ -205,7 +205,7 @@ def update_autodisp_dump(): ...@@ -205,7 +205,7 @@ def update_autodisp_dump():
for item in session_mysql.query(Dispatch).filter_by(isdeleted=0, isauto=1).all(): for item in session_mysql.query(Dispatch).filter_by(isdeleted=0, isauto=1).all():
dynamic_dump_list.append(item.dump_id) dynamic_dump_list.append(item.dump_id)
if len(dynamic_dump_list) < 1: if len(dynamic_dump_list) < 1:
raise Exception("无动态派车计划可用-动态派车挖机/卸集合读取异常") raise Exception("无动态派车计划可用-动态派车挖机/卸载设备集合读取异常")
except Exception as es: except Exception as es:
logger.warning(es) logger.warning(es)
return dynamic_dump_list return dynamic_dump_list
......
...@@ -209,6 +209,16 @@ class EquipmentPair(Base): ...@@ -209,6 +209,16 @@ class EquipmentPair(Base):
self.isdeleted = isdeleted self.isdeleted = isdeleted
self.createtime = createtime self.createtime = createtime
class Lane(Base):
# 表的名字
__tablename__ = 'Geo_Node'
Id = Column(VARCHAR(36), primary_key=True)
LaneIds = Column(VARCHAR(100))
def __init__(self, Id, LaneIds):
self.Id = Id
self.LaneIds = LaneIds
class Dispatch(Base): class Dispatch(Base):
# 表的名字: # 表的名字:
__tablename__ = 'sys_dispatch_setting' __tablename__ = 'sys_dispatch_setting'
......
This diff is collapsed.
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