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
1ac8f292
Commit
1ac8f292
authored
Mar 07, 2014
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Failures change in order to read in thenew fashion
parent
b9fe9d6c
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
20 deletions
+21
-20
dream/simulation/Failure.py
dream/simulation/Failure.py
+17
-13
dream/simulation/Globals.py
dream/simulation/Globals.py
+1
-1
dream/simulation/LineGenerationJSON.py
dream/simulation/LineGenerationJSON.py
+3
-6
No files found.
dream/simulation/Failure.py
View file @
1ac8f292
...
@@ -33,13 +33,19 @@ from ObjectInterruption import ObjectInterruption
...
@@ -33,13 +33,19 @@ from ObjectInterruption import ObjectInterruption
class
Failure
(
ObjectInterruption
):
class
Failure
(
ObjectInterruption
):
def
__init__
(
self
,
victim
=
None
,
distribution
Type
=
'Fixed'
,
MTTF
=
60
,
MTTR
=
5
,
availability
=
100
,
index
=
0
,
repairman
=
None
):
def
__init__
(
self
,
victim
=
None
,
distribution
=
None
,
index
=
0
,
repairman
=
None
):
#Process.__init__(self)
#Process.__init__(self)
ObjectInterruption
.
__init__
(
self
,
victim
)
ObjectInterruption
.
__init__
(
self
,
victim
)
self
.
distType
=
distributionType
# the distribution that the failure duration follows
if
distribution
:
self
.
MTTF
=
MTTF
# the MTTF
self
.
distType
=
distribution
.
get
(
'failureDistribution'
,
'No'
)
# the distribution that the failure duration follows
self
.
MTTR
=
MTTR
# the MTTR
self
.
MTTF
=
distribution
.
get
(
'MTTF'
,
60
)
# the MTTF
self
.
availability
=
availability
# the availability
self
.
MTTR
=
distribution
.
get
(
'MTTR'
,
5
)
# the MTTR
self
.
availability
=
distribution
.
get
(
'availability'
,
100
)
# the availability
else
:
self
.
distType
=
'No'
self
.
MTTF
=
60
self
.
MTTR
=
5
self
.
availability
=
100
self
.
name
=
"F"
+
str
(
index
)
self
.
name
=
"F"
+
str
(
index
)
self
.
repairman
=
repairman
# the resource that may be needed to fix the failure
self
.
repairman
=
repairman
# the resource that may be needed to fix the failure
# if now resource is needed this will be "None"
# if now resource is needed this will be "None"
...
@@ -56,13 +62,11 @@ class Failure(ObjectInterruption):
...
@@ -56,13 +62,11 @@ class Failure(ObjectInterruption):
# beta=(sigma^2)/Mu
# beta=(sigma^2)/Mu
# alpha=Mu/beta
# alpha=Mu/beta
# --------------------------------------------------------------
# --------------------------------------------------------------
self
.
AvailabilityMTTF
=
MTTR
*
(
float
(
availability
)
/
100
)
/
(
1
-
(
float
(
availability
)
/
100
))
self
.
AvailabilityMTTF
=
self
.
MTTR
*
(
float
(
availability
)
/
100
)
/
(
1
-
(
float
(
availability
)
/
100
))
self
.
sigma
=
0.707106781185547
*
MTTR
self
.
sigma
=
0.707106781185547
*
self
.
MTTR
self
.
theta
=
(
pow
(
self
.
sigma
,
2
))
/
float
(
MTTR
)
self
.
theta
=
(
pow
(
self
.
sigma
,
2
))
/
float
(
self
.
MTTR
)
self
.
beta
=
self
.
theta
self
.
beta
=
self
.
theta
self
.
alpha
=
(
float
(
MTTR
)
/
self
.
theta
)
self
.
alpha
=
(
float
(
self
.
MTTR
)
/
self
.
theta
)
self
.
rngTTF
=
RandomNumberGenerator
(
self
,
"Exp"
)
self
.
rngTTF
=
RandomNumberGenerator
(
self
,
"Exp"
)
self
.
rngTTF
.
avg
=
self
.
AvailabilityMTTF
self
.
rngTTF
.
avg
=
self
.
AvailabilityMTTF
self
.
rngTTR
=
RandomNumberGenerator
(
self
,
"Erlang"
)
self
.
rngTTR
=
RandomNumberGenerator
(
self
,
"Erlang"
)
...
@@ -73,9 +77,9 @@ class Failure(ObjectInterruption):
...
@@ -73,9 +77,9 @@ class Failure(ObjectInterruption):
# if the distribution is fixed
# if the distribution is fixed
# --------------------------------------------------------------
# --------------------------------------------------------------
self
.
rngTTF
=
RandomNumberGenerator
(
self
,
self
.
distType
)
self
.
rngTTF
=
RandomNumberGenerator
(
self
,
self
.
distType
)
self
.
rngTTF
.
mean
=
MTTF
self
.
rngTTF
.
mean
=
self
.
MTTF
self
.
rngTTR
=
RandomNumberGenerator
(
self
,
self
.
distType
)
self
.
rngTTR
=
RandomNumberGenerator
(
self
,
self
.
distType
)
self
.
rngTTR
.
mean
=
MTTR
self
.
rngTTR
.
mean
=
self
.
MTTR
# =======================================================================
# =======================================================================
# The run method for the failure which has to served by a repairman
# The run method for the failure which has to served by a repairman
...
...
dream/simulation/Globals.py
View file @
1ac8f292
...
@@ -46,7 +46,7 @@ class G:
...
@@ -46,7 +46,7 @@ class G:
ObjList
=
[]
#a list that holds all the CoreObjects
ObjList
=
[]
#a list that holds all the CoreObjects
EntityList
=
[]
#a list that holds all the Entities
EntityList
=
[]
#a list that holds all the Entities
numberOfReplications
=
1
#the number of replications default=1
numberOfReplications
=
1
#the number of replications default=1
git
confidenceLevel
=
0.9
#the confidence level default=90%
confidenceLevel
=
0.9
#the confidence level default=90%
Base
=
1
#the Base time unit. Default =1 minute
Base
=
1
#the Base time unit. Default =1 minute
maxSimTime
=
0
#the total simulation time
maxSimTime
=
0
#the total simulation time
...
...
dream/simulation/LineGenerationJSON.py
View file @
1ac8f292
...
@@ -1196,19 +1196,16 @@ def createObjectInterruptions():
...
@@ -1196,19 +1196,16 @@ def createObjectInterruptions():
SM
=
ScheduledMaintenance
(
victim
=
victim
,
start
=
start
,
duration
=
duration
)
SM
=
ScheduledMaintenance
(
victim
=
victim
,
start
=
start
,
duration
=
duration
)
G
.
ObjectInterruptionList
.
append
(
SM
)
G
.
ObjectInterruptionList
.
append
(
SM
)
G
.
ScheduledMaintenanceList
.
append
(
SM
)
G
.
ScheduledMaintenanceList
.
append
(
SM
)
failure
=
element
.
get
(
'failures'
,
{}
)
failure
=
element
.
get
(
'failures'
,
None
)
# if there are failures assigned
# if there are failures assigned
# initiate them
# initiate them
if
len
(
failure
)
:
if
failure
:
distributionType
=
failure
.
get
(
'failureDistribution'
,
'No'
)
distributionType
=
failure
.
get
(
'failureDistribution'
,
'No'
)
if
distributionType
==
'No'
:
if
distributionType
==
'No'
:
pass
pass
else
:
else
:
MTTF
=
float
(
failure
.
get
(
'MTTF'
)
or
0
)
MTTR
=
float
(
failure
.
get
(
'MTTR'
)
or
0
)
availability
=
float
(
failure
.
get
(
'availability'
)
or
0
)
victim
=
Globals
.
findObjectById
(
element
[
'id'
])
victim
=
Globals
.
findObjectById
(
element
[
'id'
])
F
=
Failure
(
victim
,
distribution
Type
,
MTTF
,
MTTR
,
availability
,
victim
.
id
,
victim
.
repairman
)
F
=
Failure
(
victim
,
distribution
=
failure
,
repairman
=
victim
.
repairman
)
G
.
ObjectInterruptionList
.
append
(
F
)
G
.
ObjectInterruptionList
.
append
(
F
)
G
.
FailureList
.
append
(
F
)
G
.
FailureList
.
append
(
F
)
# if there is a shift pattern defined
# if there is a shift pattern defined
...
...
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