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
c7ca01c8
Commit
c7ca01c8
authored
Oct 21, 2014
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
correction in Machine, so that isBlocked state is updated after the end of an interruption
parent
b8adf350
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
dream/simulation/Machine.py
dream/simulation/Machine.py
+4
-2
No files found.
dream/simulation/Machine.py
View file @
c7ca01c8
...
@@ -759,7 +759,6 @@ class Machine(CoreObject):
...
@@ -759,7 +759,6 @@ class Machine(CoreObject):
self
.
timeLastBlockageStarted
=
self
.
env
.
now
# blockage is starting
self
.
timeLastBlockageStarted
=
self
.
env
.
now
# blockage is starting
# wait the event canDispose, this means that the station can deliver the item to successor
# 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
.
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
])
# if there was interruption
# if there was interruption
# TODO not good implementation
# TODO not good implementation
...
@@ -767,7 +766,7 @@ class Machine(CoreObject):
...
@@ -767,7 +766,7 @@ class Machine(CoreObject):
transmitter
,
eventTime
=
self
.
interruptionStart
.
value
transmitter
,
eventTime
=
self
.
interruptionStart
.
value
assert
eventTime
==
self
.
env
.
now
,
'the interruption has not been processed on the time of activation'
assert
eventTime
==
self
.
env
.
now
,
'the interruption has not been processed on the time of activation'
self
.
interruptionStart
=
self
.
env
.
event
()
self
.
interruptionStart
=
self
.
env
.
event
()
# wait for the end of the interruption
# wait for the end of the interruption
self
.
interruptionActions
()
# execute interruption actions
self
.
interruptionActions
()
# execute interruption actions
# loop until we reach at a state that there is no interruption
# loop until we reach at a state that there is no interruption
while
1
:
while
1
:
...
@@ -779,7 +778,10 @@ class Machine(CoreObject):
...
@@ -779,7 +778,10 @@ class Machine(CoreObject):
transmitter
,
eventTime
=
self
.
interruptionEnd
.
value
transmitter
,
eventTime
=
self
.
interruptionEnd
.
value
assert
eventTime
==
self
.
env
.
now
,
'the victim of the failure is not the object that received it'
assert
eventTime
==
self
.
env
.
now
,
'the victim of the failure is not the object that received it'
self
.
interruptionEnd
=
self
.
env
.
event
()
self
.
interruptionEnd
=
self
.
env
.
event
()
# if there is no other interruption
if
self
.
Up
and
self
.
onShift
:
if
self
.
Up
and
self
.
onShift
:
# Machine is back to blocked state
self
.
isBlocked
=
True
break
break
self
.
postInterruptionActions
()
self
.
postInterruptionActions
()
if
self
.
signalReceiver
():
if
self
.
signalReceiver
():
...
...
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