Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
integrated-scheduling-v3
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
1
Merge Requests
1
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-v3
Commits
3a116ab7
Commit
3a116ab7
authored
Jun 12, 2025
by
Allvey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复二次调度车辆走错装载区问题, 新增python库详见部署文档
parent
95606bae
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
42 additions
and
0 deletions
+42
-0
config.json
config.json
+3
-0
group.py
core/group.py
+7
-0
util.py
core/util.py
+20
-0
tables.py
tables.py
+12
-0
调度系统部署说明4.2.docx
调度系统部署说明4.2.docx
+0
-0
No files found.
config.json
View file @
3a116ab7
...
@@ -25,5 +25,8 @@
...
@@ -25,5 +25,8 @@
"redis"
:
{
"redis"
:
{
"host"
:
"172.16.0.53"
,
"host"
:
"172.16.0.53"
,
"password"
:
"Huituo@123"
"password"
:
"Huituo@123"
},
"geom"
:
{
"redispatch_minimal_distance"
:
40
}
}
}
}
core/group.py
View file @
3a116ab7
...
@@ -910,6 +910,13 @@ class ReDispatcher:
...
@@ -910,6 +910,13 @@ class ReDispatcher:
# 排除下一个路段阻塞的装载区
# 排除下一个路段阻塞的装载区
delete_congestion_load_area
(
congestion_lane_dict
,
load_area_dict
,
delete_congestion_load_area
(
congestion_lane_dict
,
load_area_dict
,
next_lane_load_area_dict
)
next_lane_load_area_dict
)
# 获取车辆经纬度信息
truck_prise_location
=
self
.
group
.
truck
.
truck_current_prise_location
[
truck_id
]
if
is_close_to_cross
(
truck_locate
,
truck_prise_location
):
self
.
logger
.
info
(
f
'距离过近无法触发二次调度'
)
return
False
self
.
logger
.
info
(
"剔除堵塞装载区"
)
self
.
logger
.
info
(
"剔除堵塞装载区"
)
self
.
logger
.
info
(
load_area_dict
)
self
.
logger
.
info
(
load_area_dict
)
# 获取最佳挖机
# 获取最佳挖机
...
...
core/util.py
View file @
3a116ab7
...
@@ -10,6 +10,8 @@ import requests
...
@@ -10,6 +10,8 @@ import requests
from
tables
import
*
from
tables
import
*
with
open
(
json_file
,
encoding
=
'UTF-8'
)
as
f
:
with
open
(
json_file
,
encoding
=
'UTF-8'
)
as
f
:
mysql_config
=
json
.
load
(
f
)[
"mysql"
]
mysql_config
=
json
.
load
(
f
)[
"mysql"
]
with
open
(
json_file
,
encoding
=
'UTF-8'
)
as
f
:
geom_config
=
json
.
load
(
f
)[
"geom"
]
# def redispatch_request(truck_id, excavator_id, unload_area_id):
# def redispatch_request(truck_id, excavator_id, unload_area_id):
...
@@ -68,6 +70,24 @@ def get_cross_next_lanes(truck_locate):
...
@@ -68,6 +70,24 @@ def get_cross_next_lanes(truck_locate):
return
next_lane_list
return
next_lane_list
def
is_close_to_cross
(
truck_locate
,
truck_prise_location
):
"""
:return:
"""
start_node_id
=
session_postgre
.
query
(
Lane
)
.
filter_by
(
Id
=
truck_locate
)
.
first
()
.
EndNodeId
start_node_gemo
=
str
(
session_postgre
.
query
(
Node
)
.
filter_by
(
Id
=
start_node_id
)
.
first
()
.
geom
)
coess_pos_xy
=
wkb
.
loads
(
start_node_gemo
)
cross_pos
=
[
coess_pos_xy
.
y
,
coess_pos_xy
.
x
]
from
haversine
import
haversine
truck_to_cross_point_dis
=
haversine
(
cross_pos
,
truck_prise_location
)
if
truck_to_cross_point_dis
*
1000
<
float
(
geom_config
[
'redispatch_minimal_distance'
]):
return
True
else
:
return
False
def
delete_congestion_load_area
(
congestion_lane_dict
,
load_area_dict
,
next_lane_load_area_dict
):
def
delete_congestion_load_area
(
congestion_lane_dict
,
load_area_dict
,
next_lane_load_area_dict
):
"""
"""
...
...
tables.py
View file @
3a116ab7
...
@@ -13,6 +13,8 @@ from sqlalchemy import Column, create_engine
...
@@ -13,6 +13,8 @@ from sqlalchemy import Column, create_engine
from
sqlalchemy
import
VARCHAR
,
DateTime
,
Float
,
Integer
,
BOOLEAN
from
sqlalchemy
import
VARCHAR
,
DateTime
,
Float
,
Integer
,
BOOLEAN
from
sqlalchemy.orm
import
sessionmaker
,
scoped_session
from
sqlalchemy.orm
import
sessionmaker
,
scoped_session
from
sqlalchemy.ext.declarative
import
declarative_base
from
sqlalchemy.ext.declarative
import
declarative_base
from
geoalchemy2
import
Geography
from
shapely
import
wkb
from
urllib.parse
import
quote
from
urllib.parse
import
quote
import
json
,
os
import
json
,
os
from
settings
import
*
from
settings
import
*
...
@@ -154,6 +156,16 @@ class Lane(Base):
...
@@ -154,6 +156,16 @@ class Lane(Base):
self
.
Type
=
Type
self
.
Type
=
Type
class
Node
(
Base
):
__tablename__
=
'Geo_Node'
Id
=
Column
(
VARCHAR
(
36
),
primary_key
=
True
)
geom
=
Column
(
Geography
(
"Point"
))
def
__init__
(
self
,
Id
,
geom
):
self
.
Id
=
Id
self
.
geom
=
geom
class
Dispatch
(
Base
):
class
Dispatch
(
Base
):
# 表的名字:
# 表的名字:
__tablename__
=
'sys_dispatch_setting'
__tablename__
=
'sys_dispatch_setting'
...
...
调度系统部署说明4.2.docx
View file @
3a116ab7
No preview for this file type
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