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
9164973f
Commit
9164973f
authored
Sep 09, 2014
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
many objects set to update the flags at correct place
parent
df5712d6
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
29 additions
and
23 deletions
+29
-23
dream/simulation/BatchDecomposition.py
dream/simulation/BatchDecomposition.py
+7
-9
dream/simulation/BatchReassembly.py
dream/simulation/BatchReassembly.py
+7
-10
dream/simulation/CapacityStationController.py
dream/simulation/CapacityStationController.py
+2
-0
dream/simulation/Conveyer.py
dream/simulation/Conveyer.py
+1
-1
dream/simulation/CoreObject.py
dream/simulation/CoreObject.py
+3
-0
dream/simulation/Exit.py
dream/simulation/Exit.py
+1
-0
dream/simulation/Machine.py
dream/simulation/Machine.py
+2
-3
dream/simulation/Queue.py
dream/simulation/Queue.py
+3
-0
dream/simulation/Source.py
dream/simulation/Source.py
+3
-0
No files found.
dream/simulation/BatchDecomposition.py
View file @
9164973f
...
...
@@ -85,13 +85,11 @@ class BatchDecomposition(CoreObject):
# check if there is WIP and signal receiver
self
.
initialSignalReceiver
()
while
1
:
# wait for an event or an interruption
self
.
expectedSignals
[
'isRequested'
]
=
1
self
.
expectedSignals
[
'interruptionStart'
]
=
1
self
.
expectedSignals
[
'initialWIP'
]
=
1
# wait for an event or an interruption
while
1
:
self
.
expectedSignals
[
'isRequested'
]
=
1
self
.
expectedSignals
[
'interruptionStart'
]
=
1
self
.
expectedSignals
[
'initialWIP'
]
=
1
receivedEvent
=
yield
self
.
env
.
any_of
([
self
.
isRequested
,
self
.
interruptionStart
,
self
.
initialWIP
])
# if an interruption has occurred
if
self
.
interruptionStart
in
receivedEvent
:
...
...
@@ -144,9 +142,7 @@ class BatchDecomposition(CoreObject):
# reset the variable
self
.
isProcessingInitialWIP
=
False
self
.
expectedSignals
[
'canDispose'
]
=
1
# TODO: add failure control
# as long as there are sub-Batches in the internal Resource
numberOfSubBatches
=
int
(
len
(
self
.
getActiveObjectQueue
()))
...
...
@@ -161,6 +157,7 @@ class BatchDecomposition(CoreObject):
if
not
signaling
:
# if there was no success wait till the receiver is available
while
1
:
self
.
expectedSignals
[
'canDispose'
]
=
1
yield
self
.
canDispose
transmitter
,
eventTime
=
self
.
canDispose
.
value
self
.
canDispose
=
self
.
env
.
event
()
...
...
@@ -182,6 +179,7 @@ class BatchDecomposition(CoreObject):
# we know that the receiver is occupied with the previous sub-batch
else
:
while
1
:
self
.
expectedSignals
[
'canDispose'
]
=
1
yield
self
.
canDispose
transmitter
,
eventTime
=
self
.
canDispose
.
value
self
.
canDispose
=
self
.
env
.
event
()
...
...
dream/simulation/BatchReassembly.py
View file @
9164973f
...
...
@@ -81,13 +81,11 @@ class BatchReassembly(CoreObject):
activeObjectQueue
=
self
.
getActiveObjectQueue
()
# check if there is WIP and signal receiver
self
.
initialSignalReceiver
()
while
1
:
self
.
expectedSignals
[
'isRequested'
]
=
1
self
.
expectedSignals
[
'interruptionStart'
]
=
1
self
.
expectedSignals
[
'initialWIP'
]
=
1
while
1
:
while
1
:
self
.
expectedSignals
[
'isRequested'
]
=
1
self
.
expectedSignals
[
'interruptionStart'
]
=
1
self
.
expectedSignals
[
'initialWIP'
]
=
1
receivedEvent
=
yield
self
.
env
.
any_of
([
self
.
isRequested
,
self
.
interruptionStart
,
self
.
initialWIP
])
if
self
.
interruptionStart
in
receivedEvent
:
transmitter
,
eventTime
=
self
.
interruptionStart
.
value
...
...
@@ -140,16 +138,15 @@ class BatchReassembly(CoreObject):
self
.
reassemble
()
self
.
isProcessingInitialWIP
=
False
# signal the receiver that the activeObject has something to dispose of
self
.
expectedSignals
[
'interruptionStart'
]
=
1
self
.
expectedSignals
[
'canDispose'
]
=
1
if
not
self
.
signalReceiver
():
# if there was no available receiver, get into blocking control
while
1
:
# self.timeLastBlockageStarted=self.env.now # blockage is starting
# wait the event canDispose, this means that the station can deliver the item to successor
self
.
printTrace
(
self
.
id
,
waitEvent
=
'(canDispose or interruption start)'
)
self
.
expectedSignals
[
'interruptionStart'
]
=
1
self
.
expectedSignals
[
'canDispose'
]
=
1
receivedEvent
=
yield
self
.
env
.
any_of
([
self
.
canDispose
,
self
.
interruptionStart
])
# if there was interruption
# TODO not good implementation
...
...
dream/simulation/CapacityStationController.py
View file @
9164973f
...
...
@@ -65,6 +65,7 @@ class CapacityStationController(EventGenerator):
if
exit
.
expectedSignals
[
'isRequested'
]:
succeedTuple
=
(
station
,
self
.
env
.
now
)
exit
.
isRequested
.
succeed
(
succeedTuple
)
# send is requested to station
exit
.
expectedSignals
[
'isRequested'
]
=
0
# wait until the entity is removed
station
.
waitEntityRemoval
=
True
...
...
@@ -125,6 +126,7 @@ class CapacityStationController(EventGenerator):
if
station
.
expectedSignals
[
'isRequested'
]:
succeedTuple
=
(
buffer
,
self
.
env
.
now
)
station
.
isRequested
.
succeed
(
succeedTuple
)
# send is requested to station
station
.
expectedSignals
[
'isRequested'
]
=
0
# wait until the entity is removed
buffer
.
waitEntityRemoval
=
True
...
...
dream/simulation/Conveyer.py
View file @
9164973f
...
...
@@ -543,6 +543,6 @@ class ConveyerMover(object):
if
self
.
conveyer
.
expectedSignals
[
'moveEnd'
]:
succeedTuple
=
(
self
,
self
.
env
.
now
)
self
.
conveyer
.
moveEnd
.
succeed
(
succeedTuple
)
# send a signal to the conveyer that the move has ended
self
.
conveyer
.
expectedSignals
[
'moveEnd'
]
=
0
dream/simulation/CoreObject.py
View file @
9164973f
...
...
@@ -298,11 +298,13 @@ class CoreObject(ManPyObject):
self
.
printTrace
(
self
.
id
,
signal
=
'(removedEntity)'
)
succeedTuple
=
(
self
,
self
.
env
.
now
)
self
.
entityRemoved
.
succeed
(
succeedTuple
)
self
.
expectedSignals
[
'entityRemoved'
]
=
0
elif
self
.
waitEntityRemoval
and
self
.
expectedSignals
[
'entityRemoved'
]:
# print self.id,'not triggered and waiting'
self
.
printTrace
(
self
.
id
,
signal
=
'(removedEntity)'
)
succeedTuple
=
(
self
,
self
.
env
.
now
)
self
.
entityRemoved
.
succeed
(
succeedTuple
)
self
.
expectedSignals
[
'entityRemoved'
]
=
0
elif
not
self
.
waitEntityRemoval
and
not
self
.
expectedSignals
[
'entityRemoved'
]:
# print self.id,'not triggered but not waiting'
pass
...
...
@@ -566,6 +568,7 @@ class CoreObject(ManPyObject):
self
.
printTrace
(
self
.
id
,
signalGiver
=
self
.
giver
.
id
)
succeedTuple
=
(
self
,
self
.
env
.
now
)
self
.
giver
.
canDispose
.
succeed
(
succeedTuple
)
self
.
giver
.
expectedSignals
[
'canDispose'
]
=
0
return
True
return
False
...
...
dream/simulation/Exit.py
View file @
9164973f
...
...
@@ -70,6 +70,7 @@ class Exit(CoreObject):
def
run
(
self
):
while
1
:
# wait until the Queue can accept an entity and one predecessor requests it
self
.
expectedSignals
[
'isRequested'
]
=
1
yield
self
.
isRequested
self
.
isRequested
=
self
.
env
.
event
()
# TODO: insert extra controls to check whether the self.giver attribute is correctly updated
...
...
dream/simulation/Machine.py
View file @
9164973f
...
...
@@ -732,11 +732,10 @@ class Machine(CoreObject):
# signal the receiver that the activeObject has something to dispose of
if
not
self
.
signalReceiver
():
# if there was no available receiver, get into blocking control
self
.
expectedSignals
[
'interruptionStart'
]
=
1
self
.
expectedSignals
[
'canDispose'
]
=
1
while
1
:
self
.
expectedSignals
[
'interruptionStart'
]
=
1
self
.
expectedSignals
[
'canDispose'
]
=
1
self
.
timeLastBlockageStarted
=
self
.
env
.
now
# blockage is starting
# wait the event canDispose, this means that the station can deliver the item to successor
self
.
printTrace
(
self
.
id
,
waitEvent
=
'(canDispose or interruption start)'
)
...
...
dream/simulation/Queue.py
View file @
9164973f
...
...
@@ -102,6 +102,9 @@ class Queue(CoreObject):
while
1
:
self
.
printTrace
(
self
.
id
,
waitEvent
=
''
)
# wait until the Queue can accept an entity and one predecessor requests it
self
.
expectedSignals
[
'canDispose'
]
=
1
self
.
expectedSignals
[
'isRequested'
]
=
1
self
.
expectedSignals
[
'loadOperatorAvailable'
]
=
1
receivedEvent
=
yield
self
.
isRequested
|
self
.
canDispose
|
self
.
loadOperatorAvailable
self
.
printTrace
(
self
.
id
,
received
=
''
)
# if the event that activated the thread is isRequested then getEntity
...
...
dream/simulation/Source.py
View file @
9164973f
...
...
@@ -140,6 +140,9 @@ class Source(CoreObject):
activeObjectQueue
=
self
.
getActiveObjectQueue
()
while
1
:
# wait for any event (entity creation or request for disposal of entity)
self
.
expectedSignals
[
'canDispose'
]
=
1
self
.
expectedSignals
[
'entityCreated'
]
=
1
self
.
expectedSignals
[
'loadOperatorAvailable'
]
=
1
receivedEvent
=
yield
self
.
entityCreated
|
self
.
canDispose
|
self
.
loadOperatorAvailable
self
.
printTrace
(
self
.
id
,
received
=
''
)
# if an entity is created try to signal the receiver and continue
...
...
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