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
a5a2e52b
Commit
a5a2e52b
authored
Sep 23, 2014
by
Ioannis Papagiannopoulos
Committed by
Georgios Dagkakis
Nov 17, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
OperatorRouterManaged clean-up
parent
ea495c4f
Changes
5
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
95 additions
and
359 deletions
+95
-359
dream/simulation/Job.py
dream/simulation/Job.py
+1
-8
dream/simulation/OperatorManagedJob.py
dream/simulation/OperatorManagedJob.py
+4
-5
dream/simulation/OperatorRouter.py
dream/simulation/OperatorRouter.py
+1
-3
dream/simulation/OperatorRouterManaged.py
dream/simulation/OperatorRouterManaged.py
+83
-318
dream/simulation/SkilledOperatorRouter.py
dream/simulation/SkilledOperatorRouter.py
+6
-25
No files found.
dream/simulation/Job.py
View file @
a5a2e52b
...
@@ -120,13 +120,6 @@ class Job(Entity): # inherits from the Entity c
...
@@ -120,13 +120,6 @@ class Job(Entity): # inherits from the Entity c
except
SetWipTypeError
as
setWipError
:
except
SetWipTypeError
as
setWipError
:
print
'WIP definition error: {0}'
.
format
(
setWipError
)
print
'WIP definition error: {0}'
.
format
(
setWipError
)
#===========================================================================
# check if the entity can proceed to an operated machine, for use by Router
#===========================================================================
def
canProceed
(
self
):
activeObject
=
self
.
currentStation
return
activeObject
.
canDeliver
(
self
)
#===========================================================================
#===========================================================================
# check if the requireParts of the entity next step sequence (route) have
# check if the requireParts of the entity next step sequence (route) have
# have concluded the steps with sequence numbers smaller than the sequence
# have concluded the steps with sequence numbers smaller than the sequence
...
@@ -236,7 +229,7 @@ class Job(Entity): # inherits from the Entity c
...
@@ -236,7 +229,7 @@ class Job(Entity): # inherits from the Entity c
router
.
entitiesWithOccupiedReceivers
.
append
(
self
)
router
.
entitiesWithOccupiedReceivers
.
append
(
self
)
availableReceiver
=
None
availableReceiver
=
None
# if the sorting flag is not set then the sorting of each queue must prevail in case of operators conflict
# if the sorting flag is not set then the sorting of each queue must prevail in case of operators conflict
if
not
router
.
sorting
and
not
availableReceiver
and
bool
(
availableReceivers
):
if
not
availableReceiver
and
bool
(
availableReceivers
):
availableReceiver
=
self
.
currentStation
.
selectReceiver
(
self
.
candidateReceivers
)
availableReceiver
=
self
.
currentStation
.
selectReceiver
(
self
.
candidateReceivers
)
if
not
self
in
router
.
conflictingEntities
:
if
not
self
in
router
.
conflictingEntities
:
router
.
conflictingEntities
.
append
(
self
)
router
.
conflictingEntities
.
append
(
self
)
...
...
dream/simulation/OperatorManagedJob.py
View file @
a5a2e52b
...
@@ -84,7 +84,7 @@ class OperatorManagedJob(Operator):
...
@@ -84,7 +84,7 @@ class OperatorManagedJob(Operator):
#=======================================================================
#=======================================================================
def
findCandidateEntities
(
self
,
pendingEntities
=
[]):
def
findCandidateEntities
(
self
,
pendingEntities
=
[]):
if
pendingEntities
:
if
pendingEntities
:
for
entity
in
[
x
for
x
in
pendingEntities
if
x
.
c
anProceed
and
x
.
manager
==
self
]:
for
entity
in
[
x
for
x
in
pendingEntities
if
x
.
c
urrentStation
.
canDeliver
(
x
)
and
x
.
manager
==
self
]:
self
.
candidateEntities
.
append
(
entity
)
self
.
candidateEntities
.
append
(
entity
)
#===========================================================================
#===========================================================================
...
@@ -117,7 +117,6 @@ class OperatorManagedJob(Operator):
...
@@ -117,7 +117,6 @@ class OperatorManagedJob(Operator):
router
=
G
.
Router
router
=
G
.
Router
# pick a candidateEntity
# pick a candidateEntity
candidateEntity
=
self
.
findAvailableEntity
()
candidateEntity
=
self
.
findAvailableEntity
()
if
not
router
.
sorting
:
if
not
candidateEntity
:
if
not
candidateEntity
:
candidateEntity
=
next
(
x
for
x
in
self
.
candidateEntities
)
candidateEntity
=
next
(
x
for
x
in
self
.
candidateEntities
)
router
.
conflictingEntities
.
append
(
candidateEntity
)
router
.
conflictingEntities
.
append
(
candidateEntity
)
...
...
dream/simulation/OperatorRouter.py
View file @
a5a2e52b
...
@@ -39,14 +39,12 @@ class Router(ObjectInterruption):
...
@@ -39,14 +39,12 @@ class Router(ObjectInterruption):
# The Broker is initiated within the Machine and considered as
# The Broker is initiated within the Machine and considered as
# black box for the ManPy end Developer
# black box for the ManPy end Developer
# =======================================================================
# =======================================================================
def
__init__
(
self
,
sorting
=
False
):
def
__init__
(
self
):
ObjectInterruption
.
__init__
(
self
)
ObjectInterruption
.
__init__
(
self
)
self
.
type
=
"Router"
self
.
type
=
"Router"
self
.
isInitialized
=
False
self
.
isInitialized
=
False
self
.
isActivated
=
False
self
.
isActivated
=
False
self
.
candidateOperators
=
[]
self
.
candidateOperators
=
[]
# boolean flag to check whether the Router should perform sorting on operators and on pendingEntities
self
.
sorting
=
sorting
# list of objects to be signalled by the Router
# list of objects to be signalled by the Router
self
.
toBeSignalled
=
[]
self
.
toBeSignalled
=
[]
# flag to notify whether the router is already invoked
# flag to notify whether the router is already invoked
...
...
dream/simulation/OperatorRouterManaged.py
View file @
a5a2e52b
This diff is collapsed.
Click to expand it.
dream/simulation/SkilledOperatorRouter.py
View file @
a5a2e52b
...
@@ -58,7 +58,6 @@ class SkilledRouter(Router):
...
@@ -58,7 +58,6 @@ class SkilledRouter(Router):
self
.
waitEndProcess
=
False
self
.
waitEndProcess
=
False
self
.
pendingQueues
=
[]
self
.
pendingQueues
=
[]
self
.
pendingMachines
=
[]
self
.
pendingMachines
=
[]
self
.
pendingObjects
=
[]
self
.
previousSolution
=
{}
self
.
previousSolution
=
{}
# =======================================================================
# =======================================================================
...
@@ -268,32 +267,14 @@ class SkilledRouter(Router):
...
@@ -268,32 +267,14 @@ class SkilledRouter(Router):
# default behaviour
# default behaviour
#===================================================================
#===================================================================
else
:
else
:
# find the pending objects
# entry actions
self
.
findPendingObjects
()
self
.
entry
()
# find the pending entities
# run the routine that allocates operators to machines
self
.
findPendingEntities
()
self
.
allocateOperators
()
# find the operators that can start working now
self
.
findCandidateOperators
()
# sort the pendingEntities list
if
self
.
sorting
:
self
.
sortPendingEntities
()
# find the operators candidateEntities
self
.
sortCandidateEntities
()
# find the entity that will occupy the resource, and the station that will receive it (if any available)
# entities that are already in stations have already a receiver
self
.
findCandidateReceivers
()
# assign operators to stations
# assign operators to stations
self
.
assignOperators
()
self
.
assignOperators
()
# unAssign exits
for
operator
in
[
x
for
x
in
self
.
candidateOperators
if
x
.
isAssignedTo
()]:
self
.
unAssignExits
()
if
not
operator
.
isAssignedTo
()
in
self
.
pendingObjects
:
for
object
in
[
x
for
x
in
operator
.
isAssignedTo
().
previous
if
x
.
exitIsAssignedTo
()]:
if
object
.
exitIsAssignedTo
()
!=
operator
.
isAssignedTo
():
object
.
unAssignExit
()
# if an object cannot proceed with getEntity, unAssign the exit of its giver
for
object
in
self
.
pendingQueues
:
if
not
object
in
self
.
toBeSignalled
:
object
.
unAssignExit
()
# signal the stations that ought to be signalled
# signal the stations that ought to be signalled
self
.
signalOperatedStations
()
self
.
signalOperatedStations
()
...
...
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