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
5e2d0258
Commit
5e2d0258
authored
Jun 15, 2015
by
Georgios Dagkakis
Committed by
Ioannis Papagiannopoulos
Jun 22, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change in Macnine.run thread when it waits to dispose an entity
parent
cda37a84
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
16 deletions
+5
-16
dream/simulation/Machine.py
dream/simulation/Machine.py
+5
-16
No files found.
dream/simulation/Machine.py
View file @
5e2d0258
...
...
@@ -797,10 +797,11 @@ class Machine(CoreObject):
break
self
.
expectedSignals
[
'interruptionStart'
]
=
1
self
.
expectedSignals
[
'canDispose'
]
=
1
self
.
expectedSignals
[
'entityRemoved'
]
=
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)'
)
receivedEvent
=
yield
self
.
env
.
any_of
([
self
.
canDispose
,
self
.
interruptionStart
])
receivedEvent
=
yield
self
.
env
.
any_of
([
self
.
canDispose
,
self
.
interruptionStart
,
self
.
entityRemoved
])
# if there was interruption
# TODO not good implementation
if
self
.
interruptionStart
in
receivedEvent
:
...
...
@@ -854,19 +855,7 @@ class Machine(CoreObject):
# try to signal a receiver, if successful then proceed to get an other entity
if
self
.
signalReceiver
():
break
# TODO: router most probably should signal givers and not receivers in order to avoid this hold,self,0
# As the receiver (e.g.) a machine that follows the machine receives an loadOperatorAvailable event,
# signals the preceding station (e.g. self.machine) and immediately after that gets the entity.
# the preceding machine gets the canDispose signal which is actually useless, is emptied by the following station
# and then cannot exit an infinite loop.
# notify that the station waits the entity to be removed
activeObjectQueue
=
self
.
getActiveObjectQueue
()
if
len
(
activeObjectQueue
):
self
.
waitEntityRemoval
=
True
self
.
printTrace
(
self
.
id
,
waitEvent
=
'(entityRemoved)'
)
self
.
expectedSignals
[
'entityRemoved'
]
=
1
yield
self
.
entityRemoved
if
self
.
entityRemoved
in
receivedEvent
:
transmitter
,
eventTime
=
self
.
entityRemoved
.
value
self
.
printTrace
(
self
.
id
,
entityRemoved
=
eventTime
)
assert
eventTime
==
self
.
env
.
now
,
'entityRemoved event activated earlier than received'
...
...
@@ -874,8 +863,8 @@ class Machine(CoreObject):
self
.
entityRemoved
=
self
.
env
.
event
()
# if while waiting (for a canDispose event) became free as the machines that follows emptied it, then proceed
if
not
self
.
haveToDispose
():
break
break
#===========================================================================
# actions to be performed after an operation (setup or processing)
#===========================================================================
...
...
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