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
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-v3
Commits
23931c85
Commit
23931c85
authored
May 12, 2022
by
张晓彤
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
监控与计划不一致-跳过异常
parent
ff11acca
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
6 deletions
+45
-6
dispatcher.py
dispatcher.py
+36
-0
truck.py
equipment/truck.py
+4
-4
topo_graph.py
path_plan/topo_graph.py
+5
-2
No files found.
dispatcher.py
View file @
23931c85
...
...
@@ -230,26 +230,62 @@ class Dispatcher(WalkManage):
rule4
=
session_mysql
.
query
(
DispatchRule
)
.
filter_by
(
id
=
4
)
.
first
()
.
disabled
try
:
# 读取优先级设置
excavator_priority_coefficient
=
self
.
excavator
.
excavator_priority_coefficient
excavator_material_priority
=
self
.
excavator
.
excavator_material_priority
except
Exception
as
es
:
self
.
logger
.
error
(
"挖机优先级信息读取异常"
)
self
.
logger
.
error
(
es
)
try
:
# 矿卡序号
truck_index
=
self
.
truck
.
truck_uuid_to_index_dict
[
truck_id
]
except
Exception
as
es
:
self
.
logger
.
error
(
"矿卡基本信息读取异常"
)
self
.
logger
.
error
(
es
)
try
:
# 矿卡行程
trip
=
self
.
truck
.
get_truck_current_trip
()[
truck_index
]
except
Exception
as
es
:
self
.
logger
.
error
(
"矿卡行程读取异常"
)
self
.
logger
.
error
(
es
)
try
:
# 矿卡任务
task
=
self
.
truck
.
get_truck_current_task
()[
self
.
truck
.
truck_index_to_uuid_dict
[
truck_index
]]
except
Exception
as
es
:
self
.
logger
.
error
(
"矿卡任务读取异常"
)
self
.
logger
.
error
(
es
)
try
:
# 调度分组
group_id
=
self
.
group
.
dispatch_truck_group
[
truck_id
]
except
Exception
as
es
:
self
.
logger
.
error
(
"调度分组读取异常"
)
self
.
logger
.
error
(
es
)
try
:
# 记录当前调度车辆信息
current_truck
=
CurrentTruck
(
truck_id
,
group_id
,
trip
,
task
)
except
Exception
as
es
:
self
.
logger
.
error
(
"调度车辆对象构建异常"
)
self
.
logger
.
error
(
es
)
if
truck_id
not
in
self
.
group
.
dispatch_truck_group
:
self
.
logger
.
error
(
"无该矿卡"
)
return
-
1
...
...
equipment/truck.py
View file @
23931c85
...
...
@@ -390,7 +390,7 @@ class TruckInfo(WalkManage):
self
.
logger
.
error
(
es
)
continue
#
try:
try
:
# 若矿卡状态为空运(含装载出场)
if
task
in
[
0
,
1
,
2
]:
...
...
@@ -410,9 +410,9 @@ class TruckInfo(WalkManage):
# 其他状态,矿卡状态为-2,equipment_pair表不存在该矿卡
else
:
pass
#
except Exception as es:
# self.logger.error("矿卡行程读取
异常")
#
self.logger.error(es)
except
Exception
as
es
:
self
.
logger
.
error
(
"驶往设备矿卡数量统计
异常"
)
self
.
logger
.
error
(
es
)
print
(
"self.dump_hold_truck_num"
)
print
(
self
.
dump_hold_truck_num
)
...
...
path_plan/topo_graph.py
View file @
23931c85
...
...
@@ -18,7 +18,7 @@ class Topo():
def
__init__
(
self
):
# to unload graph
self
.
unload_G
=
nx
.
Graph
()
self
.
unload_G
=
nx
.
Graph
()
# 建立空的简单无向图
self
.
unload_G_nodes
=
np
.
array
(
self
.
unload_G
)
self
.
unload_G_num_of_nodes
=
self
.
unload_G
.
number_of_nodes
()
...
...
@@ -123,10 +123,11 @@ class Topo():
self
.
unload_G
.
add_node
(
Entrancenode_for_dump
,
name
=
'dump'
)
try
:
unload_saved_lane
=
[]
for
i
in
item
[
1
]:
for
i
in
item
[
1
]:
# for each lane in a to_unload route
i_startpoint
=
str
(
session_postgre
.
query
(
Lane
)
.
filter_by
(
Id
=
i
)
.
first
()
.
StartNodeId
)
i_endpoint
=
str
(
session_postgre
.
query
(
Lane
)
.
filter_by
(
Id
=
i
)
.
first
()
.
EndNodeId
)
# add [start_point, end_point, length, lane_id] to unload_saved_lane
unload_saved_lane
.
append
([
str
(
i_startpoint
),
str
(
i_endpoint
),
float
(
session_postgre
.
query
(
Lane
)
.
filter_by
(
Id
=
i
)
.
first
()
.
Length
),
i
])
# son_lane_num = sum(1 for i in session_postgre.query(Lane).filter_by(StartNodeId = i_endpoint).all())
son_lane_num
=
len
(
session_postgre
.
query
(
Lane
)
.
filter_by
(
StartNodeId
=
i_endpoint
)
.
all
())
...
...
@@ -136,6 +137,8 @@ class Topo():
# print("item",item[0])
# print(unload_saved_lane)
# print("\n")
# lanes dict {lane_id: length, length}
lanes
=
{}
for
lane_info
in
unload_saved_lane
:
lanes
[
lane_info
[
-
1
]]
=
list
([
lane_info
[
2
],
lane_info
[
2
]])
...
...
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