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
1f141783
Commit
1f141783
authored
Dec 23, 2014
by
Georgios Dagkakis
Committed by
Ioannis Papagiannopoulos
Jan 06, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PeriodicMaintenance updated
parent
82ad6cee
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
51 deletions
+20
-51
dream/simulation/JSONInputs/PeriodicMaintenance01.json
dream/simulation/JSONInputs/PeriodicMaintenance01.json
+13
-5
dream/simulation/LineGenerationJSON.py
dream/simulation/LineGenerationJSON.py
+5
-8
dream/simulation/PeriodicMaintenance.py
dream/simulation/PeriodicMaintenance.py
+2
-38
No files found.
dream/simulation/JSONInputs/PeriodicMaintenance01.json
View file @
1f141783
...
...
@@ -24,12 +24,20 @@
"mean"
:
10
}
},
"periodicMaintenance"
:
{
"MTTR"
:
2
,
"MTTF"
:
8
,
"distributionType"
:
"Fixed"
"interruptions"
:
{
"periodicMaintenance"
:
{
"TTR"
:
{
"Fixed"
:
{
"mean"
:
2
}
},
"TTF"
:
{
"Fixed"
:
{
"mean"
:
8
}
}
}
},
"interruptions"
:
{},
"_class"
:
"Dream.Machine"
,
"left"
:
0.5
},
...
...
dream/simulation/LineGenerationJSON.py
View file @
1f141783
...
...
@@ -304,16 +304,13 @@ def createObjectInterruptions():
G
.
FailureList
.
append
(
F
)
# if there are periodic maintenances assigned
# initiate them
periodicMaintenance
=
element
.
get
(
'periodicMaintenance'
,
None
)
periodicMaintenance
=
element
.
get
(
'
interruptions'
,{}).
get
(
'
periodicMaintenance'
,
None
)
if
periodicMaintenance
:
distributionType
=
periodicMaintenance
.
get
(
'distributionType'
,
'No'
)
if
distributionType
==
'No'
:
pass
else
:
victim
=
Globals
.
findObjectById
(
element
[
'id'
])
PM
=
PeriodicMaintenance
(
victim
=
victim
,
distribution
=
periodicMaintenance
,
repairman
=
victim
.
repairman
)
G
.
ObjectInterruptionList
.
append
(
PM
)
G
.
PeriodicMaintenanceList
.
append
(
PM
)
victim
=
Globals
.
findObjectById
(
element
[
'id'
])
PM
=
PeriodicMaintenance
(
victim
=
victim
,
distribution
=
periodicMaintenance
,
repairman
=
victim
.
repairman
)
G
.
ObjectInterruptionList
.
append
(
PM
)
G
.
PeriodicMaintenanceList
.
append
(
PM
)
# if there is a shift pattern defined
# initiate them
shift
=
element
.
get
(
'shift'
,
{})
...
...
dream/simulation/PeriodicMaintenance.py
View file @
1f141783
...
...
@@ -36,49 +36,13 @@ class PeriodicMaintenance(ObjectInterruption):
def
__init__
(
self
,
id
=
''
,
name
=
''
,
victim
=
None
,
distribution
=
None
,
index
=
0
,
repairman
=
None
,
**
kw
):
ObjectInterruption
.
__init__
(
self
,
id
,
name
,
victim
=
victim
)
if
distribution
:
self
.
distType
=
distribution
.
get
(
'distributionType'
,
'No'
)
# the distribution that the failure duration follows
self
.
MTTF
=
distribution
.
get
(
'MTTF'
,
60
)
# the MTTF
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
.
rngTTF
=
RandomNumberGenerator
(
self
,
distribution
.
get
(
'TTF'
,{
'Fixed'
:{
'mean'
:
100
}}))
self
.
rngTTR
=
RandomNumberGenerator
(
self
,
distribution
.
get
(
'TTR'
,{
'Fixed'
:{
'mean'
:
10
}}))
self
.
name
=
"F"
+
str
(
index
)
self
.
repairman
=
repairman
# the resource that may be needed to fix the failure
# if now resource is needed this will be "None"
self
.
type
=
"PeriodicMaintenance"
if
(
self
.
distType
==
"Availability"
):
# --------------------------------------------------------------
# the following are used if we have availability defined
# (as in plant) the erlang is a special case of Gamma.
# To model the Mu and sigma (that is given in plant)
# as alpha and beta for gamma you should do the following:
# beta=(sigma^2)/Mu
# alpha=Mu/beta
# --------------------------------------------------------------
self
.
AvailabilityMTTF
=
self
.
MTTR
*
(
float
(
availability
)
/
100
)
/
(
1
-
(
float
(
availability
)
/
100
))
self
.
sigma
=
0.707106781185547
*
self
.
MTTR
self
.
theta
=
(
pow
(
self
.
sigma
,
2
))
/
float
(
self
.
MTTR
)
self
.
beta
=
self
.
theta
self
.
alpha
=
(
float
(
self
.
MTTR
)
/
self
.
theta
)
self
.
rngTTF
=
RandomNumberGenerator
(
self
,
"Exp"
)
self
.
rngTTF
.
avg
=
self
.
AvailabilityMTTF
self
.
rngTTR
=
RandomNumberGenerator
(
self
,
"Erlang"
)
self
.
rngTTR
.
alpha
=
self
.
alpha
self
.
rngTTR
.
beta
=
self
.
beta
else
:
# --------------------------------------------------------------
# if the distribution is fixed
# --------------------------------------------------------------
self
.
rngTTF
=
RandomNumberGenerator
(
self
,
self
.
distType
)
self
.
rngTTF
.
mean
=
self
.
MTTF
self
.
rngTTR
=
RandomNumberGenerator
(
self
,
self
.
distType
)
self
.
rngTTR
.
mean
=
self
.
MTTR
def
initialize
(
self
):
ObjectInterruption
.
initialize
(
self
)
...
...
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