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
348b6fa6
Commit
348b6fa6
authored
Oct 21, 2021
by
Allvey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复定铲派车解锁后无动态派车计划BUG
parent
64893550
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
33 additions
and
15 deletions
+33
-15
excavator.py
equipment/excavator.py
+2
-2
truck.py
equipment/truck.py
+2
-4
para_config.py
para_config.py
+11
-4
realtime_dispatch.py
realtime_dispatch.py
+2
-2
settings.py
settings.py
+1
-1
static_data_process.py
static_data_process.py
+15
-2
No files found.
equipment/excavator.py
View file @
348b6fa6
...
...
@@ -194,9 +194,9 @@ class ExcavatorInfo(WalkManage):
logger
.
info
(
rule7
)
# 装载周期参数
self
.
period_map_para_
load
()
self
.
period_map_para_
update
()
self
.
period_walk_para_
load
()
self
.
period_walk_para_
update
()
# 用于动态调度的挖机设备
self
.
dynamic_excavator_set
=
set
(
update_autodisp_excavator
())
...
...
equipment/truck.py
View file @
348b6fa6
...
...
@@ -416,8 +416,6 @@ class TruckInfo(WalkManage):
for
truck_id
in
self
.
dynamic_truck_set
:
truck_index
=
self
.
truck_uuid_to_index_dict
[
truck_id
]
if
truck_id
in
self
.
truck_dump_bind
:
unload_area_id
=
self
.
truck_dump_bind
[
truck_id
]
dump_material_id
=
session_postgre
.
query
(
DumpArea
)
.
filter_by
(
Id
=
unload_area_id
)
.
first
()
.
Material
...
...
@@ -524,9 +522,9 @@ class TruckInfo(WalkManage):
logger
.
info
(
"Para truck update!"
)
# 装载周期参数
self
.
period_map_para_
load
()
self
.
period_map_para_
update
()
self
.
period_walk_para_
load
()
self
.
period_walk_para_
update
()
# # 更新全部矿卡设备集合
# truck_set = set(update_total_truck())
...
...
para_config.py
View file @
348b6fa6
...
...
@@ -97,6 +97,9 @@ global_dict["dynamic_dump_set"] = dynamic_dump_set
global_dict
[
"dynamic_dump_num"
]
=
dynamic_dump_num
def
get_value
(
name
):
return
global_dict
[
name
]
# 设备映射类, 存储除工作区以外的映射关系
# 其余设备类继承该类
class
DeviceMap
:
...
...
@@ -188,9 +191,10 @@ class DeviceMap:
"dump_index_to_unload_area_index_dict"
]
truck_map_dict
=
update_truck_uuid_index_map
(
dynamic_truck_set
)
truck_map_dict
=
update_truck_uuid_index_map
(
get_value
(
"dynamic_truck_set"
)
)
self
.
truck_uuid_to_index_dict
=
truck_map_dict
[
"truck_uuid_to_index_dict"
]
self
.
truck_index_to_uuid_dict
=
truck_map_dict
[
"truck_index_to_uuid_dict"
]
def
period_map_para_load
(
self
):
...
...
@@ -443,9 +447,15 @@ def period_para_update():
# 矿卡集合
truck_set
=
set
(
update_total_truck
())
logger
.
info
(
"truck_set"
)
logger
.
info
(
truck_set
)
# 固定派车矿卡集合
fixed_truck_set
=
set
(
update_fixdisp_truck
())
logger
.
info
(
"fixed_truck_set"
)
logger
.
info
(
fixed_truck_set
)
# 动态派车矿卡集合
dynamic_truck_set
=
truck_set
.
difference
(
fixed_truck_set
)
...
...
@@ -490,6 +500,3 @@ def period_para_update():
logger
.
info
(
walk_manage
.
dump_uuid_to_index_dict
)
logger
.
info
(
"walk_manage.distance_park_to_excavator"
)
logger
.
info
(
walk_manage
.
distance_park_to_excavator
)
def
get_value
(
name
):
return
global_dict
[
name
]
realtime_dispatch.py
View file @
348b6fa6
...
...
@@ -745,7 +745,7 @@ class Dispatcher(WalkManage):
if
task
==
-
2
:
temp
[
i
]
=
temp
[
i
]
+
M
except
Exception
as
es
:
logger
.
info
(
"矿卡排序启动异常"
)
logger
.
error
(
"矿卡排序启动异常"
)
logger
.
error
(
es
)
index
=
np
.
argsort
(
temp
.
reshape
(
1
,
-
1
))
...
...
@@ -769,7 +769,7 @@ class Dispatcher(WalkManage):
Seq
[
truck_index
][
1
]
=
target_eq_index
except
Exception
as
es
:
logger
.
error
(
f
'矿卡 {truck_uuid_to_name_dict[self.truck_index_to_uuid_dict[truck]]} 派车计划计算异常'
)
logger
.
error
(
f
'矿卡 {truck_uuid_to_name_dict[self.truck_index_to_uuid_dict[truck
_index
]]} 派车计划计算异常'
)
logger
.
error
(
es
)
try
:
...
...
settings.py
View file @
348b6fa6
...
...
@@ -27,9 +27,9 @@ import time
log_path
=
"/usr/local/fleet-log/dispatch"
# 创建日志目录
if
not
os
.
path
.
exists
(
log_path
):
os
.
mkdir
(
log_path
)
# logging初始化工作
logging
.
basicConfig
()
...
...
static_data_process.py
View file @
348b6fa6
...
...
@@ -174,7 +174,7 @@ def update_total_truck():
try
:
query
=
np
.
array
(
session_mysql
.
query
(
Equipment
)
.
filter_by
(
device_type
=
1
,
isdeleted
=
0
,
disabled
=
0
)
.
filter_by
(
device_type
=
1
,
isdeleted
=
0
)
.
all
()
)
...
...
@@ -207,12 +207,25 @@ def update_fixdisp_truck():
for
item
in
query
:
fixed_truck_list
.
append
(
item
.
truck_id
)
rule5
=
session_mysql
.
query
(
DispatchRule
)
.
filter_by
(
id
=
5
)
.
first
()
.
disabled
if
not
rule5
:
query
=
np
.
array
(
session_mysql
.
query
(
Equipment
)
.
filter_by
(
device_type
=
1
,
isdeleted
=
0
,
disabled
=
1
)
.
all
()
)
for
item
in
query
:
fixed_truck_list
.
append
(
item
.
id
)
if
len
(
fixed_truck_list
)
<
1
:
raise
Exception
(
"无固定派车计划可用-固定派车矿卡集合读取异常"
)
except
Exception
as
es
:
logger
.
info
(
"派车计划读取"
)
logger
.
error
(
es
)
return
fixed_truck_list
return
set
(
fixed_truck_list
)
def
update_autodisp_excavator
():
...
...
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