Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
monticore
EmbeddedMontiArc
generators
EMAM2Middleware
Commits
22170bd4
Commit
22170bd4
authored
Mar 13, 2019
by
Philipp Görick
Browse files
Add montecarloVisualisation script
parent
1c483936
Pipeline
#111224
failed with stages
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/test/resources/evaluationVisualisation.py
View file @
22170bd4
...
...
@@ -16,16 +16,16 @@ parser.add_argument('daimler', metavar='daimler',
args
=
parser
.
parse_args
()
#'D:\\Software\\Praktikum\\EMAM2Middleware\\target\\evaluation\\autopilot\\emam\\clusteringResults.json'
with
open
(
args
.
autopilot
)
as
data_file
:
autopilot_data
=
json
.
load
(
data_file
)
#'D:\\Software\\Praktikum\\EMAM2Middleware\\target\\evaluation\\pacman\\emam\\clusteringResults.json'
with
open
(
args
.
pacman
)
as
data_file
:
pacman_data
=
json
.
load
(
data_file
)
#'D:\\Software\\Praktikum\\EMAM2Middleware\\target\\evaluation\\supermario\\emam\\clusteringResults.json'
with
open
(
args
.
supermario
)
as
data_file
:
supermario_data
=
json
.
load
(
data_file
)
#'D:\\Software\\Praktikum\\clusteringResults.json'
with
open
(
args
.
daimler
)
as
data_file
:
daimler_data
=
json
.
load
(
data_file
)
...
...
src/test/resources/montecarlovisualisation.py
0 → 100644
View file @
22170bd4
import
json
import
numpy
as
np
import
matplotlib.pyplot
as
plt
import
argparse
import
math
parser
=
argparse
.
ArgumentParser
(
description
=
'Get json files'
)
parser
.
add_argument
(
'autopilot'
,
metavar
=
'autopilot'
,
help
=
'montecarloresult json location of autopilot'
)
parser
.
add_argument
(
'pacman'
,
metavar
=
'pacman'
,
help
=
'montecarloresult json location of pacman'
)
parser
.
add_argument
(
'supermario'
,
metavar
=
'supermario'
,
help
=
'montecarloresult json location of supermario'
)
parser
.
add_argument
(
'daimler'
,
metavar
=
'daimler'
,
help
=
'montecarloresult json location of daimlermodel'
)
args
=
parser
.
parse_args
()
with
open
(
args
.
autopilot
)
as
data_file
:
autopilot_data
=
json
.
load
(
data_file
)
with
open
(
args
.
pacman
)
as
data_file
:
pacman_data
=
json
.
load
(
data_file
)
with
open
(
args
.
supermario
)
as
data_file
:
supermario_data
=
json
.
load
(
data_file
)
with
open
(
args
.
daimler
)
as
data_file
:
daimler_data
=
json
.
load
(
data_file
)
autopilot_montecarlodata
=
[]
pacman_montecarlodata
=
[]
supermario_montecarlodata
=
[]
i
=
1
while
i
<
1001
:
autopilot_montecarlodata
.
append
(
autopilot_data
[
0
][
"MCResult("
+
str
(
i
)
+
")"
])
pacman_montecarlodata
.
append
(
pacman_data
[
0
][
"MCResult("
+
str
(
i
)
+
")"
])
supermario_montecarlodata
.
append
(
supermario_data
[
0
][
"MCResult("
+
str
(
i
)
+
")"
])
i
=
i
+
1
daimler_montecarlodata
=
[]
i
=
1
while
i
<
101
:
daimler_montecarlodata
.
append
(
daimler_data
[
0
][
"MCResult("
+
str
(
i
)
+
")"
])
i
=
i
+
1
t
=
np
.
arange
(
1
,
1001
,
1
)
fig
,
ax
=
plt
.
subplots
()
ax
.
plot
(
t
,
autopilot_montecarlodata
)
ax
.
set
(
xlabel
=
'Iterations'
,
ylabel
=
'Score'
,
title
=
'Montecarlo Clustering of Autopilotmodel with 3 Clusters'
)
ax
.
grid
()
plt
.
show
()
fig
,
ax
=
plt
.
subplots
()
ax
.
plot
(
t
,
pacman_montecarlodata
)
ax
.
set
(
xlabel
=
'Iterations'
,
ylabel
=
'Score'
,
title
=
'Montecarlo Clustering of Pacmanmodel with 3 Clusters'
)
ax
.
grid
()
plt
.
show
()
fig
,
ax
=
plt
.
subplots
()
ax
.
plot
(
t
,
supermario_montecarlodata
)
ax
.
set
(
xlabel
=
'Iterations'
,
ylabel
=
'Score'
,
title
=
'Montecarlo Clustering of Supermariomodel with 3 Clusters'
)
ax
.
grid
()
plt
.
show
()
t
=
np
.
arange
(
0
,
100
,
1
)
fig
,
ax
=
plt
.
subplots
()
ax
.
plot
(
t
,
daimler_montecarlodata
)
ax
.
set
(
xlabel
=
'Iterations'
,
ylabel
=
'Score'
,
title
=
'Montecarlo Clustering of Daimlermodel'
)
ax
.
grid
()
plt
.
show
()
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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