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
29041875
Commit
29041875
authored
Nov 26, 2014
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
main script to read periodic maintenance
parent
43fb1279
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
0 deletions
+14
-0
dream/simulation/LineGenerationJSON.py
dream/simulation/LineGenerationJSON.py
+14
-0
No files found.
dream/simulation/LineGenerationJSON.py
View file @
29041875
...
...
@@ -238,6 +238,7 @@ def createObjectInterruptions():
G
.
ShiftSchedulerList
=
[]
G
.
EventGeneratorList
=
[]
G
.
CapacityStationControllerList
=
[]
G
.
PeriodicMaintenanceList
=
[]
json_data
=
G
.
JSONData
#Read the json data
nodes
=
json_data
[
'nodes'
]
# read from the dictionary the dicts with key 'nodes'
...
...
@@ -270,6 +271,7 @@ def createObjectInterruptions():
# define interruptions' distribution better
from
dream.simulation.ScheduledMaintenance
import
ScheduledMaintenance
from
dream.simulation.Failure
import
Failure
from
dream.simulation.PeriodicMaintenance
import
PeriodicMaintenance
from
dream.simulation.ShiftScheduler
import
ShiftScheduler
for
(
element_id
,
element
)
in
nodes
.
iteritems
():
element
[
'id'
]
=
element_id
...
...
@@ -296,6 +298,18 @@ def createObjectInterruptions():
F
=
Failure
(
victim
=
victim
,
distribution
=
failure
,
repairman
=
victim
.
repairman
,
deteriorationType
=
deteriorationType
)
G
.
ObjectInterruptionList
.
append
(
F
)
G
.
FailureList
.
append
(
F
)
# if there are periodic maintenances assigned
# initiate them
periodicMaintenance
=
element
.
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
)
# if there is a shift pattern defined
# initiate them
shift
=
element
.
get
(
'shift'
,
{})
...
...
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