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
f9071603
Commit
f9071603
authored
May 19, 2014
by
Ioannis Papagiannopoulos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updateNext() updates the next list of an object within the CoreObject getEntity()
parent
31a1b69c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
33 deletions
+34
-33
dream/simulation/CoreObject.py
dream/simulation/CoreObject.py
+9
-0
dream/simulation/Machine.py
dream/simulation/Machine.py
+5
-5
dream/simulation/MachineJobShop.py
dream/simulation/MachineJobShop.py
+11
-5
dream/simulation/QueueJobShop.py
dream/simulation/QueueJobShop.py
+9
-23
No files found.
dream/simulation/CoreObject.py
View file @
f9071603
...
...
@@ -241,6 +241,9 @@ class CoreObject(Process):
self
.
nameLastEntityEntered
=
activeEntity
.
name
# this holds the name of the last entity that got into Machine
self
.
downTimeProcessingCurrentEntity
=
0
# update the next list of the object
activeObject
.
updateNext
(
activeEntity
)
# local variable to inform if the receiver is operated for Loading
receiverOperated
=
False
# perform preemption when required
...
...
@@ -279,6 +282,12 @@ class CoreObject(Process):
self
.
wipStatList
.
append
([
now
(),
len
(
activeObjectQueue
)])
return
activeEntity
#===========================================================================
# updates the next list of the object
#===========================================================================
def
updateNext
(
self
,
entity
=
None
):
pass
#===========================================================================
# find possible receivers
#===========================================================================
...
...
dream/simulation/Machine.py
View file @
f9071603
...
...
@@ -704,11 +704,11 @@ class Machine(CoreObject):
else
:
return
True
# =======================================================================
# checks if the machine down or it can dispose the object
# =======================================================================
def
ifCanDisposeOrHaveFailure
(
self
):
return
self
.
Up
==
False
or
self
.
getReceiverObject
().
canAccept
(
self
)
or
len
(
self
.
getActiveObjectQueue
())
==
0
#
# =======================================================================
#
# checks if the machine down or it can dispose the object
#
# =======================================================================
#
def ifCanDisposeOrHaveFailure(self):
#
return self.Up==False or self.getReceiverObject().canAccept(self) or len(self.getActiveObjectQueue())==0
# =======================================================================
# get an entity from the giver
...
...
dream/simulation/MachineJobShop.py
View file @
f9071603
...
...
@@ -119,21 +119,27 @@ class MachineJobShop(Machine):
setupTime
=
activeEntity
.
remainingRoute
[
0
].
get
(
'setupTime'
,{})
self
.
distType
=
setupTime
.
get
(
'distributionType'
,
'Fixed'
)
self
.
setupTime
=
float
(
setupTime
.
get
(
'mean'
,
0
))
removedStep
=
activeEntity
.
remainingRoute
.
pop
(
0
)
#remove data from the remaining route of the entity
return
activeEntity
#===========================================================================
# update the next list of the object based on the activeEentity
#===========================================================================
def
updateNext
(
self
,
entity
=
None
):
activeObject
=
self
.
getActiveObject
()
activeEntity
=
entity
# read the possible receivers - update the next list
import
Globals
# read the list of next stations
nextObjectIds
=
activeEntity
.
remainingRoute
[
1
].
get
(
'stationIdsList'
,[])
nextObjects
=
[]
for
nextObjectId
in
nextObjectIds
:
nextObject
=
Globals
.
findObjectById
(
nextObjectId
)
nextObject
=
Globals
.
findObjectById
(
nextObjectId
)
nextObjects
.
append
(
nextObject
)
# update the next list of the object
for
nextObject
in
nextObjects
:
# append only if not already in the list
if
nextObject
not
in
activeObject
.
next
:
activeObject
.
next
.
append
(
nextObject
)
removedStep
=
activeEntity
.
remainingRoute
.
pop
(
0
)
#remove data from the remaining route of the entity
return
activeEntity
# =======================================================================
# calculates the processing time
...
...
dream/simulation/QueueJobShop.py
View file @
f9071603
...
...
@@ -114,6 +114,15 @@ class QueueJobShop(Queue):
def
getEntity
(
self
):
activeObject
=
self
.
getActiveObject
()
activeEntity
=
Queue
.
getEntity
(
self
)
activeEntity
.
remainingRoute
.
pop
(
0
)
#remove data from the remaining route of the entity
return
activeEntity
#===========================================================================
# update the next list of the object after reading the remaining list of the activeEntity
#===========================================================================
def
updateNext
(
self
,
entity
=
None
):
activeObject
=
self
.
getActiveObject
()
activeEntity
=
entity
# read the possible receivers - update the next list
import
Globals
nextObjectIds
=
activeEntity
.
remainingRoute
[
1
].
get
(
'stationIdsList'
,[])
...
...
@@ -126,29 +135,6 @@ class QueueJobShop(Queue):
# append only if not already in the list
if
nextObject
not
in
activeObject
.
next
:
activeObject
.
next
.
append
(
nextObject
)
# 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
# =======================================================================
# removes an entity from the Queue
...
...
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