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
7ca7e5ee
Commit
7ca7e5ee
authored
Jan 03, 2014
by
Georgios Dagkakis
Committed by
Jérome Perrin
Jan 20, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update so that the failures are not activated by the machine but by the main script
parent
81c4ff68
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
7 deletions
+18
-7
dream/simulation/LineGenerationJSON.py
dream/simulation/LineGenerationJSON.py
+17
-0
dream/simulation/Machine.py
dream/simulation/Machine.py
+1
-7
No files found.
dream/simulation/LineGenerationJSON.py
View file @
7ca7e5ee
...
...
@@ -86,6 +86,7 @@ from BatchDecompositionStartTime import BatchDecompositionStartTime
from
M3
import
M3
from
OrderComponent
import
OrderComponent
from
ScheduledMaintenance
import
ScheduledMaintenance
from
Failure
import
Failure
import
ExcelHandler
import
time
...
...
@@ -900,6 +901,7 @@ def createWIP():
def
createObjectInterruptions
():
G
.
ObjectInterruptionList
=
[]
G
.
ScheduledMaintenanceList
=
[]
G
.
FailureList
=
[]
json_data
=
G
.
JSONData
#Read the json data
...
...
@@ -914,6 +916,21 @@ def createObjectInterruptions():
SM
=
ScheduledMaintenance
(
victim
=
victim
,
start
=
start
,
duration
=
duration
)
G
.
ObjectInterruptionList
.
append
(
SM
)
G
.
ScheduledMaintenanceList
.
append
(
SM
)
failure
=
element
.
get
(
'failures'
,
{})
if
len
(
failure
):
distributionType
=
failure
.
get
(
'failureDistribution'
,
'No'
)
if
distributionType
==
'No'
:
pass
else
:
MTTF
=
float
(
failure
.
get
(
'MTTF'
,
'0'
))
MTTR
=
float
(
failure
.
get
(
'MTTR'
,
'0'
))
availability
=
float
(
failure
.
get
(
'availability'
,
'0'
))
victim
=
Globals
.
findObjectById
(
element
[
'id'
])
F
=
Failure
(
victim
,
distributionType
,
MTTF
,
MTTR
,
availability
,
victim
.
id
,
victim
.
repairman
)
G
.
ObjectInterruptionList
.
append
(
F
)
G
.
FailureList
.
append
(
F
)
# ===========================================================================
# used to convert a string read from the input to object type
...
...
dream/simulation/Machine.py
View file @
7ca7e5ee
...
...
@@ -71,13 +71,7 @@ class Machine(CoreObject):
# =======================================================================
def
initialize
(
self
):
# using the Process __init__ and not the CoreObject __init__
CoreObject
.
initialize
(
self
)
#if the failure distribution for the object is fixed, activate the failure
if
(
self
.
failureDistType
==
"Fixed"
or
self
.
failureDistType
==
"Availability"
):
MFailure
=
Failure
(
self
,
self
.
failureDistType
,
self
.
MTTF
,
self
.
MTTR
,
self
.
availability
,
self
.
id
,
self
.
repairman
)
activate
(
MFailure
,
MFailure
.
run
())
CoreObject
.
initialize
(
self
)
# initialize the internal Queue (type Resource) of the Machine
self
.
Res
=
Resource
(
self
.
capacity
)
...
...
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