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
b883d170
Commit
b883d170
authored
Aug 22, 2014
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanup
parent
acc2fa6f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
25 deletions
+7
-25
dream/simulation/LineGenerationJSON.py
dream/simulation/LineGenerationJSON.py
+7
-25
No files found.
dream/simulation/LineGenerationJSON.py
View file @
b883d170
...
...
@@ -698,41 +698,23 @@ def createObjectInterruptions():
element
[
'id'
]
=
element_id
# create a new entry for the element (dictionary)
# with key 'id' and value the the element_id
objClass
=
element
.
get
(
'_class'
,
'not found'
)
# get the class type of the element
from
ObjectInterruption
import
ObjectInterruption
import
Globals
objClass
=
element
.
pop
(
'_class'
)
objectType
=
Globals
.
getClassFromName
(
objClass
)
# from CoreObject import CoreObject
# if issubclass(objectType, CoreObject):
if
objClass
in
[
'Dream.EventGenerator'
,
'Dream.CapacityStationController'
]:
# check the object type
if
issubclass
(
objectType
,
ObjectInterruption
):
# check the object type
inputDict
=
dict
(
element
)
# create the ObjectInterruption
objectInterruption
=
objectType
(
**
inputDict
)
G
.
ObjectInterruptionList
.
append
(
objectInterruption
)
# elif objClass=='Dream.CapacityStationController': # check the object type
# id = element.get('id', 'not found') # get the id of the element / default 'not_found'
# name = element.get('name', 'not found') # get the name of the element / default 'not_found'
# start = float(element.get('start') or 0)
# stop = float(element.get('stop') or -1)
# # infinity (had to be done to make it as float)
# if stop<0:
# stop=float('inf')
# interval = float(element.get('interval') or 1)
# duration = float(element.get('duration') or 0)
# dueDateThreshold = float(element.get('dueDateThreshold') or float('inf'))
# prioritizeIfCanFinish = bool(element.get('prioritizeIfCanFinish', 0))
# argumentDict=(element.get('argumentDict', {})) # get the arguments of the method as a dict / default {}
#
# # create the CapacityStationController object
# CSC = CapacityStationController(id, name, start=start, stop=stop, interval=interval,
# duration=duration, argumentDict=argumentDict, dueDateThreshold=dueDateThreshold,
# prioritizeIfCanFinish=prioritizeIfCanFinish)
# G.EventGeneratorList.append(CSC)
# G.CapacityStationControllerList.append(CSC)
# G.ObjectInterruptionList.append(CSC)
# for the elements in the nodes dict
# search inside the nodes for encapsulated ObjectInterruptions (failures etc)
# ToDo this will be cleaned a lot if we update the JSON notation:
# define ObjectInterruption echelon inside node
# define interruptions' distribution better
for
(
element_id
,
element
)
in
nodes
.
iteritems
():
element
[
'id'
]
=
element_id
scheduledMaintenance
=
element
.
get
(
'scheduledMaintenance'
,
{})
...
...
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