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
21090174
Commit
21090174
authored
Nov 09, 2022
by
张晓彤
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
改善group类结构
parent
4b27ce39
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
80 additions
and
50 deletions
+80
-50
dispatcher.py
core/dispatcher.py
+1
-1
group.py
core/group.py
+5
-27
dispatchInfo.py
data/dispatchInfo.py
+74
-22
No files found.
core/dispatcher.py
View file @
21090174
...
...
@@ -55,7 +55,7 @@ class Dispatcher:
:return: None
"""
self
.
group_list
=
{}
groups
=
DispatchInfo
.
get_all_group
()
groups
=
DispatchInfo
.
get_all_group
s_id
()
for
group_id
in
groups
:
if
group_id
not
in
self
.
group_list
:
group
=
Group
(
group_id
,
self
.
truck
,
self
.
pre_sch
,
self
.
excavator
,
self
.
dump
)
...
...
core/group.py
View file @
21090174
...
...
@@ -223,35 +223,13 @@ class Group:
update group device map.
:return:
"""
# excavator_index = 0
self
.
excavator_uuid_index_dict
=
{}
self
.
unload_area_uuid_index_dict
=
{}
self
.
truck_uuid_index_dict
=
{}
self
.
dump_uuid_index_dict
=
{}
for
i
in
range
(
len
(
self
.
excavator
)):
self
.
excavator_uuid_index_dict
[
list
(
self
.
excavator
)[
i
]]
=
i
for
i
in
range
(
len
(
self
.
unload_area
)):
self
.
unload_area_uuid_index_dict
[
list
(
self
.
unload_area
)[
i
]]
=
i
for
i
in
range
(
len
(
self
.
dump
)):
self
.
dump_uuid_index_dict
[
list
(
self
.
dump
)[
i
]]
=
i
for
i
in
range
(
len
(
self
.
truck_set
)):
self
.
truck_uuid_index_dict
[
list
(
self
.
truck_set
)[
i
]]
=
i
self
.
excavator_uuid_index_dict
=
bidict
(
DispatchInfo
.
excavator_uuid_to_index_dict
[
self
.
group_id
])
self
.
unload_area_uuid_index_dict
=
bidict
(
DispatchInfo
.
unload_area_uuid_to_index_dict
[
self
.
group_id
])
self
.
dump_uuid_index_dict
=
bidict
(
DispatchInfo
.
dump_uuid_to_index_dict
[
self
.
group_id
])
# group_excavator_dict = {group_1: {excavator_1: load_area_1}, group_2: {excavator_2: load_area_2}}
#
self.excavator_uuid_index_dict = bidict(self.excavator_uuid_index_dict)
# self.unload_area_uuid_index_dict = bidict(self.unload_area_uuid_index_dict
)
# self.truck_uuid_index_dict = bidict(self.truck_uuid_index_dict
)
self
.
dump_uuid_index_dict
=
bidict
(
self
.
dump_uuid_index_dict
)
#
update devices(excavators, unload_areas, dumps) bidirectional map within a group
self
.
excavator_uuid_index_dict
=
DispatchInfo
.
get_group_excavator_dict
(
self
.
group_id
)
self
.
unload_area_uuid_index_dict
=
DispatchInfo
.
get_group_unload_area_dict
(
self
.
group_id
)
self
.
dump_uuid_index_dict
=
DispatchInfo
.
get_group_dump_dict
(
self
.
group_id
)
# group_excavator_dict = {group_1: {excavator_1: load_area_1}, group_2: {excavator_2: load_area_2}}
def
update_device_material
(
self
):
"""
...
...
data/dispatchInfo.py
View file @
21090174
This diff is collapsed.
Click to expand it.
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