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
6bfde678
Commit
6bfde678
authored
Sep 04, 2023
by
Allvey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
派车计划不匹配情况优化
parent
197d83a2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
19 deletions
+35
-19
group.py
core/group.py
+33
-19
submit.py
core/submit.py
+2
-0
No files found.
core/group.py
View file @
6bfde678
...
...
@@ -419,13 +419,13 @@ class GroupDispatcher:
for
truck_id
in
list
(
self
.
group
.
group_trucks
):
# construct CurrentTruck obj.
current_truck
=
self
.
truck_construct
(
truck_id
)
try
:
self
.
logger
.
info
(
f
'============================= 车辆调度开始 {current_truck.get_name()} ============================='
)
# construct CurrentTruck obj.
current_truck
=
self
.
truck_construct
(
truck_id
)
try
:
self
.
logger
.
info
(
f
'============================= 车辆调度开始 {current_truck.get_name()} ============================='
)
# 全智能模式
if
self
.
group
.
group_mode
==
1
:
self
.
logger
.
info
(
"调度模式:全智能模式调度"
)
...
...
@@ -449,13 +449,13 @@ class GroupDispatcher:
self
.
logger
.
info
(
"调度模式:分流配比模式调度"
)
self
.
ratio_mode
(
truck_id
,
truck_dispatch
,
current_truck
.
get_task
())
self
.
logger
.
info
(
f
'============================= 车辆调度结束 {current_truck.get_name()} ============================='
)
except
Exception
as
es
:
self
.
logger
.
error
(
"调度调用异常"
)
self
.
logger
.
error
(
es
)
self
.
logger
.
info
(
f
'============================= 车辆调度结束 {current_truck.get_name()} ============================='
)
self
.
logger
.
info
(
f
'================================== 分组调度结束 {self.group.group_name} =================================='
)
...
...
@@ -785,22 +785,36 @@ class GroupDispatcher:
current_truck_goto_excavator_id
=
None
current_load_area_id
=
None
else
:
# if excavator_index not in self.group.excavator_info.excavator_index_to_uuid_dict:
# # raise CoreException(111, f'excavator_index_to_uuid_dict 缺失 {excavator_index} 号挖机信息')
# self.logger.error(f'excavator_index_to_uuid_dict 缺失 {excavator_index} 号挖机信息')
current_truck_goto_excavator_id
=
self
.
group
.
excavator_info
.
excavator_index_to_uuid_dict
[
excavator_index
]
current_load_area_id
=
DispatchInfo
.
excavator_load_dict
[
current_truck_goto_excavator_id
]
if
excavator_index
not
in
self
.
group
.
excavator_info
.
excavator_index_to_uuid_dict
:
self
.
logger
.
error
(
f
'excavator_index_to_uuid_dict 缺失 {excavator_index} 号挖机信息'
)
current_truck_goto_excavator_id
=
None
else
:
current_truck_goto_excavator_id
=
self
.
group
.
excavator_info
.
excavator_index_to_uuid_dict
[
excavator_index
]
if
current_truck_goto_excavator_id
is
None
or
current_truck_goto_excavator_id
not
in
\
DispatchInfo
.
excavator_load_dict
:
self
.
logger
.
error
(
f
'excavator_load_dict 缺失 {current_truck_goto_excavator_id} 挖机信息'
)
current_load_area_id
=
None
else
:
current_load_area_id
=
DispatchInfo
.
excavator_load_dict
[
current_truck_goto_excavator_id
]
if
dump_index
==
-
1
:
current_truck_goto_dump_id
=
None
current_unload_area_id
=
None
else
:
# if dump_index not in self.group.dump_info.dump_index_to_uuid_dict:
# # raise CoreException(111, f'dump_index_to_uuid_dict 缺失 {dump_index} 号卸点信息')
# self.logger.error(f'dump_index_to_uuid_dict 缺失 {dump_index} 号卸点信息')
current_truck_goto_dump_id
=
self
.
group
.
dump_info
.
dump_index_to_uuid_dict
[
dump_index
]
current_unload_area_id
=
DispatchInfo
.
dump_unload_area_dict
[
current_truck_goto_dump_id
]
if
dump_index
not
in
self
.
group
.
dump_info
.
dump_index_to_uuid_dict
:
self
.
logger
.
error
(
f
'dump_index_to_uuid_dict 缺失 {dump_index} 号卸点信息'
)
current_truck_goto_dump_id
=
None
else
:
current_truck_goto_dump_id
=
self
.
group
.
dump_info
.
dump_index_to_uuid_dict
[
dump_index
]
if
current_truck_goto_dump_id
is
None
or
current_truck_goto_dump_id
not
in
\
DispatchInfo
.
dump_unload_area_dict
:
self
.
logger
.
error
(
f
'dump_unload_area_dict 缺失 {current_truck_goto_dump_id} 卸点信息'
)
current_unload_area_id
=
None
else
:
current_unload_area_id
=
DispatchInfo
.
dump_unload_area_dict
[
current_truck_goto_dump_id
]
# Construct a truck obj. and add it to group truck dictionary.
truck_info
=
CurrentTruck
(
truck_id
,
self
.
group
.
group_id
,
truck_trip
,
truck_task
,
...
...
core/submit.py
View file @
6bfde678
...
...
@@ -99,6 +99,7 @@ class DispatchSubmission:
# 查询车辆相关派车计划 dispatch_seq[next_excavator_id, next_unload_area_id]
if
dispatch_seq
[
1
]
is
None
or
(
dispatch_seq
[
1
]
not
in
DispatchInfo
.
unload_area_dump_dict
):
# 无法查询到目标卸载点
self
.
logger
.
error
(
"无法找到目标卸点"
)
item
=
(
session_mysql
.
query
(
DispatchSetting
)
.
filter_by
(
group_id
=
group_id
,
isdeleted
=
0
,
)
.
first
())
else
:
dump_id
=
DispatchInfo
.
unload_area_dump_dict
[
dispatch_seq
[
1
]]
...
...
@@ -152,6 +153,7 @@ class DispatchSubmission:
# 查询车辆相关派车计划 dispatch_seq[next_excavator_id, next_unload_area_id]
if
dispatch_seq
[
0
]
is
None
:
# 无法查询到目标挖机
self
.
logger
.
error
(
"无法找到目标挖机"
)
item
=
(
session_mysql
.
query
(
DispatchSetting
)
.
filter_by
(
group_id
=
group_id
,
isdeleted
=
0
,
)
.
first
())
else
:
excavator_id
=
dispatch_seq
[
0
]
...
...
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