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
061bed00
Commit
061bed00
authored
Nov 03, 2023
by
虢奥
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug修复
parent
be96e533
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
11 deletions
+16
-11
config.json
config.json
+3
-2
test.db
test.db
+0
-0
area_analysis.py
util/area_analysis.py
+13
-9
No files found.
config.json
View file @
061bed00
...
...
@@ -25,8 +25,8 @@
"password"
:
"Huituo@123"
},
"gothrough"
:
{
"closer_area_name"
:
"
1025装载区05
"
,
"further_area_name"
:
"
1025装载区-03
"
,
"closer_area_name"
:
"
装-2
"
,
"further_area_name"
:
"
装1
"
,
"factor"
:
"0.4"
}
}
\ No newline at end of file
test.db
View file @
061bed00
No preview for this file type
util/area_analysis.py
View file @
061bed00
...
...
@@ -114,25 +114,29 @@ def area_choose(excavators_id, closer_area_id, further_area_id, further_lane_set
# target_excavator = DispatchInfo.load_excavator_dict[closer_area_id]
# # truck_dispatch_to_redis(request_truck_id, group_id, DispatchInfo.load_excavator_dict[closer_area_id])
try
:
with
open
(
json_file
,
encoding
=
'UTF-8'
)
as
f
:
load_value
=
json
.
load
(
f
)
gothrough_config_area
=
load_value
[
"gothrough"
]
dispatch_factor
=
float
(
gothrough_config_area
[
"factor"
])
# 远端挖机空闲
if
further_excavator_state
==
0
and
goto_further_area_num
==
0
:
logger
.
info
(
"远端挖机空闲, 调度车辆前往远端装载区"
)
target_excavator
=
DispatchInfo
.
load_excavator_dict
[
further_area_id
]
# 近端挖机空闲
el
if
closer_excavator_state
==
0
:
logger
.
info
(
"近端挖机空闲, 调度车辆前往近端装载区
"
)
if
closer_excavator_state
==
0
:
logger
.
info
(
f
"穿越调度:近端挖机空闲, 调度车辆前往近端装载区,远端派车数量{goto_further_area_num},空载车总数{arrival_truck_num}
"
)
target_excavator
=
DispatchInfo
.
load_excavator_dict
[
closer_area_id
]
# truck_dispatch_to_redis(request_truck_id, group_id, DispatchInfo.load_excavator_dict[closer_area_id])
# 远端挖机空闲
elif
further_excavator_state
==
0
and
goto_further_area_num
==
0
:
logger
.
info
(
f
"穿越调度:远端挖机空闲, 调度车辆前往远端装载区,远端派车数量{goto_further_area_num},空载车总数{arrival_truck_num}"
)
target_excavator
=
DispatchInfo
.
load_excavator_dict
[
further_area_id
]
# 近端挖机不空闲但是远端挖机已满载
elif
closer_excavator_state
!=
0
and
goto_further_area_num
>=
int
(
dispatch_factor
*
arrival_truck_num
):
logger
.
info
(
"远端挖机满载, 调度车辆前往近端装载区
"
)
logger
.
info
(
f
"穿越调度:远端挖机满载, 调度车辆前往近端装载区,远端派车数量{goto_further_area_num},空载车总数{arrival_truck_num}
"
)
target_excavator
=
DispatchInfo
.
load_excavator_dict
[
closer_area_id
]
# 近端挖机满载,只能派往远端挖机
else
:
logger
.
info
(
"近端挖机满载, 调度车辆前往远端装载区
"
)
logger
.
info
(
f
"穿越调度:近端挖机满载, 调度车辆前往远端装载区,远端派车数量{goto_further_area_num},空载车总数{arrival_truck_num}
"
)
target_excavator
=
DispatchInfo
.
load_excavator_dict
[
further_area_id
]
# truck_dispatch_to_redis(request_truck_id, group_id, DispatchInfo.load_excavator_dict[further_area_id])
except
Exception
as
es
:
...
...
@@ -348,7 +352,7 @@ def get_excavator_state(excavator_id):
"""
try
:
logger
.
error
(
excavator_id
)
logger
.
info
(
excavator_id
)
device_name
=
session_mysql
.
query
(
Equipment
)
.
filter_by
(
id
=
excavator_id
,
device_type
=
2
)
.
first
()
.
device_name
key_value_dict
=
redis2
.
hgetall
(
device_name
)
...
...
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