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
99c68cf9
Commit
99c68cf9
authored
Dec 16, 2014
by
Ioannis Papagiannopoulos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minor corrections to comply with the new schema definition (graph>node/edge
parent
e1c4d2a2
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
9 deletions
+23
-9
dream/simulation/GUI/Default.py
dream/simulation/GUI/Default.py
+3
-2
dream/simulation/LineGenerationJSON.py
dream/simulation/LineGenerationJSON.py
+5
-4
dream/simulation/Machine.py
dream/simulation/Machine.py
+15
-3
No files found.
dream/simulation/GUI/Default.py
View file @
99c68cf9
...
...
@@ -377,8 +377,9 @@ class Simulation(object):
"""Preprocess the data, for instance reading spreadsheet.
"""
# by default we add an event generator if using queue stats
if
self
.
getConfigurationDict
()[
"Dream-Configuration"
][
"gui"
][
"queue_stat"
]:
for
node
in
data
[
"nodes"
].
values
():
# if self.getConfigurationDict()["Dream-Configuration"]["gui"]["queue_stat"]:
if
data
[
"application_configuration"
][
"output"
][
"view_queue_stats"
]:
for
node
in
data
[
"graph"
][
"node"
].
values
():
if
node
[
'_class'
]
in
(
'Dream.Queue'
,
):
node
[
'gatherWipStat'
]
=
1
return
data
...
...
dream/simulation/LineGenerationJSON.py
View file @
99c68cf9
...
...
@@ -75,8 +75,9 @@ def createObjectResourcesAndCoreObjects():
json_data
=
G
.
JSONData
#Read the json data
nodes
=
json_data
[
'nodes'
]
# read from the dictionary the dicts with key 'nodes'
edges
=
json_data
[
'edges'
]
# read from the dictionary the dicts with key 'edges'
# nodes = json_data['nodes'] # read from the dictionary the dicts with key 'nodes'
nodes
=
json_data
[
'graph'
][
"node"
]
# read from the dictionary the dicts with key 'nodes'
edges
=
json_data
[
'graph'
][
"edge"
]
# read from the dictionary the dicts with key 'edges'
'''
...
...
@@ -241,7 +242,7 @@ def createObjectInterruptions():
G
.
PeriodicMaintenanceList
=
[]
json_data
=
G
.
JSONData
#Read the json data
nodes
=
json_data
[
'
nodes'
]
# read from the dictionary the dicts with key 'nodes'
nodes
=
json_data
[
'
graph'
][
"node"
]
# read from the dictionary the dicts with key 'nodes'
# loop through all the nodes to
# search for Event Generator and create them
...
...
@@ -389,7 +390,7 @@ def createWIP():
G
.
OrderList
.
append
(
O
)
# read from the dictionary the dicts with key 'nodes'
nodes
=
json_data
[
'nodes
'
]
nodes
=
json_data
[
"graph"
][
'node
'
]
for
(
element_id
,
element
)
in
nodes
.
iteritems
():
element
[
'id'
]
=
element_id
wip
=
element
.
get
(
'wip'
,
[])
...
...
dream/simulation/Machine.py
View file @
99c68cf9
...
...
@@ -192,6 +192,18 @@ class Machine(CoreObject):
@
staticmethod
def
getOperationTime
(
time
):
def
refactorTime
(
time
):
if
time
:
if
time
[
"distribution"
]:
time
[
"distributionType"
]
=
time
[
"distribution"
]
for
key
in
time
[
time
[
"distribution"
]]:
time
[
key
]
=
time
[
time
[
"distribution"
]][
key
]
del
time
[
time
[
"distribution"
]]
del
time
[
"distribution"
]
return
time
# XXX update time to comply with old definition
time
=
refactorTime
(
time
)
'''returns the dictionary updated'''
if
not
time
:
time
=
{
'distributionType'
:
'Fixed'
,
...
...
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