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
391d2602
Commit
391d2602
authored
May 30, 2022
by
张晓彤
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
分组调度架构更新
parent
bbbfd63c
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
149 additions
and
2 deletions
+149
-2
algorithm.py
alg/algorithm.py
+42
-0
algorithm.py
algorithm.py
+2
-2
group.py
core/group.py
+60
-0
dispatchInfo.py
data/dispatchInfo.py
+45
-0
No files found.
alg/algorithm.py
0 → 100644
View file @
391d2602
#!E:\Pycharm Projects\Waytous
# -*- coding: utf-8 -*-
# @Time : 2022/5/30 16:32
# @Author : Opfer
# @Site :
# @File : alg.py
# @Software: PyCharm
class
AlgorithmBase
:
"""
Base class for dispatch alg.
"""
def
__init__
(
self
):
pass
class
Congestion
(
AlgorithmBase
):
"""
class for congestion alg.
"""
def
__init__
(
self
,
group
):
super
()
.
__init__
()
self
.
group
=
group
def
solve
(
self
):
pass
class
ExpectedTime
(
AlgorithmBase
):
"""
class for expected traveling time alg.
"""
def
__init__
(
self
,
group
):
super
()
.
__init__
()
self
.
group
=
group
def
solve
(
self
):
pass
algorithm.py
View file @
391d2602
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
# @Time : 2022/1/5 14:14
# @Time : 2022/1/5 14:14
# @Author : Opfer
# @Author : Opfer
# @Site :
# @Site :
# @File : alg
orithm.py
# @File : alg
.py
# @Software: PyCharm
# @Software: PyCharm
...
@@ -13,7 +13,7 @@ from equipment.dump import DumpInfo
...
@@ -13,7 +13,7 @@ from equipment.dump import DumpInfo
from
equipment.excavator
import
ExcavatorInfo
from
equipment.excavator
import
ExcavatorInfo
class
ScheduleAlg
(
WalkManage
):
class
ScheduleAlg
(
WalkManage
):
""" class for the schedule alg
orithm
.
""" class for the schedule alg.
Description:
Description:
根据设备状态计算调度价值
根据设备状态计算调度价值
...
...
core/group.py
0 → 100644
View file @
391d2602
#!E:\Pycharm Projects\Waytous
# -*- coding: utf-8 -*-
# @Time : 2022/5/30 15:35
# @Author : Opfer
# @Site :
# @File : group.py
# @Software: PyCharm
from
data.dispatchInfo
import
DispatchInfo
from
bidict
import
bidict
from
alg.algorithm
import
AlgorithmBase
class
Group
:
"""
class for group instance.
"""
def
__init__
(
self
,
group_id
):
""" Generate a group obj.
:param group_id: (uuid) group_id
"""
self
.
group_id
=
group_id
# group devices
self
.
excavator_dict
=
{}
# excavator_id -> unload_area_id
self
.
dump_dict
=
{}
# dump_id -> load_area_id
self
.
truck_set
=
set
()
# truck_id
# road network info.
self
.
to_excavator_distance
=
None
self
.
to_dump_distance
=
None
self
.
park_to_excavator_distance
=
None
self
.
to_excavator_congestion
=
None
self
.
to_dump_congestion
=
None
self
.
park_to_excavator_congestion
=
None
# device map
self
.
truck_uuid_index_dict
=
bidict
()
self
.
excavator_uuid_index_dict
=
bidict
()
self
.
dump_uuid_index_dict
=
bidict
()
def
update_xx_
(
self
):
"""
update above parameters.
:return:
"""
pass
def
group_dispatch
(
self
,
solver
):
"""
Receive a alg obj. and output dispatch plan for trucks in this group.
:param solver:
:return:
dispatch plan: Dict({truck_id: match_id})
"""
assert
isinstance
(
solver
,
AlgorithmBase
)
s
=
solver
(
self
)
# algorithm init
return
s
.
solve
()
# algorithm solve
data/dispatchInfo.py
0 → 100644
View file @
391d2602
#!E:\Pycharm Projects\Waytous
# -*- coding: utf-8 -*-
# @Time : 2022/5/30 14:45
# @Author : Opfer
# @Site :
# @File : dispatchInfo.py
# @Software: PyCharm
class
DispatchInfo
:
"""
class for dispatch group info.
"""
# dispatch groups
group_num
=
1
group_set
=
set
()
# device group structure
group_dump_dict
=
{}
# team_id -> dict {[dump_id, unload_area_id], [dump_id, unload_area_id], ...}
group_excavator_dict
=
{}
# team_id -> dict {[excavator_id, load_area_id], ...}
group_truck_dict
=
{}
# team_id -> dict {truck_id, ...}
dump_group_dict
=
{}
# dump_id -> team_id
excavator_group_dict
=
{}
# excavator_id -> team_id
truck_group_dict
=
{}
# truck_id -> team_id
# group feature
group_mode
=
{}
@classmethod
def
update_device_group_structure
(
cls
):
pass
@classmethod
def
update_group_mode
(
cls
):
pass
@classmethod
def
dispatch_group_init
(
cls
):
"""
update basic paras (group_set, dict, num ...)
:return:
"""
pass
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