Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
integrated-scheduling
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张晓彤
integrated-scheduling
Commits
35b28e4c
Commit
35b28e4c
authored
Jul 30, 2021
by
Allvey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new branch
parent
7376b7ca
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
56 additions
and
4 deletions
+56
-4
path_plannner.py
path_plannner.py
+43
-0
realtime_dispatch.py
realtime_dispatch.py
+0
-0
settings.py
settings.py
+0
-1
static_data_process.py
static_data_process.py
+3
-3
tables.py
tables.py
+10
-0
traffic_flow_planner.py
traffic_flow_planner.py
+0
-0
No files found.
path_plannner.py
0 → 100644
View file @
35b28e4c
#!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
realtime_dispatch.py
View file @
35b28e4c
This diff is collapsed.
Click to expand it.
settings.py
View file @
35b28e4c
...
...
@@ -9,7 +9,6 @@
# 数据库设备, redis设置, 日志设置
from
tables
import
*
from
urllib.parse
import
quote
import
logging.handlers
...
...
static_data_process.py
View file @
35b28e4c
...
...
@@ -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
]
excavator_num
=
excavator_num
+
1
if
excavator_num
<
1
or
dump_num
<
1
:
raise
Exception
(
"无动态派车计划可用-动态派车挖机/卸
点
映射失败"
)
raise
Exception
(
"无动态派车计划可用-动态派车挖机/卸
载设备
映射失败"
)
except
Exception
as
es
:
logger
.
warning
(
es
)
...
...
@@ -191,7 +191,7 @@ def update_autodisp_excavator():
for
item
in
session_mysql
.
query
(
Dispatch
)
.
filter_by
(
isdeleted
=
0
,
isauto
=
1
)
.
all
():
dynamic_excavator_list
.
append
(
item
.
exactor_id
)
if
len
(
dynamic_excavator_list
)
<
1
:
raise
Exception
(
"无动态派车计划可用-动态派车挖机/卸
点
集合读取异常"
)
raise
Exception
(
"无动态派车计划可用-动态派车挖机/卸
载设备
集合读取异常"
)
except
Exception
as
es
:
logger
.
warning
(
es
)
...
...
@@ -205,7 +205,7 @@ def update_autodisp_dump():
for
item
in
session_mysql
.
query
(
Dispatch
)
.
filter_by
(
isdeleted
=
0
,
isauto
=
1
)
.
all
():
dynamic_dump_list
.
append
(
item
.
dump_id
)
if
len
(
dynamic_dump_list
)
<
1
:
raise
Exception
(
"无动态派车计划可用-动态派车挖机/卸
点
集合读取异常"
)
raise
Exception
(
"无动态派车计划可用-动态派车挖机/卸
载设备
集合读取异常"
)
except
Exception
as
es
:
logger
.
warning
(
es
)
return
dynamic_dump_list
...
...
tables.py
View file @
35b28e4c
...
...
@@ -209,6 +209,16 @@ class EquipmentPair(Base):
self
.
isdeleted
=
isdeleted
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
):
# 表的名字:
__tablename__
=
'sys_dispatch_setting'
...
...
traffic_flow_planner.py
View file @
35b28e4c
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment