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
880c1dce
Commit
880c1dce
authored
Oct 25, 2013
by
Georgios Dagkakis
Committed by
Sebastien Robin
Nov 06, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more cleanup in getEntity and removeEntity of coreobjects
parent
40253aa2
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
20 additions
and
24 deletions
+20
-24
dream/simulation/Assembly.py
dream/simulation/Assembly.py
+3
-1
dream/simulation/Conveyer.py
dream/simulation/Conveyer.py
+6
-11
dream/simulation/Dismantle.py
dream/simulation/Dismantle.py
+5
-9
dream/simulation/Machine.py
dream/simulation/Machine.py
+3
-2
dream/simulation/Queue.py
dream/simulation/Queue.py
+3
-1
No files found.
dream/simulation/Assembly.py
View file @
880c1dce
...
...
@@ -185,7 +185,8 @@ class Assembly(CoreObject):
def
removeEntity
(
self
):
activeEntity
=
CoreObject
.
removeEntity
(
self
)
#run the default method
self
.
outputTrace
(
activeEntity
.
name
,
"releases "
+
self
.
objName
)
#output trace
self
.
waitToDispose
=
False
#the object does not wait to dispose now
self
.
waitToDispose
=
False
return
activeEntity
#the object does not wait to dispose now
#gets an entity from the predecessor
#it may handle both Parts and Frames
...
...
@@ -208,6 +209,7 @@ class Assembly(CoreObject):
self
.
nameLastEntityEntered
=
activeEntity
.
name
self
.
timeLastEntityEntered
=
now
()
activeEntity
.
currentStation
=
self
return
activeEntity
#actions to be taken after the simulation ends
def
postProcessing
(
self
,
MaxSimtime
=
None
):
...
...
dream/simulation/Conveyer.py
View file @
880c1dce
...
...
@@ -204,22 +204,16 @@ class Conveyer(CoreObject):
return
self
.
canAccept
(
self
)
and
self
.
getGiverObject
().
haveToDispose
(
self
)
#gets an entity from the predecessor
def
getEntity
(
self
):
activeObjectQueue
=
self
.
getActiveObjectQueue
()
giverObject
=
self
.
getGiverObject
()
giverObjectQueue
=
self
.
getGiverObjectQueue
()
giverObject
.
sortEntities
()
#sort the Entities of the giver according to the scheduling rule if applied
activeEntity
=
giverObjectQueue
[
0
]
activeObjectQueue
.
append
(
activeEntity
)
#get the entity from the predecessor
def
getEntity
(
self
):
activeEntity
=
CoreObject
.
getEntity
(
self
)
self
.
position
.
append
(
0
)
#the entity is placed in the start of the conveyer
giverObject
.
removeEntity
()
#remove the entity from the previous object
self
.
outputTrace
(
activeEntity
.
name
,
"got into "
+
self
.
objName
)
activeEntity
.
currentStation
=
self
self
.
outputTrace
(
activeEntity
.
name
,
"got into "
+
self
.
objName
)
#output trace
#check if the conveyer became full to start counting blockage
if
self
.
isFull
():
self
.
timeBlockageStarted
=
now
()
self
.
wasFull
=
True
return
activeEntity
#removes an entity from the Conveyer
def
removeEntity
(
self
):
...
...
@@ -237,6 +231,7 @@ class Conveyer(CoreObject):
self
.
timeToBecomeAvailable
=
((
self
.
position
[
-
1
]
+
self
.
currentRequestedLength
)
/
float
(
self
.
speed
))
/
60
self
.
conveyerMover
.
timeToWait
=
self
.
timeToBecomeAvailable
self
.
call
=
True
return
activeEntity
#checks if the Conveyer can dispose an entity to the following object
def
haveToDispose
(
self
,
callerObject
=
None
):
...
...
dream/simulation/Dismantle.py
View file @
880c1dce
...
...
@@ -165,25 +165,20 @@ class Dismantle(CoreObject):
#gets a frame from the predecessor that the predecessor index points to
def
getEntity
(
self
):
activeEntity
=
CoreObject
.
getEntity
(
self
)
#run the default method
activeObjectQueue
=
self
.
getActiveObjectQueue
()
giverObject
=
self
.
getGiverObject
()
giverObject
.
sortEntities
()
#sort the Entities of the giver according to the scheduling rule if applied
giverObjectQueue
=
self
.
getGiverObjectQueue
()
activeEntity
=
giverObjectQueue
[
0
]
activeObjectQueue
.
append
(
activeEntity
)
#get the frame from the predecessor
giverObject
.
removeEntity
()
activeEntity
.
currentStation
=
self
#append also the parts in the res so that they can be popped
#get also the parts of the frame so that they can be popped
for
part
in
activeEntity
.
getFrameQueue
():
activeObjectQueue
.
append
(
part
)
part
.
currentStation
=
self
activeEntity
.
getFrameQueue
=
[]
#empty the frame
#move the frame to the end of the internal queue since we want the frame to be disposed first
activeObjectQueue
.
append
(
activeEntity
)
activeObjectQueue
.
pop
(
0
)
self
.
outputTrace
(
activeEntity
.
name
,
"got into "
+
self
.
objName
)
return
activeEntity
#removes an entity from the Dismantle
def
removeEntity
(
self
):
...
...
@@ -196,6 +191,7 @@ class Dismantle(CoreObject):
else
:
if
(
len
(
activeObjectQueue
)
==
1
):
self
.
waitToDisposePart
=
False
return
activeEntity
#outputs message to the trace.xls. Format is (Simulation Time | Entity or Frame Name | message)
def
outputTrace
(
self
,
name
,
message
):
...
...
dream/simulation/Machine.py
View file @
880c1dce
...
...
@@ -295,11 +295,12 @@ class Machine(CoreObject):
def
removeEntity
(
self
):
activeObject
=
self
.
getActiveObject
()
activeObject
.
outputTrace
(
"releases "
+
activeObject
.
objName
)
# output to trace that the Entity was released from the currentObject
CoreObject
.
removeEntity
(
self
)
#run the default method
activeEntity
=
CoreObject
.
removeEntity
(
self
)
#run the default method
activeObject
.
timeLastEntityLeft
=
now
()
# set the time that the last Entity was removed from this object
activeObject
.
waitToDispose
=
False
# update the waitToDispose flag
activeObject
.
downTimeInTryingToReleaseCurrentEntity
=
0
# re-initialize the timer downTimeInTryingToReleaseCurrentEntity
return
activeEntity
# =======================================================================
# checks if the Machine can dispose an entity to the following object
# =======================================================================
...
...
dream/simulation/Queue.py
View file @
880c1dce
...
...
@@ -168,6 +168,7 @@ class Queue(CoreObject):
activeObject
=
self
.
getActiveObject
()
activeEntity
=
CoreObject
.
removeEntity
(
self
)
#run the default method
activeObject
.
outputTrace
(
activeEntity
.
name
,
"releases "
+
activeObject
.
objName
)
#output trace
return
activeEntity
#checks if the Queue can accept an entity and there is an entity in some predecessor waiting for it
#also updates the predecessorIndex to the one that is to be taken
...
...
@@ -205,7 +206,8 @@ class Queue(CoreObject):
activeEntity
=
CoreObject
.
getEntity
(
self
)
#run the default behavior
self
.
outputTrace
(
activeEntity
.
name
,
"got into "
+
self
.
objName
)
return
activeEntity
#sorts the Entities of the Queue according to the scheduling rule
def
sortEntities
(
self
):
#if we have sorting according to multiple criteria we have to call the sorter many times
...
...
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