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
1abbe737
Commit
1abbe737
authored
Mar 24, 2015
by
panos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
The KE tool main script for this example gets updated
parent
f1d72ab5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
7 deletions
+16
-7
dream/KnowledgeExtraction/KEtool_examples/TwoParallelStations/TwoParallelStations_example.py
...amples/TwoParallelStations/TwoParallelStations_example.py
+16
-7
No files found.
dream/KnowledgeExtraction/KEtool_examples/TwoParallelStations/TwoParallelStations_example.py
View file @
1abbe737
...
...
@@ -54,19 +54,29 @@ KS = DistFittest() #Call the DistFittest object (Kolmoghorov-Smirnov test)
M1ProcTime_dist
=
KS
.
ks_test
(
M1_ProcTime
)
M2ProcTime_dist
=
MLE
.
Normal_distrfit
(
M2_ProcTime
)
#======================= Output preparation: output the updated values in the JSON file of this example ================================#
jsonFile
=
open
(
'
JSON_TwoParallelStations
.json'
,
'r'
)
#It opens the JSON file
jsonFile
=
open
(
'
OLD_JSON_TwoParallel
.json'
,
'r'
)
#It opens the JSON file
data
=
json
.
load
(
jsonFile
)
#It loads the file
jsonFile
.
close
()
nodes
=
data
.
get
(
'nodes'
,[])
#It creates a variable that holds the 'nodes' dictionary
nodes
=
data
[
'graph'
][
'node'
]
#It creates a variable that holds the 'nodes' dictionary
procTimeM1dict
=
{}
procTimeM2dict
=
{}
dist
=
M1ProcTime_dist
[
'distributionType'
]
del
M1ProcTime_dist
[
'distributionType'
]
procTimeM1dict
[
dist
]
=
M1ProcTime_dist
dist
=
M2ProcTime_dist
[
'distributionType'
]
del
M2ProcTime_dist
[
'distributionType'
]
procTimeM2dict
[
dist
]
=
M2ProcTime_dist
for
element
in
nodes
:
processingTime
=
nodes
[
element
].
get
(
'processingTime'
,{})
#It creates a variable that gets the element attribute 'processingTime'
processingTime
=
nodes
[
element
].
get
(
'processingTime'
,{})
#It creates a variable that gets the element attribute 'processingTime'
if
element
==
'St1'
:
nodes
[
'St1'
][
'processingTime'
]
=
M1ProcTime_dis
t
#It checks using if syntax if the element is 'M1'
nodes
[
'St1'
][
'processingTime'
]
=
procTimeM1dic
t
#It checks using if syntax if the element is 'M1'
elif
element
==
'St2'
:
nodes
[
'St2'
][
'processingTime'
]
=
M2ProcTime_dis
t
#It checks using if syntax if the element is 'M2'
nodes
[
'St2'
][
'processingTime'
]
=
procTimeM2dic
t
#It checks using if syntax if the element is 'M2'
jsonFile
=
open
(
'JSON_ParallelStations_Output.json'
,
"w"
)
#It opens the JSON file
...
...
@@ -81,7 +91,6 @@ export.PrintStatisticalMeasures(M2_ProcTime,'M2_ProcTime_StatResults.xls')
export
.
PrintDistributionFit
(
M1_ProcTime
,
'M1_ProcTime_DistFitResults.xls'
)
export
.
PrintDistributionFit
(
M2_ProcTime
,
'M2_ProcTime_DistFitResults.xls'
)
#calls ManPy main script with the input
simulationOutput
=
ManPyMain
.
main
(
input_data
=
json
.
dumps
(
data
))
# save the simulation output
...
...
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