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
b1bd20f2
Commit
b1bd20f2
authored
Nov 30, 2021
by
张晓彤
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复小BUG
parent
670e5b13
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
16 deletions
+16
-16
realtime_dispatch.py
realtime_dispatch.py
+16
-16
No files found.
realtime_dispatch.py
View file @
b1bd20f2
...
...
@@ -260,6 +260,7 @@ class Dispatcher(WalkManage):
def
truck_schedule
(
self
,
truck_id
):
# 规则读取
global
transport_value
rule3
=
session_mysql
.
query
(
DispatchRule
)
.
filter_by
(
id
=
3
)
.
first
()
.
disabled
rule4
=
session_mysql
.
query
(
DispatchRule
)
.
filter_by
(
id
=
4
)
.
first
()
.
disabled
...
...
@@ -345,7 +346,7 @@ class Dispatcher(WalkManage):
transport_value
+
excavator_exclude_modify
)
# + excavator_material_bind_modify)
target
=
self
.
excavator_uuid_to_index_dict
[
self
.
group
.
group_excavator_index_to_uuid_dict
[
group_id
][
target
]]
target
=
excavator
.
excavator_uuid_to_index_dict
[
self
.
group
.
group_excavator_index_to_uuid_dict
[
group_id
][
target
]]
else
:
actual_flow_to_excavator
=
truck
.
excavator_hold_truck_num
*
truck
.
payload
/
self
.
group
.
group_park_to_excavator
[
group_id
]
.
reshape
(
1
,
-
1
)
...
...
@@ -353,7 +354,7 @@ class Dispatcher(WalkManage):
target
=
np
.
argmin
(
actual_flow_to_excavator
/
allow_flow_to_excavator
)
target
=
self
.
excavator_uuid_to_index_dict
[
self
.
group
.
group_excavator_index_to_uuid_dict
[
group_id
][
target
]]
target
=
excavator
.
excavator_uuid_to_index_dict
[
self
.
group
.
group_excavator_index_to_uuid_dict
[
group_id
][
target
]]
logger
.
info
(
f
"目的地:{excavator.excavator_index_to_uuid_dict[target]}"
)
except
Exception
as
es
:
...
...
@@ -393,14 +394,12 @@ class Dispatcher(WalkManage):
logger
.
info
(
f
"卸载点实际车流:"
)
logger
.
info
(
actual_goto_dump_traffic_flow
)
logger
.
info
(
f
"卸载点理想车流:"
)
logger
.
info
(
self
.
opt_goto_dump_traffic_flow
)
logger
.
info
(
opt_goto_dump_traffic_flow
)
logger
.
info
(
"卸载点实际车流"
)
logger
.
info
(
actual_goto_dump_traffic_flow
[
int
(
trip
[
1
]),
:])
logger
.
info
(
"卸载点理想车流"
)
logger
.
info
(
self
.
opt_goto_dump_traffic_flow
[
int
(
trip
[
1
]),
:])
logger
.
info
(
opt_goto_dump_traffic_flow
[
int
(
trip
[
1
]),
:])
logger
.
info
(
"空载trip"
)
logger
.
info
(
trip
)
logger
.
info
(
"物料类型"
)
...
...
@@ -425,7 +424,7 @@ class Dispatcher(WalkManage):
elif
not
rule_ex
:
try
:
excavator_index
=
int
(
trip
[
1
])
excavator_id
=
self
.
excavator_index_to_uuid_dict
[
excavator_index
]
excavator_id
=
excavator
.
excavator_index_to_uuid_dict
[
excavator_index
]
print
(
self
.
group
.
group_excavator_uuid_to_index_dict
[
group_id
])
...
...
@@ -436,7 +435,7 @@ class Dispatcher(WalkManage):
# ga changed
# transport_value = self.cost_to_dump[:, int(trip[1])]
# transport_value = self.group.group_walk_to_dump_cost[group_excavator_index]
transport_value
=
self
.
group
.
group_walk_to_dump_cost
[
group_id
]
transport_value
=
self
.
group
.
group_walk_to_dump_cost
[
group_id
]
[:,
excavator_index
]
except
Exception
as
es
:
logger
.
error
(
"error10"
)
logger
.
error
(
es
)
...
...
@@ -488,7 +487,7 @@ class Dispatcher(WalkManage):
try
:
target
=
np
.
argmin
(
transport_value
.
T
+
dump_material_bind_modify
)
target
=
self
.
dump_uuid_to_index_dict
[
self
.
group
.
group_dump_index_to_uuid_dict
[
group_id
][
target
]]
target
=
dump
.
dump_uuid_to_index_dict
[
self
.
group
.
group_dump_index_to_uuid_dict
[
group_id
][
target
]]
logger
.
info
(
"target"
)
logger
.
info
(
target
)
except
Exception
as
es
:
...
...
@@ -516,7 +515,6 @@ class Dispatcher(WalkManage):
logger
.
error
(
"error08"
)
logger
.
error
(
es
)
logger
.
info
(
f
"目的地:{dump.dump_index_to_uuid_dict[target]}"
)
except
Exception
as
es
:
logger
.
error
(
"error06"
)
logger
.
error
(
es
)
...
...
@@ -530,9 +528,11 @@ class Dispatcher(WalkManage):
target
=
np
.
argmin
(
actual_flow_to_dump
/
allow_flow_to_dump
)
target
=
self
.
dump_uuid_to_index_dict
[
target
=
dump
.
dump_uuid_to_index_dict
[
self
.
group
.
group_dump_index_to_uuid_dict
[
group_id
][
target
]]
logger
.
info
(
f
"目的地:{dump.dump_index_to_uuid_dict[target]}"
)
elif
task
in
[
3
,
4
,
5
]:
try
:
...
...
@@ -597,11 +597,11 @@ class Dispatcher(WalkManage):
logger
.
info
(
self
.
cost_to_excavator
)
dump_index
=
int
(
trip
[
1
])
dump_id
=
self
.
dump_uuid_to_index_dict
[
dump_index
]
dump_id
=
dump
.
dump_uuid_to_index_dict
[
dump_index
]
if
rule3
and
rule4
:
# transport_value = self.cost_to_excavator[int(trip[1]), :]
transport_value
=
self
.
group
.
group_walk_to_excavator_cost
[
group_id
]
transport_value
=
self
.
group
.
group_walk_to_excavator_cost
[
group_id
]
[
dump_index
,
:]
else
:
group_dump_index
=
self
.
group
.
group_dump_uuid_to_index_dict
[
group_id
][
dump_id
]
...
...
@@ -640,7 +640,7 @@ class Dispatcher(WalkManage):
+
excavator_exclude_modify
)
# + excavator_material_bind_modify)
target
=
self
.
excavator_uuid_to_index_dict
[
self
.
group
.
group_excavator_index_to_uuid_dict
[
target
]]
target
=
excavator
.
excavator_uuid_to_index_dict
[
self
.
group
.
group_excavator_index_to_uuid_dict
[
group_id
]
[
target
]]
else
:
dump_index
=
int
(
trip
[
1
])
...
...
@@ -652,7 +652,7 @@ class Dispatcher(WalkManage):
target
=
np
.
argmin
(
actual_flow_to_excavator
/
allow_flow_to_excavator
)
target
=
self
.
excavator_uuid_to_index_dict
[
target
=
excavator
.
excavator_uuid_to_index_dict
[
self
.
group
.
group_excavator_index_to_uuid_dict
[
group_id
][
target
]]
except
Exception
as
es
:
logger
.
info
(
"trip出错1"
)
...
...
@@ -850,7 +850,7 @@ class Dispatcher(WalkManage):
item
=
(
session_mysql
.
query
(
Dispatch
)
.
filter_by
(
exactor_id
=
excavator
.
excavator_index_to_uuid_dict
[
Seq
[
i
][
1
]],
dump_id
=
dump
.
dump_index_to_u
nload_area_index
_dict
[
Seq
[
i
][
0
]],
dump_id
=
dump
.
dump_index_to_u
uid
_dict
[
Seq
[
i
][
0
]],
truck_id
=
truck_id
,
group_id
=
group_id
,
isauto
=
1
,
isdeleted
=
0
,)
.
first
())
...
...
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