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
ae805e3e
Commit
ae805e3e
authored
Feb 21, 2014
by
Ioannis Papagiannopoulos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Machine/QueueJobShop updated for OperatorsRouter use
parent
6f14429b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
59 additions
and
3 deletions
+59
-3
dream/simulation/MachineJobShop.py
dream/simulation/MachineJobShop.py
+38
-3
dream/simulation/QueueJobShop.py
dream/simulation/QueueJobShop.py
+21
-0
No files found.
dream/simulation/MachineJobShop.py
View file @
ae805e3e
...
...
@@ -41,6 +41,36 @@ class MachineJobShop(Machine):
self
.
previous
=
G
.
ObjList
self
.
next
=
G
.
ObjList
Machine
.
initialize
(
self
)
#run default behaviour
# =======================================================================
# actions to be carried out when the processing of an Entity ends
# =======================================================================
def
endProcessingActions
(
self
):
activeObject
=
self
.
getActiveObject
()
activeObjectQueue
=
activeObject
.
getActiveObjectQueue
()
activeEntity
=
activeObjectQueue
[
0
]
import
Globals
from
Globals
import
G
# the entity that just got processed is cold again it will get
# hot again by the time it reaches the giver of the next machine
# TODO: Not only Machines require time to process entities
if
activeEntity
.
family
==
'Job'
:
# read the list of next stations for the entity in just finished processing
nextObjectIds
=
activeEntity
.
remainingRoute
[
0
].
get
(
'stationIdsList'
,[])
nextObjects
=
[]
for
nextObjectId
in
nextObjectIds
:
nextObject
=
Globals
.
findObjectById
(
nextObjectId
)
nextObjects
.
append
(
nextObject
)
successorsAreMachines
=
True
for
object
in
nextObjects
:
if
not
object
in
G
.
MachineList
:
successorsAreMachines
=
False
break
if
not
successorsAreMachines
:
activeObjectQueue
[
0
].
hot
=
False
# the just processed entity is added to the list of entities
# pending for the next processing
G
.
pendingEntities
.
append
(
activeObjectQueue
[
0
])
# =======================================================================
# gets an entity from the predecessor that the predecessor index points to
...
...
@@ -186,15 +216,20 @@ class MachineJobShop(Machine):
self
.
receiver
.
timeLastEntityEnded
=
now
()
#required to count blockage correctly in the preemptied station
reactivate
(
self
)
#just extend the default behaviour in order to read the load time from the Entity to be obtained
#===========================================================================
# just extend the default behaviour in order to read the load time
# from the Entity to be obtained
#===========================================================================
def
canAcceptAndIsRequested
(
self
):
if
Machine
.
canAcceptAndIsRequested
(
self
):
self
.
readLoadTime
()
return
True
return
False
#to be called by canAcceptAndIsRequested if it is to return True.
#the load timeof the Entity must be read
#===========================================================================
# to be called by canAcceptAndIsRequested if it is to return True.
# the load timeof the Entity must be read
#===========================================================================
def
readLoadTime
(
self
):
self
.
giver
.
sortEntities
()
activeEntity
=
self
.
giver
.
getActiveObjectQueue
()[
0
]
...
...
dream/simulation/QueueJobShop.py
View file @
ae805e3e
...
...
@@ -105,6 +105,27 @@ class QueueJobShop(Queue):
nextObject
=
Globals
.
findObjectById
(
nextObjectId
)
nextObjects
.
append
(
nextObject
)
activeObject
.
next
=
nextObjects
# TODO: if the successor of the object is a machine that is operated with operationType 'Load'
# then the flag hot of the activeEntity must be set to True
# to signalize that the entity has reached its final destination before the next Machine
# if the entity is not of type Job
if
activeEntity
.
family
==
'Job'
:
from
Globals
import
G
successorsAreMachines
=
True
# for all the objects in the next list
for
object
in
nextObjects
:
# if the object is not in the MachineList
# TODO: We must consider also the case that entities can be blocked before they can reach
# the heating point. In such a case they must be removed from the G.pendingEntities list
# and added again after they are unblocked
if
not
object
in
G
.
MachineList
:
successorsAreMachines
=
False
break
# the hot flag should not be raised
if
successorsAreMachines
:
activeEntity
.
hot
=
True
activeEntity
.
remainingRoute
.
pop
(
0
)
#remove data from the remaining route of the entity
return
activeEntity
\ 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