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
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-v3
Commits
b95e895f
Commit
b95e895f
authored
Nov 11, 2021
by
张晓彤
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码优化
parent
de8e769f
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
203 additions
and
35 deletions
+203
-35
excavator.py
equipment/excavator.py
+11
-8
truck.py
equipment/truck.py
+103
-19
para_config.py
para_config.py
+21
-3
path_plannner.py
path_plan/path_plannner.py
+13
-0
priority_control.py
path_plan/priority_control.py
+18
-0
realtime_dispatch.py
realtime_dispatch.py
+0
-0
static_data_process.py
static_data_process.py
+10
-0
traffic_flow_info.py
traffic_flow/traffic_flow_info.py
+10
-0
traffic_flow_planner.py
traffic_flow/traffic_flow_planner.py
+17
-5
No files found.
equipment/excavator.py
View file @
b95e895f
...
@@ -16,9 +16,9 @@ class ExcavatorInfo(WalkManage):
...
@@ -16,9 +16,9 @@ class ExcavatorInfo(WalkManage):
# # 挖机集合
# # 挖机集合
# self.dynamic_excavator_set = set(update_autodisp_excavator())
# self.dynamic_excavator_set = set(update_autodisp_excavator())
# 装载设备数量
# 装载设备数量
self
.
dynamic_excavator_num
=
len
(
dynamic_excavator_set
)
self
.
dynamic_excavator_num
=
get_value
(
"dynamic_excavator_num"
)
# 用于动态调度的卸载设备集合
# 用于动态调度的卸载设备集合
self
.
dynamic_excavator_set
=
[]
self
.
dynamic_excavator_set
=
get_value
(
"dynamic_excavator_set"
)
# 开始时间
# 开始时间
self
.
start_time
=
datetime
.
now
()
self
.
start_time
=
datetime
.
now
()
# 装载时间
# 装载时间
...
@@ -141,7 +141,7 @@ class ExcavatorInfo(WalkManage):
...
@@ -141,7 +141,7 @@ class ExcavatorInfo(WalkManage):
logger
.
info
(
"dynamic_excavator_set"
)
logger
.
info
(
"dynamic_excavator_set"
)
logger
.
info
(
self
.
dynamic_excavator_set
)
logger
.
info
(
self
.
dynamic_excavator_set
)
for
excavator_id
in
self
.
dynamic_excavator_set
:
for
excavator_id
in
get_value
(
"dynamic_excavator_set"
)
:
item
=
session_mysql
.
query
(
Equipment
)
.
filter_by
(
id
=
excavator_id
)
.
first
()
item
=
session_mysql
.
query
(
Equipment
)
.
filter_by
(
id
=
excavator_id
)
.
first
()
logger
.
info
(
"excavator_priority_coefficient"
)
logger
.
info
(
"excavator_priority_coefficient"
)
logger
.
info
(
self
.
excavator_priority_coefficient
)
logger
.
info
(
self
.
excavator_priority_coefficient
)
...
@@ -194,14 +194,17 @@ class ExcavatorInfo(WalkManage):
...
@@ -194,14 +194,17 @@ class ExcavatorInfo(WalkManage):
logger
.
info
(
rule7
)
logger
.
info
(
rule7
)
# 装载周期参数
# 装载周期参数
self
.
period_map_para_
update
()
self
.
period_map_para_
load
()
self
.
period_walk_para_update
()
print
(
"truck.excavator_uuid_index_dict"
)
print
(
self
.
excavator_uuid_to_index_dict
)
# 用于动态调度的挖机设备
self
.
period_walk_para_load
()
self
.
dynamic_excavator_set
=
set
(
update_autodisp_excavator
())
self
.
dynamic_excavator_num
=
len
(
self
.
dynamic_excavator_set
)
# # 用于动态调度的挖机设备
# self.dynamic_excavator_set = set(update_autodisp_excavator())
#
# self.dynamic_excavator_num = len(self.dynamic_excavator_set)
# 计算平均装载时间
# 计算平均装载时间
self
.
update_excavator_loadtime
()
self
.
update_excavator_loadtime
()
...
...
equipment/truck.py
View file @
b95e895f
...
@@ -132,6 +132,12 @@ class TruckInfo(WalkManage):
...
@@ -132,6 +132,12 @@ class TruckInfo(WalkManage):
self
.
truck_current_task
=
{}
self
.
truck_current_task
=
{}
device_name_set
=
redis2
.
keys
()
device_name_set
=
redis2
.
keys
()
print
(
"tast_truck_set"
)
print
(
get_value
(
"dynamic_truck_set"
))
## 两个
print
(
self
.
dynamic_truck_set
)
print
(
self
.
truck_uuid_to_index_dict
)
for
item
in
device_name_set
:
for
item
in
device_name_set
:
try
:
try
:
item
=
item
.
decode
(
encoding
=
"utf-8"
)
item
=
item
.
decode
(
encoding
=
"utf-8"
)
...
@@ -150,6 +156,23 @@ class TruckInfo(WalkManage):
...
@@ -150,6 +156,23 @@ class TruckInfo(WalkManage):
logger
.
info
(
"矿卡当前任务:"
)
logger
.
info
(
"矿卡当前任务:"
)
logger
.
info
(
self
.
truck_current_task
)
logger
.
info
(
self
.
truck_current_task
)
# self.truck_current_task = {}
#
# dynamic_truck_set = get_value("dynamic_truck_set")
#
# for item in dynamic_truck_set:
# # try:
# # item = item.decode(encoding="utf-8")
# key_value_dict = redis2.hgetall(item) # reids str可以自动转为bytes
# currentTask = int(key_value_dict[str_to_byte("currentTask")])
# self.truck_current_task[item] = currentTask
# # except Exception as es:
# # logger.error("读取矿卡任务异常-reids读取异常")
# # logger.error(es)
#
# logger.info("矿卡当前任务:")
# logger.info(self.truck_current_task)
# 更新矿卡最后装载/卸载时间
# 更新矿卡最后装载/卸载时间
def
update_truck_last_leave_time
(
self
):
def
update_truck_last_leave_time
(
self
):
self
.
last_load_time
=
{}
self
.
last_load_time
=
{}
...
@@ -500,6 +523,8 @@ class TruckInfo(WalkManage):
...
@@ -500,6 +523,8 @@ class TruckInfo(WalkManage):
def
update_truck_material
(
self
):
def
update_truck_material
(
self
):
try
:
self
.
truck_material_bind
=
{}
self
.
truck_material_bind
=
{}
self
.
update_truck_excavator_bind
()
self
.
update_truck_excavator_bind
()
self
.
update_truck_dump_area_bind
()
self
.
update_truck_dump_area_bind
()
...
@@ -540,6 +565,9 @@ class TruckInfo(WalkManage):
...
@@ -540,6 +565,9 @@ class TruckInfo(WalkManage):
dump_index
=
self
.
dump_uuid_to_index_dict
[
dump_id
]
dump_index
=
self
.
dump_uuid_to_index_dict
[
dump_id
]
if
dump_material_id
!=
material
:
if
dump_material_id
!=
material
:
self
.
dump_material_bind_modify
[
truck_index
][
dump_index
]
=
1000000
self
.
dump_material_bind_modify
[
truck_index
][
dump_index
]
=
1000000
except
Exception
as
es
:
logger
.
error
(
es
)
logger
.
error
(
"矿卡物料更新异常"
)
def
update_truck_spec
(
self
):
def
update_truck_spec
(
self
):
for
truck_id
in
self
.
dynamic_truck_set
:
for
truck_id
in
self
.
dynamic_truck_set
:
...
@@ -621,6 +649,54 @@ class TruckInfo(WalkManage):
...
@@ -621,6 +649,54 @@ class TruckInfo(WalkManage):
# 设备优先级启用
# 设备优先级启用
rule6
=
session_mysql
.
query
(
DispatchRule
)
.
filter_by
(
id
=
6
)
.
first
()
.
disabled
rule6
=
session_mysql
.
query
(
DispatchRule
)
.
filter_by
(
id
=
6
)
.
first
()
.
disabled
# logger.info("Para truck update!")
#
# # 装载周期参数
# self.period_map_para_load()
#
# self.period_walk_para_load()
#
# # 更新有效载重
# self.update_truck_payload()
#
# logger.info("距离成本规则")
# logger.info(rule1)
#
# logger.info("拥堵成本规则")
# logger.info(rule2)
#
# logger.info("车流规划规则")
# logger.info(rule3 or rule4)
#
# logger.info("生产组织规则")
# logger.info(rule5)
#
# logger.info("设备优先级规则")
# logger.info(rule6)
#
# if not rule5:
# # 更新绑定关系
# self.update_truck_dump_area_bind()
#
# self.update_truck_excavator_bind()
#
# # 更新禁止关系
# self.update_truck_excavator_exclude()
#
# if not rule6:
# # 更新矿卡调度优先级
# self.update_truck_priority()
#
# # # 更新矿卡group
# # self.update_truck_group()
#
# # 更新矿卡物料类型
# self.update_truck_material()
# 物料优先级启用
rule7
=
session_mysql
.
query
(
DispatchRule
)
.
filter_by
(
id
=
7
)
.
first
()
.
disabled
logger
.
info
(
"Para truck update!"
)
logger
.
info
(
"Para truck update!"
)
# 装载周期参数
# 装载周期参数
...
@@ -631,39 +707,47 @@ class TruckInfo(WalkManage):
...
@@ -631,39 +707,47 @@ class TruckInfo(WalkManage):
# 更新有效载重
# 更新有效载重
self
.
update_truck_payload
()
self
.
update_truck_payload
()
logger
.
info
(
"距离成本规则"
)
if
rule1
:
logger
.
info
(
rule1
)
logger
.
info
(
"距离成本规则未启用"
)
else
:
logger
.
info
(
"拥堵成本规则"
)
logger
.
info
(
"距离成本规则启用"
)
logger
.
info
(
rule2
)
logger
.
info
(
"车流规划规则"
)
logger
.
info
(
rule3
or
rule4
)
logger
.
info
(
"生产组织规则"
)
if
rule2
:
logger
.
info
(
rule5
)
logger
.
info
(
"拥堵成本规则未启用"
)
else
:
logger
.
info
(
"拥堵成本规则启用"
)
logger
.
info
(
"设备优先级规则"
)
if
rule3
or
rule4
:
logger
.
info
(
rule6
)
logger
.
info
(
"车流规划规则未启用"
)
else
:
logger
.
info
(
"车流规划规则启用"
)
if
not
rule5
:
if
rule5
:
logger
.
info
(
"生产组织规则未启用"
)
else
:
# 更新绑定关系
# 更新绑定关系
self
.
update_truck_dump_area_bind
()
self
.
update_truck_dump_area_bind
()
self
.
update_truck_excavator_bind
()
self
.
update_truck_excavator_bind
()
# 更新禁止关系
# 更新禁止关系
self
.
update_truck_excavator_exclude
()
self
.
update_truck_excavator_exclude
()
logger
.
info
(
"生产组织规划规则启用"
)
if
not
rule6
:
if
rule6
:
logger
.
info
(
"设备优先级规则未启用"
)
else
:
# 更新矿卡调度优先级
# 更新矿卡调度优先级
self
.
update_truck_priority
()
self
.
update_truck_priority
()
logger
.
info
(
"设备优先级规则启用"
)
# # 更新矿卡group
if
rule7
:
# self.update_truck_group(
)
logger
.
info
(
"物料优先级规则未启用"
)
else
:
# 更新矿卡物料类型
# 更新矿卡物料类型
self
.
update_truck_material
()
self
.
update_truck_material
()
logger
.
info
(
"物料优先级规则启用"
)
def
state_period_update
(
self
):
def
state_period_update
(
self
):
...
...
para_config.py
View file @
b95e895f
...
@@ -174,6 +174,10 @@ class DeviceMap:
...
@@ -174,6 +174,10 @@ class DeviceMap:
self
.
excavator_uuid_to_index_dict
=
device_map_dict
[
self
.
excavator_uuid_to_index_dict
=
device_map_dict
[
"excavator_uuid_to_index_dict"
"excavator_uuid_to_index_dict"
]
]
print
(
"device.dump_uuid_to_index_dict"
)
print
(
self
.
dump_uuid_to_index_dict
)
self
.
dump_uuid_to_index_dict
=
device_map_dict
[
"dump_uuid_to_index_dict"
]
self
.
dump_uuid_to_index_dict
=
device_map_dict
[
"dump_uuid_to_index_dict"
]
self
.
excavator_index_to_uuid_dict
=
device_map_dict
[
self
.
excavator_index_to_uuid_dict
=
device_map_dict
[
"excavator_index_to_uuid_dict"
"excavator_index_to_uuid_dict"
...
@@ -286,9 +290,9 @@ class WalkManage(DeviceMap):
...
@@ -286,9 +290,9 @@ class WalkManage(DeviceMap):
def
reset
(
self
):
def
reset
(
self
):
dynamic_excavator_num
=
get_value
(
"dynamic_excavator_num"
)
# dynamic_excavator_num
dynamic_dump_num
=
get_value
(
"dynamic_dump_num"
)
# dynamic_dump_num
park_num
=
get_value
(
"park_num"
)
# park_num
# 路网真实距离
# 路网真实距离
self
.
walk_time_to_excavator
=
np
.
full
(
self
.
walk_time_to_excavator
=
np
.
full
(
...
@@ -492,6 +496,15 @@ def period_para_update():
...
@@ -492,6 +496,15 @@ def period_para_update():
global_dict
[
"dynamic_dump_num"
]
=
dynamic_dump_num
global_dict
[
"dynamic_dump_num"
]
=
dynamic_dump_num
global_dict
[
"park_num"
]
=
park_num
global_dict
[
"park_num"
]
=
park_num
print
(
"walk_manage.distance_to_excavator"
)
print
(
dynamic_dump_num
,
dynamic_excavator_num
)
print
(
walk_manage
.
distance_to_excavator
)
print
(
"walk_manage.excavator_dict"
)
print
(
walk_manage
.
excavator_uuid_to_index_dict
)
print
(
"walk_manage.dump_dict"
)
print
(
walk_manage
.
dump_uuid_to_index_dict
)
global_dict
[
"distance_to_excavator"
]
=
walk_manage
.
distance_to_excavator
global_dict
[
"distance_to_excavator"
]
=
walk_manage
.
distance_to_excavator
global_dict
[
"distance_park_to_excavator"
]
=
walk_manage
.
distance_park_to_excavator
global_dict
[
"distance_park_to_excavator"
]
=
walk_manage
.
distance_park_to_excavator
global_dict
[
"distance_to_dump"
]
=
walk_manage
.
distance_to_dump
global_dict
[
"distance_to_dump"
]
=
walk_manage
.
distance_to_dump
...
@@ -509,3 +522,8 @@ def period_para_update():
...
@@ -509,3 +522,8 @@ def period_para_update():
logger
.
info
(
walk_manage
.
dump_uuid_to_index_dict
)
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"
)
logger
.
info
(
walk_manage
.
distance_park_to_excavator
)
logger
.
info
(
walk_manage
.
distance_park_to_excavator
)
logger
.
info
(
"walk_manage.truck_index_to_uuid_dict"
)
logger
.
info
(
walk_manage
.
truck_index_to_uuid_dict
)
logger
.
info
(
"walk_manage.dynamic_truck_set"
)
logger
.
info
(
dynamic_truck_set
)
path_plan/path_plannner.py
View file @
b95e895f
...
@@ -145,10 +145,20 @@ class PathPlanner(WalkManage):
...
@@ -145,10 +145,20 @@ class PathPlanner(WalkManage):
def
walk_cost
(
self
):
def
walk_cost
(
self
):
self
.
excavator
.
para_period_update
()
self
.
dump
.
para_period_update
()
self
.
truck
.
para_period_update
(
self
.
dump
,
self
.
excavator
)
self
.
truck
.
state_period_update
()
self
.
period_walk_para_load
()
self
.
period_walk_para_load
()
self
.
period_map_para_load
()
self
.
period_map_para_load
()
self
.
controller
.
period_update
(
self
.
dump
,
self
.
excavator
,
self
.
truck
)
# 计算行驶成本前,更新路网速度信息
# 计算行驶成本前,更新路网速度信息
self
.
lane
.
lane_speed_generate
()
self
.
lane
.
lane_speed_generate
()
...
@@ -173,6 +183,8 @@ class PathPlanner(WalkManage):
...
@@ -173,6 +183,8 @@ class PathPlanner(WalkManage):
logger
.
error
(
es
)
logger
.
error
(
es
)
cost_to_excavator
=
np
.
zeros_like
(
get_value
(
"distance_to_excavator"
))
cost_to_excavator
=
np
.
zeros_like
(
get_value
(
"distance_to_excavator"
))
print
(
"distance_to_excavator"
)
print
(
cost_to_excavator
)
cost_to_dump
=
np
.
zeros_like
(
get_value
(
"distance_to_dump"
))
cost_to_dump
=
np
.
zeros_like
(
get_value
(
"distance_to_dump"
))
cost_park_to_excavator
=
np
.
zeros_like
(
get_value
(
"distance_park_to_excavator"
))
cost_park_to_excavator
=
np
.
zeros_like
(
get_value
(
"distance_park_to_excavator"
))
...
@@ -203,6 +215,7 @@ class PathPlanner(WalkManage):
...
@@ -203,6 +215,7 @@ class PathPlanner(WalkManage):
unload_area_index
=
self
.
dump_index_to_unload_area_index_dict
[
i
]
unload_area_index
=
self
.
dump_index_to_unload_area_index_dict
[
i
]
logger
.
info
(
"cost_to_excavator"
)
logger
.
info
(
"cost_to_excavator"
)
logger
.
info
(
cost_to_excavator
)
logger
.
info
(
cost_to_excavator
)
print
(
i
,
j
)
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
]
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
]
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
]
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
]
...
...
path_plan/priority_control.py
View file @
b95e895f
...
@@ -20,6 +20,12 @@ class PriorityController():
...
@@ -20,6 +20,12 @@ class PriorityController():
self
.
excavator
=
excavator
self
.
excavator
=
excavator
self
.
truck
=
truck
self
.
truck
=
truck
def
period_update
(
self
,
dump
,
excavator
,
truck
):
# 设备类
self
.
dump
=
dump
self
.
excavator
=
excavator
self
.
truck
=
truck
def
weighted_walk_cost
(
self
):
def
weighted_walk_cost
(
self
):
dynamic_dump_num
=
get_value
(
"dynamic_dump_num"
)
dynamic_dump_num
=
get_value
(
"dynamic_dump_num"
)
dynamic_excavator_num
=
get_value
(
"dynamic_excavator_num"
)
dynamic_excavator_num
=
get_value
(
"dynamic_excavator_num"
)
...
@@ -54,9 +60,13 @@ class PriorityController():
...
@@ -54,9 +60,13 @@ class PriorityController():
excavator_material_priority
[
excavator_inedx
]
excavator_material_priority
[
excavator_inedx
]
park_walk_weight
=
park_walk_weight
*
self
.
excavator
.
excavator_material_priority
park_walk_weight
=
park_walk_weight
*
self
.
excavator
.
excavator_material_priority
try
:
walk_weight
=
walk_weight
-
(
walk_weight
.
min
()
-
1
)
walk_weight
=
walk_weight
-
(
walk_weight
.
min
()
-
1
)
park_walk_weight
=
park_walk_weight
-
(
park_walk_weight
.
min
()
-
1
)
park_walk_weight
=
park_walk_weight
-
(
park_walk_weight
.
min
()
-
1
)
except
Exception
as
es
:
logger
.
errro
(
es
)
logger
.
error
(
"数值异常"
)
return
walk_weight
,
park_walk_weight
return
walk_weight
,
park_walk_weight
...
@@ -67,12 +77,20 @@ class PriorityController():
...
@@ -67,12 +77,20 @@ class PriorityController():
dynamic_excavator_set
=
get_value
(
"dynamic_excavator_set"
)
dynamic_excavator_set
=
get_value
(
"dynamic_excavator_set"
)
walk_weight
=
np
.
zeros
((
dynamic_dump_num
,
dynamic_excavator_num
))
walk_weight
=
np
.
zeros
((
dynamic_dump_num
,
dynamic_excavator_num
))
print
(
"here"
)
print
(
dynamic_dump_set
)
try
:
for
dump_id
in
dynamic_dump_set
:
for
dump_id
in
dynamic_dump_set
:
for
excavator_id
in
dynamic_excavator_set
:
for
excavator_id
in
dynamic_excavator_set
:
dump_index
=
self
.
dump
.
dump_uuid_to_index_dict
[
dump_id
]
dump_index
=
self
.
dump
.
dump_uuid_to_index_dict
[
dump_id
]
excavator_inedx
=
self
.
excavator
.
excavator_uuid_to_index_dict
[
excavator_id
]
excavator_inedx
=
self
.
excavator
.
excavator_uuid_to_index_dict
[
excavator_id
]
if
self
.
excavator
.
excavator_material
[
excavator_id
]
!=
self
.
dump
.
dump_material
[
dump_id
]:
if
self
.
excavator
.
excavator_material
[
excavator_id
]
!=
self
.
dump
.
dump_material
[
dump_id
]:
walk_weight
[
dump_index
][
excavator_inedx
]
+=
1000000
walk_weight
[
dump_index
][
excavator_inedx
]
+=
1000000
except
Exception
as
es
:
logger
.
info
(
es
)
logger
.
info
(
"error-12"
)
return
walk_weight
return
walk_weight
...
...
realtime_dispatch.py
View file @
b95e895f
This diff is collapsed.
Click to expand it.
static_data_process.py
View file @
b95e895f
...
@@ -138,6 +138,9 @@ def update_deveices_map(unload_area_uuid_to_index_dict, load_area_uuid_to_index_
...
@@ -138,6 +138,9 @@ def update_deveices_map(unload_area_uuid_to_index_dict, load_area_uuid_to_index_
except
Exception
as
es
:
except
Exception
as
es
:
logger
.
warning
(
es
)
logger
.
warning
(
es
)
print
(
"static_excavator_uuid_to_index_dict"
)
print
(
excavator_uuid_to_index_dict
)
return
{
return
{
"excavator_uuid_to_index_dict"
:
excavator_uuid_to_index_dict
,
"excavator_uuid_to_index_dict"
:
excavator_uuid_to_index_dict
,
"dump_uuid_to_index_dict"
:
dump_uuid_to_index_dict
,
"dump_uuid_to_index_dict"
:
dump_uuid_to_index_dict
,
...
@@ -161,6 +164,10 @@ def update_truck_uuid_index_map(dynamic_truck_set):
...
@@ -161,6 +164,10 @@ def update_truck_uuid_index_map(dynamic_truck_set):
truck_index_to_uuid_dict
[
truck_num
]
=
truck_id
truck_index_to_uuid_dict
[
truck_num
]
=
truck_id
truck_num
=
truck_num
+
1
truck_num
=
truck_num
+
1
print
(
dynamic_truck_set
)
print
(
"static-truck_uuid_to_index_dict"
)
print
(
truck_uuid_to_index_dict
)
return
{
return
{
"truck_uuid_to_index_dict"
:
truck_uuid_to_index_dict
,
"truck_uuid_to_index_dict"
:
truck_uuid_to_index_dict
,
"truck_index_to_uuid_dict"
:
truck_index_to_uuid_dict
,
"truck_index_to_uuid_dict"
:
truck_index_to_uuid_dict
,
...
@@ -275,6 +282,9 @@ def update_autodisp_dump():
...
@@ -275,6 +282,9 @@ def update_autodisp_dump():
raise
Exception
(
"无动态派车计划可用-动态派车挖机/卸载设备集合读取异常"
)
raise
Exception
(
"无动态派车计划可用-动态派车挖机/卸载设备集合读取异常"
)
except
Exception
as
es
:
except
Exception
as
es
:
logger
.
warning
(
es
)
logger
.
warning
(
es
)
print
(
"here1"
)
print
(
set
(
dynamic_dump_list
))
return
set
(
dynamic_dump_list
)
return
set
(
dynamic_dump_list
)
...
...
traffic_flow/traffic_flow_info.py
View file @
b95e895f
...
@@ -180,12 +180,22 @@ def Traffic_para_init(num_of_load_area, num_of_unload_area, num_of_excavator, nu
...
@@ -180,12 +180,22 @@ def Traffic_para_init(num_of_load_area, num_of_unload_area, num_of_excavator, nu
# 动态派车矿卡集合
# 动态派车矿卡集合
tra_para
.
truck_total_num
=
get_value
(
"dynamic_truck_num"
)
tra_para
.
truck_total_num
=
get_value
(
"dynamic_truck_num"
)
print
(
"truck.get_dump_hold_truck_num"
)
print
(
truck
.
get_dump_hold_truck_num
())
print
(
"truck.get_excavator_hold_truck_num"
)
print
(
truck
.
get_excavator_hold_truck_num
())
# 目的地矿卡数量
# 目的地矿卡数量
tra_para
.
dump_hold_truck_num
=
truck
.
get_dump_hold_truck_num
()
tra_para
.
dump_hold_truck_num
=
truck
.
get_dump_hold_truck_num
()
tra_para
.
excavator_hold_truck_num
=
truck
.
get_excavator_hold_truck_num
()
tra_para
.
excavator_hold_truck_num
=
truck
.
get_excavator_hold_truck_num
()
# 计算逻辑道路因子
# 计算逻辑道路因子
print
(
"here4"
)
print
(
num_of_dump
)
for
i
in
range
(
num_of_excavator
):
for
i
in
range
(
num_of_excavator
):
for
j
in
range
(
num_of_dump
):
for
j
in
range
(
num_of_dump
):
# 查找挖机绑定的装载区, 卸载设备绑定的卸载区
# 查找挖机绑定的装载区, 卸载设备绑定的卸载区
...
...
traffic_flow/traffic_flow_planner.py
View file @
b95e895f
...
@@ -109,11 +109,13 @@ def transportation_problem_slove(coefficient_goto_dump, coefficient_goto_excavat
...
@@ -109,11 +109,13 @@ def transportation_problem_slove(coefficient_goto_dump, coefficient_goto_excavat
# 约束四:车流可行性约束
# 约束四:车流可行性约束
# 当前车流可行性约束
# 当前车流可行性约束
for
i
in
range
(
row
):
for
i
in
range
(
row
):
print
(
excavator_hold_truck_num
[
i
])
print
(
"excavator_hold_truck_num"
)
print
(
excavator_hold_truck_num
,
i
)
prob
+=
(
pulp
.
lpSum
((
np
.
array
(
var_x
))[
i
])
<=
excavator_hold_truck_num
[
i
]
*
220
+
0.001
)
prob
+=
(
pulp
.
lpSum
((
np
.
array
(
var_x
))[
i
])
<=
excavator_hold_truck_num
[
i
]
*
220
+
0.001
)
for
j
in
range
(
col
):
for
j
in
range
(
col
):
print
(
dump_hold_truck_num
[
j
])
print
(
dump_hold_truck_num
)
print
(
dump_hold_truck_num
,
j
)
prob
+=
(
pulp
.
lpSum
((
np
.
array
(
var_y
))[
j
])
<=
dump_hold_truck_num
[
j
]
*
220
+
0.001
)
prob
+=
(
pulp
.
lpSum
((
np
.
array
(
var_y
))[
j
])
<=
dump_hold_truck_num
[
j
]
*
220
+
0.001
)
...
@@ -153,14 +155,21 @@ def traffic_flow_plan(truck):
...
@@ -153,14 +155,21 @@ def traffic_flow_plan(truck):
unload_area_set
=
set
(
unload_area_list
)
unload_area_set
=
set
(
unload_area_list
)
excavator_num
=
len
(
excavator_set
)
#
excavator_num = len(excavator_set)
#
dump_num
=
len
(
dump_set
)
#
dump_num = len(dump_set)
unload_area_num
=
len
(
unload_area_set
)
unload_area_num
=
len
(
unload_area_set
)
load_area_num
=
len
(
load_area_set
)
load_area_num
=
len
(
load_area_set
)
dump_num
=
get_value
(
"dynamic_dump_num"
)
print
(
"here5"
)
print
(
dump_num
)
excavator_num
=
get_value
(
"dynamic_excavator_num"
)
print
(
"装载区数量:"
,
load_area_num
,
"卸载区数量:"
,
unload_area_num
,
"挖机数量:"
,
excavator_num
,
"卸载设备数量:"
,
dump_num
)
print
(
"装载区数量:"
,
load_area_num
,
"卸载区数量:"
,
unload_area_num
,
"挖机数量:"
,
excavator_num
,
"卸载设备数量:"
,
dump_num
)
# try:
# try:
...
@@ -190,6 +199,9 @@ def traffic_flow_plan(truck):
...
@@ -190,6 +199,9 @@ def traffic_flow_plan(truck):
walk_time_to_excavator
=
traffic_programme_para
.
walk_time_to_excavator
walk_time_to_excavator
=
traffic_programme_para
.
walk_time_to_excavator
walk_time_to_dump
=
traffic_programme_para
.
walk_time_to_dump
walk_time_to_dump
=
traffic_programme_para
.
walk_time_to_dump
truck_total_num
=
traffic_programme_para
.
truck_total_num
truck_total_num
=
traffic_programme_para
.
truck_total_num
print
(
"here1212"
)
print
(
traffic_programme_para
.
dump_hold_truck_num
)
print
(
traffic_programme_para
.
excavator_hold_truck_num
)
dump_hold_truck_num
=
traffic_programme_para
.
dump_hold_truck_num
dump_hold_truck_num
=
traffic_programme_para
.
dump_hold_truck_num
excavator_hold_truck_num
=
traffic_programme_para
.
excavator_hold_truck_num
excavator_hold_truck_num
=
traffic_programme_para
.
excavator_hold_truck_num
...
...
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