Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
dream
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
dream
Commits
bcac9132
Commit
bcac9132
authored
Mar 10, 2015
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SkilledRouter equiped with methods to find total wip and parallel machines
parent
d0d2bc9c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
0 deletions
+36
-0
dream/simulation/SkilledOperatorRouter.py
dream/simulation/SkilledOperatorRouter.py
+36
-0
No files found.
dream/simulation/SkilledOperatorRouter.py
View file @
bcac9132
...
...
@@ -327,12 +327,16 @@ class SkilledRouter(Router):
# loop through the operators. If for one the shift ended or started right now allocation is needed
for
operator
in
G
.
OperatorsList
:
if
operator
.
timeLastShiftEnded
==
self
.
env
.
now
or
operator
.
timeLastShiftStarted
==
self
.
env
.
now
:
# pass
return
True
# loop through the machines
for
machine
in
G
.
MachineList
:
# if one machine is starved more than 30 then allocation is needed
if
(
self
.
env
.
now
-
machine
.
timeLastEntityEnded
>=
30
)
and
(
not
machine
.
isProcessing
):
# pass
return
True
previousList
=
self
.
getPreviousList
(
machine
)
parallelMachinesList
=
self
.
getParallelMachinesList
(
machine
)
return
False
def
postProcessing
(
self
):
...
...
@@ -351,5 +355,37 @@ class SkilledRouter(Router):
json
[
'results'
][
'solutionList'
]
=
self
.
solutionList
G
.
outputJSON
[
'elementList'
].
append
(
json
)
# for a machine gets the decomposition and the buffer (if any)
def
getPreviousList
(
self
,
machine
):
previousList
=
[]
predecessor
=
machine
.
previous
[
0
]
while
1
:
if
"Reassembly"
in
str
(
predecessor
.
__class__
)
or
"Source"
in
str
(
predecessor
.
__class__
):
break
previousList
.
append
(
predecessor
)
predecessor
=
predecessor
.
previous
[
0
]
return
previousList
# for a machine gets a list with the parallel machines
def
getParallelMachinesList
(
self
,
machine
):
alreadyConsidered
=
[
machine
]
parallelMachinesList
=
[]
previousObject
=
machine
.
previous
[
0
]
while
1
:
if
"Reassembly"
in
str
(
previousObject
.
__class__
)
or
"Source"
in
str
(
previousObject
.
__class__
)
\
or
"Queue"
in
str
(
previousObject
.
__class__
)
or
"Clearance"
in
str
(
previousObject
.
__class__
):
break
alreadyConsidered
.
append
(
previousObject
)
previousObject
=
previousObject
.
previous
[
0
]
for
nextObject
in
previousObject
.
next
:
while
1
:
if
nextObject
in
alreadyConsidered
:
break
if
"Machine"
in
str
(
nextObject
.
__class__
)
or
"M3"
in
str
(
nextObject
.
__class__
):
parallelMachinesList
.
append
(
nextObject
)
break
nextObject
=
nextObject
.
next
[
0
]
return
parallelMachinesList
\ No newline at end of file
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