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
4749c80e
Commit
4749c80e
authored
Aug 12, 2014
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
object to hold a list with interruptions for which they are victims
parent
8686c3ed
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
0 deletions
+8
-0
dream/simulation/CoreObject.py
dream/simulation/CoreObject.py
+3
-0
dream/simulation/LineGenerationJSON.py
dream/simulation/LineGenerationJSON.py
+3
-0
dream/simulation/ObjectResource.py
dream/simulation/ObjectResource.py
+2
-0
No files found.
dream/simulation/CoreObject.py
View file @
4749c80e
...
@@ -49,6 +49,9 @@ class CoreObject(object):
...
@@ -49,6 +49,9 @@ class CoreObject(object):
self
.
Waiting
=
[]
self
.
Waiting
=
[]
self
.
OffShift
=
[]
self
.
OffShift
=
[]
# list that holds the objectInterruptions that have this element as victim
self
.
objectInterruptions
=
[]
#default attributes set so that the CoreObject has them
#default attributes set so that the CoreObject has them
self
.
isPreemptive
=
False
self
.
isPreemptive
=
False
self
.
resetOnPreemption
=
False
self
.
resetOnPreemption
=
False
...
...
dream/simulation/LineGenerationJSON.py
View file @
4749c80e
...
@@ -1318,6 +1318,7 @@ def createObjectInterruptions():
...
@@ -1318,6 +1318,7 @@ def createObjectInterruptions():
duration
=
float
(
scheduledMaintenance
.
get
(
'duration'
,
1
))
duration
=
float
(
scheduledMaintenance
.
get
(
'duration'
,
1
))
victim
=
Globals
.
findObjectById
(
element
[
'id'
])
victim
=
Globals
.
findObjectById
(
element
[
'id'
])
SM
=
ScheduledMaintenance
(
victim
=
victim
,
start
=
start
,
duration
=
duration
)
SM
=
ScheduledMaintenance
(
victim
=
victim
,
start
=
start
,
duration
=
duration
)
victim
.
objectInterruptions
.
append
(
SM
)
G
.
ObjectInterruptionList
.
append
(
SM
)
G
.
ObjectInterruptionList
.
append
(
SM
)
G
.
ScheduledMaintenanceList
.
append
(
SM
)
G
.
ScheduledMaintenanceList
.
append
(
SM
)
failure
=
element
.
get
(
'failures'
,
None
)
failure
=
element
.
get
(
'failures'
,
None
)
...
@@ -1331,6 +1332,7 @@ def createObjectInterruptions():
...
@@ -1331,6 +1332,7 @@ def createObjectInterruptions():
victim
=
Globals
.
findObjectById
(
element
[
'id'
])
victim
=
Globals
.
findObjectById
(
element
[
'id'
])
deteriorationType
=
failure
.
get
(
'deteriorationType'
,
'constant'
)
deteriorationType
=
failure
.
get
(
'deteriorationType'
,
'constant'
)
F
=
Failure
(
victim
,
distribution
=
failure
,
repairman
=
victim
.
repairman
,
deteriorationType
=
deteriorationType
)
F
=
Failure
(
victim
,
distribution
=
failure
,
repairman
=
victim
.
repairman
,
deteriorationType
=
deteriorationType
)
victim
.
objectInterruptions
.
append
(
F
)
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
...
@@ -1350,6 +1352,7 @@ def createObjectInterruptions():
...
@@ -1350,6 +1352,7 @@ def createObjectInterruptions():
shiftPattern
.
remove
(
next
)
shiftPattern
.
remove
(
next
)
endUnfinished
=
bool
(
int
(
shift
.
get
(
'endUnfinished'
,
0
)))
endUnfinished
=
bool
(
int
(
shift
.
get
(
'endUnfinished'
,
0
)))
SS
=
ShiftScheduler
(
victim
,
shiftPattern
,
endUnfinished
)
SS
=
ShiftScheduler
(
victim
,
shiftPattern
,
endUnfinished
)
victim
.
objectInterruptions
.
append
(
SS
)
G
.
ObjectInterruptionList
.
append
(
SS
)
G
.
ObjectInterruptionList
.
append
(
SS
)
G
.
ShiftSchedulerList
.
append
(
SS
)
G
.
ShiftSchedulerList
.
append
(
SS
)
...
...
dream/simulation/ObjectResource.py
View file @
4749c80e
...
@@ -34,6 +34,8 @@ class ObjectResource(object):
...
@@ -34,6 +34,8 @@ class ObjectResource(object):
def
__init__
(
self
):
def
__init__
(
self
):
self
.
initialized
=
False
self
.
initialized
=
False
# list that holds the objectInterruptions that have this element as victim
self
.
objectInterruptions
=
[]
# alias used for printing the trace
# alias used for printing the trace
self
.
alias
=
None
self
.
alias
=
None
...
...
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