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
fe8e5077
Commit
fe8e5077
authored
10 years ago
by
Ioannis Papagiannopoulos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
failure interrupts victim even if the victim is empty
parent
b8dd7f5e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
6 deletions
+3
-6
dream/simulation/Failure.py
dream/simulation/Failure.py
+3
-6
No files found.
dream/simulation/Failure.py
View file @
fe8e5077
...
...
@@ -87,8 +87,7 @@ class Failure(ObjectInterruption):
def
run
(
self
):
while
1
:
yield
hold
,
self
,
self
.
rngTTF
.
generateNumber
()
# wait until a failure happens
if
(
len
(
self
.
getVictimQueue
())
>
0
):
# when a Machine gets failure
self
.
interruptVictim
()
# while in process it is interrupted
self
.
interruptVictim
()
# interrupt the victim
self
.
victim
.
Up
=
False
self
.
victim
.
timeLastFailure
=
now
()
self
.
outputTrace
(
"is down"
)
...
...
@@ -103,11 +102,9 @@ class Failure(ObjectInterruption):
yield
hold
,
self
,
self
.
rngTTR
.
generateNumber
()
# wait until the repairing process is over
self
.
victim
.
totalFailureTime
+=
now
()
-
failTime
if
(
len
(
self
.
getVictimQueue
())
>
0
):
self
.
reactivateVictim
()
# since repairing is over, the Machine is reactivated
self
.
reactivateVictim
()
# since repairing is over, the Machine is reactivated
self
.
victim
.
Up
=
True
self
.
outputTrace
(
"is up"
)
self
.
outputTrace
(
"is up"
)
if
(
self
.
repairman
and
self
.
repairman
!=
"None"
):
#if a resource was used, it is now released
yield
release
,
self
,
self
.
repairman
.
getResource
()
self
.
repairman
.
totalWorkingTime
+=
now
()
-
timeOperationStarted
...
...
This diff is collapsed.
Click to expand it.
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