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
3daaafdc
Commit
3daaafdc
authored
Aug 05, 2014
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wip can be set in Machine. Processing time is not yet calculated correctly
parent
f842a78c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
3 deletions
+20
-3
dream/simulation/CoreObject.py
dream/simulation/CoreObject.py
+3
-0
dream/simulation/Globals.py
dream/simulation/Globals.py
+6
-0
dream/simulation/Machine.py
dream/simulation/Machine.py
+11
-3
No files found.
dream/simulation/CoreObject.py
View file @
3daaafdc
...
...
@@ -32,6 +32,7 @@ import simpy
# the core object
# ===========================================================================
class
CoreObject
(
object
):
class_name
=
'Dream.CoreObject'
def
__init__
(
self
,
id
,
name
,
**
kw
):
self
.
id
=
id
...
...
@@ -128,6 +129,7 @@ class CoreObject(object):
self
.
setupTimeCurrentEntity
=
0
self
.
shouldPreempt
=
False
#flag that shows that the machine should preempt or not
self
.
isProcessingInitialWIP
=
False
#flag that is used only when a Machine has initial wip
self
.
lastGiver
=
None
# variable that holds the last giver of the object, used by machine in case of preemption
# initialize the wipStatList -
...
...
@@ -141,6 +143,7 @@ class CoreObject(object):
self
.
interruptionStart
=
self
.
env
.
event
()
self
.
interruptedBy
=
None
self
.
entityRemoved
=
self
.
env
.
event
()
self
.
initialWIP
=
self
.
env
.
event
()
# flag used to signal that the station waits for removeEntity event
self
.
waitEntityRemoval
=
False
# attributes/indices used for printing the route, hold the cols corresponding to the machine (entities route and operators route)
...
...
dream/simulation/Globals.py
View file @
3daaafdc
...
...
@@ -247,6 +247,12 @@ def setWIP(entityList):
entity
.
hot
=
True
# add the entity to the pendingEntities list
G
.
pendingEntities
.
append
(
entity
)
# if we are in the start of the simulation the object is of Machine type then we should send initialWIP signal
if
G
.
env
.
now
==
0
and
entity
.
currentStation
:
if
entity
.
currentStation
.
class_name
:
if
entity
.
currentStation
.
class_name
==
'Dream.Machine'
:
entity
.
currentStation
.
currentEntity
=
entity
entity
.
currentStation
.
initialWIP
.
succeed
(
G
.
env
)
from
Exit
import
Exit
def
countIntervalThroughput
(
argumentDict
=
{}):
...
...
dream/simulation/Machine.py
View file @
3daaafdc
...
...
@@ -301,7 +301,7 @@ class Machine(CoreObject):
# waitEvent isRequested /interruptionEnd/loadOperatorAvailable
while
1
:
self
.
printTrace
(
self
.
id
,
waitEvent
=
''
)
receivedEvent
=
yield
self
.
isRequested
|
self
.
interruptionEnd
|
self
.
loadOperatorAvailable
receivedEvent
=
yield
self
.
isRequested
|
self
.
interruptionEnd
|
self
.
loadOperatorAvailable
|
self
.
initialWIP
self
.
printTrace
(
self
.
id
,
received
=
''
)
# if the machine can accept an entity and one predecessor requests it continue with receiving the entity
if
self
.
isRequested
in
receivedEvent
:
...
...
@@ -325,6 +325,12 @@ class Machine(CoreObject):
# try to signal the Giver, otherwise wait until it is requested
if
self
.
signalGiver
():
break
if
self
.
initialWIP
in
receivedEvent
:
assert
self
.
initialWIP
.
value
==
self
.
env
,
'initial wip was not sent by the Environment'
self
.
initialWIP
=
self
.
env
.
event
()
self
.
isProcessingInitialWIP
=
True
break
# TODO: maybe here have to assigneExit of the giver and add self to operator activeCallers list
# here or in the getEntity (apart from the loadTimeCurrentEntity)
...
...
@@ -376,7 +382,8 @@ class Machine(CoreObject):
# TODO: if there was loading time then we must solve the problem of getting an entity
# from an unidentified giver or not getting an entity at all as the giver
# may fall in failure mode (assignExit()?)
self
.
currentEntity
=
self
.
getEntity
()
if
not
self
.
isProcessingInitialWIP
:
self
.
currentEntity
=
self
.
getEntity
()
# TODO: the Machine receive the entity after the operator is available
# the canAcceptAndIsRequested method checks only in case of Load type of operation
...
...
@@ -613,8 +620,9 @@ class Machine(CoreObject):
self
.
timeLastEntityEnded
=
self
.
env
.
now
# this holds the time that the last entity ended processing in Machine
self
.
nameLastEntityEnded
=
self
.
currentEntity
.
name
# this holds the name of the last entity that ended processing in Machine
self
.
completedJobs
+=
1
# Machine completed one more Job
# reseting
the shouldPreempt flag
# reseting
flags
self
.
shouldPreempt
=
False
self
.
isProcessingInitialWIP
=
False
# in case Machine just performed the last work before the scheduled maintenance signal the corresponding object
if
self
.
isWorkingOnTheLast
:
...
...
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