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
8fb3447f
Commit
8fb3447f
authored
Jan 10, 2022
by
张晓彤
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改饱和度逻辑
parent
7fca8604
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
48 additions
and
17 deletions
+48
-17
algorithm.py
algorithm.py
+35
-6
dispatcher.py
dispatcher.py
+2
-2
group_control.py
group_control/group_control.py
+1
-1
path_plannner.py
path_plan/path_plannner.py
+9
-7
traffic_flow_info.py
traffic_flow/traffic_flow_info.py
+1
-1
No files found.
algorithm.py
View file @
8fb3447f
...
...
@@ -213,13 +213,25 @@ class ScheduleAlg(WalkManage):
excavator_hold_truck
=
self
.
_group
.
update_excavator_hold_truck
(
self
.
_truck
.
excavator_hold_truck_num
)[
group_id
]
# print(self._truck.payload)
# print(excavator_hold_truck)
# print(self._group.group_park_to_excavator[group_id].reshape(1, -1).flatten())
actual_flow_to_excavator
=
excavator_hold_truck
*
np
.
mean
(
self
.
_truck
.
payload
)
/
\
self
.
_group
.
group_park_to_excavator
[
group_id
]
.
reshape
(
1
,
-
1
)
.
flatten
()
allow_flow_to_excavator
=
self
.
_group
.
update_allow_flow_to_excavator
()[
group_id
]
saturation_value
=
(
1
-
(
actual_flow_to_excavator
+
0.01
)
/
(
allow_flow_to_excavator
+
0.01
))
/
transport_value
# 产量饱和度
saturation_value
=
1
-
(
actual_flow_to_excavator
+
0.01
)
/
(
allow_flow_to_excavator
+
0.01
)
# # 若产量欠饱和度异常小于0, 设为一个极小正值
# for val in flow_saturation.flatten():
# if val <= 0:
# val = 1 / M
#
# # 饱和度价值为产量饱和度与行驶成本之比值,行驶成本越小,欠缺饱和度越大,饱和度价值越大
# saturation_value = flow_saturation / transport_value
self
.
logger
.
info
(
f
'实际车流 {actual_flow_to_excavator}'
)
# self.logger.info(actual_flow_to_excavator)
...
...
@@ -244,13 +256,24 @@ class ScheduleAlg(WalkManage):
dump_hold_truck
=
self
.
_group
.
update_dump_hold_truck
(
self
.
_truck
.
dump_hold_truck_num
)[
group_id
]
actual_flow_to_dump
=
dump_hold_truck
*
self
.
_truck
.
payload
/
\
actual_flow_to_dump
=
dump_hold_truck
*
np
.
mean
(
self
.
_truck
.
payload
)
/
\
self
.
_group
.
group_walk_to_dump_cost
[
group_id
][:,
excavator_index
]
.
reshape
(
1
,
-
1
)
# allow_flow_to_dump = self.dump.dump_strength
allow_flow_to_dump
=
self
.
_group
.
update_allow_flow_to_dump
()[
group_id
]
saturation_value
=
(
1
-
(
actual_flow_to_dump
+
0.01
)
/
(
allow_flow_to_dump
+
0.01
))
/
transport_value
# saturation_value = (1 - (actual_flow_to_dump + 0.01) / (allow_flow_to_dump + 0.01)) / transport_value
# 产量饱和度
saturation_value
=
1
-
(
actual_flow_to_dump
+
0.01
)
/
(
allow_flow_to_dump
+
0.01
)
# # 若产量欠饱和度异常小于0, 设为一个极小正值
# for val in flow_saturation.flatten():
# if val <= 0:
# val = 1 / M
#
# # 饱和度价值为产量饱和度与行驶成本之比值,行驶成本越小,欠缺饱和度越大,饱和度价值越大
# saturation_value = flow_saturation / transport_value
self
.
logger
.
info
(
f
'实际车流 {actual_flow_to_dump}'
)
# self.logger.info(actual_flow_to_excavator)
...
...
@@ -276,12 +299,18 @@ class ScheduleAlg(WalkManage):
excavator_hold_truck
=
self
.
_group
.
update_excavator_hold_truck
(
self
.
_truck
.
excavator_hold_truck_num
)[
group_id
]
actual_flow_to_excavator
=
excavator_hold_truck
*
self
.
_truck
.
payload
/
\
actual_flow_to_excavator
=
excavator_hold_truck
*
np
.
mean
(
self
.
_truck
.
payload
)
/
\
self
.
_group
.
group_walk_to_excavator_cost
[
group_id
][
dump_index
,
:]
.
reshape
(
1
,
-
1
)
allow_flow_to_excavator
=
self
.
_group
.
update_allow_flow_to_excavator
()[
group_id
]
saturation_value
=
(
1
-
actual_flow_to_excavator
/
allow_flow_to_excavator
)
/
transport_value
# saturation_value = (1 - actual_flow_to_excavator / allow_flow_to_excavator) / transport_value
# 产量饱和度
saturation_value
=
1
-
(
actual_flow_to_excavator
+
0.01
)
/
(
allow_flow_to_excavator
+
0.01
)
# # 饱和度价值为产量饱和度与行驶成本之比值,行驶成本越小,欠缺饱和度越大,饱和度价值越大
# saturation_value = flow_saturation
self
.
logger
.
info
(
f
'实际车流 {actual_flow_to_excavator}'
)
# self.logger.info(actual_flow_to_excavator)
...
...
dispatcher.py
View file @
8fb3447f
...
...
@@ -207,7 +207,7 @@ class Dispatcher(WalkManage):
self
.
traffic_flow
.
update_actual_traffic_flow
()
# 获取路网加权行驶成本
self
.
cost_to_excavator
,
self
.
cost_to_dump
,
self
.
cost_park_to_excavator
=
self
.
path
.
walk_cost
()
self
.
cost_to_excavator
,
self
.
cost_to_dump
,
self
.
cost_park_to_excavator
=
self
.
path
.
walk_cost
_cal
()
# 调度分组更新
self
.
group
.
period_update
()
...
...
@@ -459,7 +459,7 @@ class Dispatcher(WalkManage):
self
.
group
.
group_excavator_index_to_uuid_dict
[
group_id
][
target
]]
except
Exception
as
es
:
self
.
logger
.
info
(
"trip出错1"
)
self
.
logger
.
error
(
"trip出错1"
)
self
.
logger
.
info
(
es
)
excavator_uuid_to_name_dict
=
get_value
(
"excavator_uuid_to_name_dict"
)
...
...
group_control/group_control.py
View file @
8fb3447f
...
...
@@ -209,7 +209,7 @@ class Group(WalkManage):
# 更新调度分组路网行驶成本
walk_to_excavator_cost
,
walk_to_dump_cost
,
park_to_excavator_cost
=
self
.
path
.
walk_cost
()
walk_to_excavator_cost
,
walk_to_dump_cost
,
park_to_excavator_cost
=
self
.
path
.
walk_cost
_cal
()
try
:
...
...
path_plan/path_plannner.py
View file @
8fb3447f
...
...
@@ -151,7 +151,7 @@ class PathPlanner(WalkManage):
return
lane_blockage
def
walk_cost
(
self
):
def
walk_cost
_cal
(
self
,
with_congestion
=
True
):
self
.
excavator
.
para_period_update
()
...
...
@@ -170,6 +170,8 @@ class PathPlanner(WalkManage):
# 计算行驶成本前,更新路网速度信息
self
.
lane
.
lane_speed_generate
()
# if with_congestion:
try
:
# 读取路网成本
for
walk_time
in
session_postgre
.
query
(
WalkTime
)
.
all
():
...
...
@@ -201,8 +203,8 @@ class PathPlanner(WalkManage):
# 路网权重
walk_to_excavator_weight
,
walk_to_dump_weight
,
park_walk_weight
=
self
.
controller
.
weighted_walk_calc
()
# 路网禁用关系
walk_available
=
self
.
controller
.
walk_available_calc
()
#
#
路网禁用关系
#
walk_available = self.controller.walk_available_calc()
# group_walk_available = self.controller.update_group_walk_available()
...
...
@@ -211,8 +213,8 @@ class PathPlanner(WalkManage):
logger
.
info
(
walk_to_dump_weight
)
logger
.
info
(
park_walk_weight
)
logger
.
info
(
"walk_avail"
)
logger
.
info
(
walk_available
)
#
logger.info("walk_avail")
#
logger.info(walk_available)
# except Exception as es:
# logger.error("无派车计划可用")
...
...
@@ -225,10 +227,10 @@ class PathPlanner(WalkManage):
logger
.
info
(
self
.
cost_to_excavator
)
# self.cost_to_excavator[i][j] = self.cost_to_load_area[unload_area_index][load_area_index] / walk_weight[i][j] + group_walk_available[i][j]
self
.
cost_to_excavator
[
i
][
j
]
=
self
.
cost_to_load_area
[
unload_area_index
][
load_area_index
]
/
\
walk_to_excavator_weight
[
i
][
j
]
+
walk_available
[
i
][
j
]
walk_to_excavator_weight
[
i
][
j
]
# self.cost_to_dump[i][j] = self.cost_to_unload_area[unload_area_index][load_area_index] / walk_weight[i][j] + walk_available[i][j] + group_walk_available[i][j]
self
.
cost_to_dump
[
i
][
j
]
=
self
.
cost_to_unload_area
[
unload_area_index
][
load_area_index
]
/
\
walk_to_dump_weight
[
j
][
i
]
+
walk_available
[
i
][
j
]
walk_to_dump_weight
[
j
][
i
]
for
j
in
range
(
get_value
(
"dynamic_excavator_num"
)):
load_area_index
=
self
.
excavator_index_to_load_area_index_dict
[
j
]
...
...
traffic_flow/traffic_flow_info.py
View file @
8fb3447f
...
...
@@ -168,7 +168,7 @@ class Traffic_para(WalkManage):
self
.
dump_strength
=
np
.
zeros
(
num_of_dump
)
# 卸载点的工作强度,单位是t/h
self
.
path_planner
=
PathPlanner
()
self
.
path_planner
.
walk_cost
()
self
.
path_planner
.
walk_cost
_cal
()
self
.
excavator_priority_coefficient
=
np
.
ones
(
num_of_excavator
)
# 每个电铲的优先级系数
self
.
excavator_material_priority
=
np
.
ones
(
num_of_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