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
ff0044b7
Commit
ff0044b7
authored
Aug 29, 2023
by
Allvey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
处理车辆任务与派车计划不一致问题
parent
8ac576ea
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
21 deletions
+24
-21
config.json
config.json
+6
-5
group.py
core/group.py
+14
-12
submit.py
core/submit.py
+4
-4
No files found.
config.json
View file @
ff0044b7
{
{
"para"
:
{
"para"
:
{
"log_path"
:
"/usr/local/fleet-log/dispatch"
,
"log_path"
:
"/usr/local/fleet-log/dispatch"
,
"empty_speed"
:
120
,
"empty_speed"
:
25
,
"heavy_speed"
:
8
0
,
"heavy_speed"
:
2
0
,
"dump_target_mass"
:
5000
,
"dump_target_mass"
:
5000
,
"excavator_target_mass"
:
5000
"excavator_target_mass"
:
5000
},
},
"mysql"
:
{
"mysql"
:
{
"host"
:
"172.16.0.
103
"
,
"host"
:
"172.16.0.
51
"
,
"port"
:
"3306"
,
"port"
:
"3306"
,
"user"
:
"root"
,
"user"
:
"root"
,
"password"
:
"Huituo@123"
,
"password"
:
"Huituo@123"
,
"database"
:
"ht_zhunneng"
"database"
:
"ht_zhunneng"
},
},
"postgresql"
:
{
"postgresql"
:
{
"host"
:
"172.16.0.
103
"
,
"host"
:
"172.16.0.
51
"
,
"port"
:
"5432"
,
"port"
:
"5432"
,
"user"
:
"postgres"
,
"user"
:
"postgres"
,
"password"
:
"Huituo@123"
,
"password"
:
"Huituo@123"
,
"database"
:
"gis_zhunneng"
"database"
:
"gis_zhunneng"
},
},
"redis"
:
{
"redis"
:
{
"host"
:
"172.16.0.
103
"
,
"host"
:
"172.16.0.
51
"
,
"password"
:
"Huituo@123"
"password"
:
"Huituo@123"
}
}
}
}
\ No newline at end of file
core/group.py
View file @
ff0044b7
...
@@ -651,13 +651,6 @@ class GroupDispatcher:
...
@@ -651,13 +651,6 @@ class GroupDispatcher:
try
:
try
:
if
truck_id
in
self
.
group
.
truck
.
truck_excavator_bind
:
if
truck_id
in
self
.
group
.
truck
.
truck_excavator_bind
:
self
.
logger
.
info
(
"车辆存在绑定关系"
)
self
.
logger
.
info
(
"车辆存在绑定关系"
)
# try:
# if truck_id not in self.group.truck.truck_excavator_bind:
# raise CoreException(102, f'truck.group_excavators bind 中不存在 {truck_id}')
# except CoreException as es:
# es.with_traceback_info()
# self.logger.error(es)
# return
next_excavator_id
=
self
.
group
.
truck
.
truck_excavator_bind
[
truck_id
]
next_excavator_id
=
self
.
group
.
truck
.
truck_excavator_bind
[
truck_id
]
else
:
else
:
self
.
logger
.
info
(
"触发调度算法逻辑"
)
self
.
logger
.
info
(
"触发调度算法逻辑"
)
...
@@ -673,21 +666,31 @@ class GroupDispatcher:
...
@@ -673,21 +666,31 @@ class GroupDispatcher:
if
truck_task
==
-
2
:
if
truck_task
==
-
2
:
next_unload_area_id
=
"Park"
next_unload_area_id
=
"Park"
else
:
else
:
dump_id
=
get_value
(
"dump_index_to_uuid_dict"
)[
truck_trip
[
-
1
]]
if
truck_trip
[
-
1
]
!=
-
1
:
next_unload_area_id
=
get_value
(
"dump_uuid_to_unload_area_uuid_dict"
)[
dump_id
]
dump_id
=
get_value
(
"dump_index_to_uuid_dict"
)[
truck_trip
[
-
1
]]
next_unload_area_id
=
get_value
(
"dump_uuid_to_unload_area_uuid_dict"
)[
dump_id
]
else
:
# self.logger.error("车辆重载任务与派车计划不匹配")
raise
Exception
(
"车辆重载任务与派车计划不匹配"
)
# next_unload_area_id = "Park"
truck_dispatch
[
truck_id
]
=
[
next_excavator_id
,
next_unload_area_id
]
truck_dispatch
[
truck_id
]
=
[
next_excavator_id
,
next_unload_area_id
]
self
.
logger
.
info
(
f
'调度结果 next_excavator_id: '
self
.
logger
.
info
(
f
'调度结果 next_excavator_id: '
f
'{next_excavator_id} next_unload_area_id: {next_unload_area_id}'
)
f
'{next_excavator_id} next_unload_area_id: {next_unload_area_id}'
)
except
Exception
as
es
:
except
Exception
as
es
:
self
.
logger
.
error
(
"重载车辆全智能模式-计算异常"
)
self
.
logger
.
error
(
"空载车辆全智能模式-计算异常"
)
self
.
logger
.
error
(
es
.
__traceback__
.
tb_lineno
)
self
.
logger
.
error
(
es
)
self
.
logger
.
error
(
es
)
def
empty_period_dispatch
(
self
,
s
:
AlgorithmBase
,
truck_dispatch
:
Mapping
[
str
,
List
[
str
]],
truck_id
:
str
,
truck_info
:
CurrentTruck
,
def
empty_period_dispatch
(
self
,
s
:
AlgorithmBase
,
truck_dispatch
:
Mapping
[
str
,
List
[
str
]],
truck_id
:
str
,
truck_info
:
CurrentTruck
,
truck_trip
:
List
[
int
]):
truck_trip
:
List
[
int
]):
try
:
try
:
next_excavator_id
=
get_value
(
"excavator_index_to_uuid_dict"
)[
truck_trip
[
-
1
]]
if
truck_trip
[
-
1
]
!=
-
1
:
next_excavator_id
=
get_value
(
"excavator_index_to_uuid_dict"
)[
truck_trip
[
-
1
]]
else
:
raise
Exception
(
"车辆重载任务与派车计划不匹配"
)
next_unload_area_value
=
s
.
solve
(
truck_info
)
next_unload_area_value
=
s
.
solve
(
truck_info
)
if
truck_id
in
self
.
group
.
truck
.
truck_dump_bind
:
if
truck_id
in
self
.
group
.
truck
.
truck_dump_bind
:
...
@@ -715,7 +718,6 @@ class GroupDispatcher:
...
@@ -715,7 +718,6 @@ class GroupDispatcher:
self
.
logger
.
error
(
"空载车辆全智能模式-计算异常"
)
self
.
logger
.
error
(
"空载车辆全智能模式-计算异常"
)
self
.
logger
.
error
(
es
.
__traceback__
.
tb_lineno
)
self
.
logger
.
error
(
es
.
__traceback__
.
tb_lineno
)
self
.
logger
.
error
(
es
)
self
.
logger
.
error
(
es
)
truck_dispatch
[
truck_id
]
=
[
None
,
None
]
def
truck_construct
(
self
,
truck_id
):
def
truck_construct
(
self
,
truck_id
):
"""
"""
...
...
core/submit.py
View file @
ff0044b7
...
@@ -235,16 +235,16 @@ class DispatchSubmission:
...
@@ -235,16 +235,16 @@ class DispatchSubmission:
self
.
logger
.
info
(
"dispatch_plan_dict"
)
self
.
logger
.
info
(
"dispatch_plan_dict"
)
self
.
logger
.
info
(
dispatch_plan_dict
)
self
.
logger
.
info
(
dispatch_plan_dict
)
for
truck_id
,
dispatch_plan
in
dispatch_plan_dict
.
items
()
:
for
truck_id
in
group
.
group_trucks
:
try
:
try
:
if
truck_id
in
group
.
truck_info_list
:
if
truck_id
in
dispatch_plan_dict
and
truck_id
in
group
.
truck_info_list
:
self
.
logger
.
info
(
self
.
logger
.
info
(
f
'======================================= 派车计划写入 ======================================='
)
f
'======================================= 派车计划写入 ======================================='
)
self
.
truck_dispatch_to_redis
(
truck_id
,
group
.
truck_info_list
[
truck_id
],
dispatch_plan
,
group
.
group_mode
)
self
.
truck_dispatch_to_redis
(
truck_id
,
group
.
truck_info_list
[
truck_id
],
dispatch_plan
_dict
[
truck_id
]
,
group
.
group_mode
)
self
.
logger
.
info
(
self
.
logger
.
info
(
"======================================== 计划完成写入 ======================================="
)
"======================================== 计划完成写入 ======================================="
)
else
:
else
:
raise
Exception
(
"车辆对象信息不存在 group.truck_info_list"
)
raise
Exception
(
f
'车辆 {truck_id} 未正常生成派车计划'
)
except
Exception
as
es
:
except
Exception
as
es
:
# self.logger.error("group_dispatch_to_redis_error")
# self.logger.error("group_dispatch_to_redis_error")
self
.
logger
.
error
(
es
)
self
.
logger
.
error
(
es
)
...
...
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