diff options
Diffstat (limited to 'Metrics/Metrics-Calculation/metrics_plot/model comparison')
35 files changed, 42 insertions, 29 deletions
diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-/MPC.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-/MPC.png deleted file mode 100644 index b76e1162..00000000 --- a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-/MPC.png +++ /dev/null | |||
Binary files differ | |||
diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-/Node Activity.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-/Node Activity.png deleted file mode 100644 index 7c1e381e..00000000 --- a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-/Node Activity.png +++ /dev/null | |||
Binary files differ | |||
diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-/Out Degree.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-/Out Degree.png deleted file mode 100644 index b6c865a8..00000000 --- a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-/Out Degree.png +++ /dev/null | |||
Binary files differ | |||
diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-50-500-No-Annotations-Viatra (75 nodes)-/MPC.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-50-500-No-Annotations-Viatra (75 nodes)-/MPC.png deleted file mode 100644 index e734a9c2..00000000 --- a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-50-500-No-Annotations-Viatra (75 nodes)-/MPC.png +++ /dev/null | |||
Binary files differ | |||
diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-50-500-No-Annotations-Viatra (75 nodes)-/Node Activity.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-50-500-No-Annotations-Viatra (75 nodes)-/Node Activity.png deleted file mode 100644 index a4f9033f..00000000 --- a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-50-500-No-Annotations-Viatra (75 nodes)-/Node Activity.png +++ /dev/null | |||
Binary files differ | |||
diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-50-500-No-Annotations-Viatra (75 nodes)-/Out Degree.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-50-500-No-Annotations-Viatra (75 nodes)-/Out Degree.png deleted file mode 100644 index 343550b4..00000000 --- a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-50-500-No-Annotations-Viatra (75 nodes)-/Out Degree.png +++ /dev/null | |||
Binary files differ | |||
diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-50-500-Viatra (75 nodes)-/MPC.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-50-500-Viatra (75 nodes)-/MPC.png deleted file mode 100644 index 8795605d..00000000 --- a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-50-500-Viatra (75 nodes)-/MPC.png +++ /dev/null | |||
Binary files differ | |||
diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-50-500-Viatra (75 nodes)-/Node Activity.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-50-500-Viatra (75 nodes)-/Node Activity.png deleted file mode 100644 index 5abfa423..00000000 --- a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-50-500-Viatra (75 nodes)-/Node Activity.png +++ /dev/null | |||
Binary files differ | |||
diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-50-500-Viatra (75 nodes)-/Out Degree.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-50-500-Viatra (75 nodes)-/Out Degree.png deleted file mode 100644 index e21d38f8..00000000 --- a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-50-500-Viatra (75 nodes)-/Out Degree.png +++ /dev/null | |||
Binary files differ | |||
diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-Alloy-BaseViatra-RealViatra-Random-rep-/MPC.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-Alloy-BaseViatra-RealViatra-Random-rep-/MPC.png new file mode 100644 index 00000000..b52aa827 --- /dev/null +++ b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-Alloy-BaseViatra-RealViatra-Random-rep-/MPC.png | |||
Binary files differ | |||
diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-Alloy-BaseViatra-RealViatra-Random-rep-/MPC_lengend.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-Alloy-BaseViatra-RealViatra-Random-rep-/MPC_lengend.png new file mode 100644 index 00000000..6adb45e2 --- /dev/null +++ b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-Alloy-BaseViatra-RealViatra-Random-rep-/MPC_lengend.png | |||
Binary files differ | |||
diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-Alloy-BaseViatra-RealViatra-Random-rep-/Node Types.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-Alloy-BaseViatra-RealViatra-Random-rep-/Node Types.png new file mode 100644 index 00000000..e257f381 --- /dev/null +++ b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-Alloy-BaseViatra-RealViatra-Random-rep-/Node Types.png | |||
Binary files differ | |||
diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-Alloy-BaseViatra-RealViatra-Random-rep-/Node Types_lengend.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-Alloy-BaseViatra-RealViatra-Random-rep-/Node Types_lengend.png new file mode 100644 index 00000000..2672ee2c --- /dev/null +++ b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-Alloy-BaseViatra-RealViatra-Random-rep-/Node Types_lengend.png | |||
Binary files differ | |||
diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-Alloy-BaseViatra-RealViatra-Random-rep-/Node_Activity.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-Alloy-BaseViatra-RealViatra-Random-rep-/Node_Activity.png new file mode 100644 index 00000000..33adbfe9 --- /dev/null +++ b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-Alloy-BaseViatra-RealViatra-Random-rep-/Node_Activity.png | |||
Binary files differ | |||
diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-Alloy-BaseViatra-RealViatra-Random-rep-/Node_Activity_lengend.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-Alloy-BaseViatra-RealViatra-Random-rep-/Node_Activity_lengend.png new file mode 100644 index 00000000..d64df78b --- /dev/null +++ b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-Alloy-BaseViatra-RealViatra-Random-rep-/Node_Activity_lengend.png | |||
Binary files differ | |||
diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-Alloy-BaseViatra-RealViatra-Random-rep-/Node_Types.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-Alloy-BaseViatra-RealViatra-Random-rep-/Node_Types.png new file mode 100644 index 00000000..eb245365 --- /dev/null +++ b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-Alloy-BaseViatra-RealViatra-Random-rep-/Node_Types.png | |||
Binary files differ | |||
diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-Alloy-BaseViatra-RealViatra-Random-rep-/Out_Degree.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-Alloy-BaseViatra-RealViatra-Random-rep-/Out_Degree.png new file mode 100644 index 00000000..2c8f53f6 --- /dev/null +++ b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-Alloy-BaseViatra-RealViatra-Random-rep-/Out_Degree.png | |||
Binary files differ | |||
diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-Alloy-BaseViatra-RealViatra-Random-rep-/Out_Degree_lengend.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-Alloy-BaseViatra-RealViatra-Random-rep-/Out_Degree_lengend.png new file mode 100644 index 00000000..86b7c3a0 --- /dev/null +++ b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-Alloy-BaseViatra-RealViatra-Random-rep-/Out_Degree_lengend.png | |||
Binary files differ | |||
diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-Alloy-rep-/Node Types.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-Alloy-rep-/Node Types.png new file mode 100644 index 00000000..81085eab --- /dev/null +++ b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-Alloy-rep-/Node Types.png | |||
Binary files differ | |||
diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-Alloy-rep-/Node Types_lengend.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-Alloy-rep-/Node Types_lengend.png new file mode 100644 index 00000000..e92f1b26 --- /dev/null +++ b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-Alloy-rep-/Node Types_lengend.png | |||
Binary files differ | |||
diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-Alloy-rep-/Out_Degree.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-Alloy-rep-/Out_Degree.png new file mode 100644 index 00000000..25b35ee7 --- /dev/null +++ b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-Alloy-rep-/Out_Degree.png | |||
Binary files differ | |||
diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-Alloy-rep-/Out_Degree_lengend.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-Alloy-rep-/Out_Degree_lengend.png new file mode 100644 index 00000000..d2c660c0 --- /dev/null +++ b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-Alloy-rep-/Out_Degree_lengend.png | |||
Binary files differ | |||
diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-BaseViatra-RealViatra-rep-/MPC.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-BaseViatra-RealViatra-rep-/MPC.png new file mode 100644 index 00000000..52b5e5f6 --- /dev/null +++ b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-BaseViatra-RealViatra-rep-/MPC.png | |||
Binary files differ | |||
diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-BaseViatra-RealViatra-rep-/MPC_lengend.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-BaseViatra-RealViatra-rep-/MPC_lengend.png new file mode 100644 index 00000000..9e8289a8 --- /dev/null +++ b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-BaseViatra-RealViatra-rep-/MPC_lengend.png | |||
Binary files differ | |||
diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-BaseViatra-RealViatra-rep-/Node Activity.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-BaseViatra-RealViatra-rep-/Node Activity.png new file mode 100644 index 00000000..e8a3093f --- /dev/null +++ b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-BaseViatra-RealViatra-rep-/Node Activity.png | |||
Binary files differ | |||
diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-BaseViatra-RealViatra-rep-/Node Activity_lengend.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-BaseViatra-RealViatra-rep-/Node Activity_lengend.png new file mode 100644 index 00000000..24a6fee6 --- /dev/null +++ b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-BaseViatra-RealViatra-rep-/Node Activity_lengend.png | |||
Binary files differ | |||
diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-BaseViatra-RealViatra-rep-/Out Degree.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-BaseViatra-RealViatra-rep-/Out Degree.png new file mode 100644 index 00000000..7c5c9251 --- /dev/null +++ b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-BaseViatra-RealViatra-rep-/Out Degree.png | |||
Binary files differ | |||
diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-BaseViatra-RealViatra-rep-/Out Degree_lengend.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-BaseViatra-RealViatra-rep-/Out Degree_lengend.png new file mode 100644 index 00000000..87845cef --- /dev/null +++ b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human-BaseViatra-RealViatra-rep-/Out Degree_lengend.png | |||
Binary files differ | |||
diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human_anno-Human_No_anno-/MPC.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human_anno-Human_No_anno-/MPC.png deleted file mode 100644 index da20de14..00000000 --- a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human_anno-Human_No_anno-/MPC.png +++ /dev/null | |||
Binary files differ | |||
diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human_anno-Human_No_anno-/Node Activity.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human_anno-Human_No_anno-/Node Activity.png deleted file mode 100644 index 0c60d130..00000000 --- a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human_anno-Human_No_anno-/Node Activity.png +++ /dev/null | |||
Binary files differ | |||
diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human_anno-Human_No_anno-/Out Degree.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human_anno-Human_No_anno-/Out Degree.png deleted file mode 100644 index e2cadbc5..00000000 --- a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/Human_anno-Human_No_anno-/Out Degree.png +++ /dev/null | |||
Binary files differ | |||
diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/human_no_xml-human_xml-/MPC.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/human_no_xml-human_xml-/MPC.png deleted file mode 100644 index ccd02aca..00000000 --- a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/human_no_xml-human_xml-/MPC.png +++ /dev/null | |||
Binary files differ | |||
diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/human_no_xml-human_xml-/Node Activity.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/human_no_xml-human_xml-/Node Activity.png deleted file mode 100644 index 1edf0945..00000000 --- a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/human_no_xml-human_xml-/Node Activity.png +++ /dev/null | |||
Binary files differ | |||
diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/human_no_xml-human_xml-/Out Degree.png b/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/human_no_xml-human_xml-/Out Degree.png deleted file mode 100644 index 1e70734b..00000000 --- a/Metrics/Metrics-Calculation/metrics_plot/model comparison/output/human_no_xml-human_xml-/Out Degree.png +++ /dev/null | |||
Binary files differ | |||
diff --git a/Metrics/Metrics-Calculation/metrics_plot/model comparison/src/plot_ks_stats.py b/Metrics/Metrics-Calculation/metrics_plot/model comparison/src/plot_ks_stats.py index eb9d4ae2..02f28546 100644 --- a/Metrics/Metrics-Calculation/metrics_plot/model comparison/src/plot_ks_stats.py +++ b/Metrics/Metrics-Calculation/metrics_plot/model comparison/src/plot_ks_stats.py | |||
@@ -12,36 +12,45 @@ import DistributionMetrics as metrics | |||
12 | 12 | ||
13 | def main(): | 13 | def main(): |
14 | # read models | 14 | # read models |
15 | human = GraphCollection('../input/human_30_500_no_xml/', 500, 'human_no_xml') | 15 | alloy = GraphCollection('../input/measurement2/yakindu/Alloy/', 100, 'Alloy') |
16 | human2 = GraphCollection('../input/human_30_500_xml/', 500, 'human_xml') | 16 | human = GraphCollection('../input/measurement2/yakindu/Human/', 304, 'Human') |
17 | # human_na = GraphCollection('../input/human_models_50_500/na_rep/', 1, 'Human rep') | 17 | base = GraphCollection('../input/measurement2/yakindu/BaseViatra/', 100, 'BaseViatra') |
18 | # human_mpc = GraphCollection('../input/human_models_50_500/mpc_rep/', 1, 'Human rep') | 18 | real = GraphCollection('../input/measurement2/yakindu/RealViatra/', 100, 'RealViatra') |
19 | # human_od = GraphCollection('../input/human_models_50_500/od_rep/', 1, 'Human rep') | 19 | random = GraphCollection('../input/measurement2/yakindu/Random/', 100, 'Random') |
20 | 20 | na_rep = GraphCollection('../input/measurement2/yakindu/Human/na_rep/', 1, 'rep') | |
21 | # viatra75 = GraphCollection('../input/viatra_75/', 500, 'Viatra (75 nodes)') | 21 | mpc_rep = GraphCollection('../input/measurement2/yakindu/Human/mpc_rep/', 1, 'rep') |
22 | # viatra30 = GraphCollection('../input/viatraOutput30/', 500,'Viatra (30 nodes)') | 22 | od_rep = GraphCollection('../input/measurement2/yakindu/Human/od_rep/', 1, 'rep') |
23 | # viatra60 = GraphCollection('../input/viatraOutput60/', 500, 'Viatra (60 nodes)') | 23 | |
24 | # viatra100 = GraphCollection('../input/viatraOutput100/', 500, 'Viatra (100 nodes)') | 24 | # a hack to make the node type as the same as an exiting model |
25 | # viatra100R = GraphCollection('../input/realisticViatraOutput_newMetric/', 500, 'Realistic Viatra (100 nodes)') | 25 | type_rep = GraphCollection('../input/measurement2/yakindu/Human/od_rep/', 1, 'rep') |
26 | # viatra100C = GraphCollection('../input/yakindumm/viatraOutput100C/', 500, 'Viatra consistent (100 nodes)') | 26 | type_rep.nts = [{'Entry': 0.04257802080554814, 'Choice': 0.1267671379034409, 'State': 0.1596092291277674, 'Transition': 0.6138636969858629, 'Statechart': 0.010136036276340358, 'Region': 0.04467858095492131, 'Exit': 0.0018338223526273673, 'FinalState': 0.0005334755934915977}] |
27 | # viatra100EE = GraphCollection('../input/realisticViatra_excludeExit/', 500, 'Realistic Viatra no Exit (100 nodes)') | 27 | types = sorted(type_rep.nts[0].keys()) |
28 | # viatra100EEF = GraphCollection('../input/realisticViatra_excludeExitFinal/', 500, 'Realistic Viatra no Exit Final (100 nodes)') | ||
29 | # viatra100NT = GraphCollection('../input/yakindumm/realisticVIatraOutput_nodeTypeKS/', 500, 'Realistic Viatra with Node Type KS (100 nodes)') | ||
30 | 28 | ||
31 | # random = GraphCollection('../input/randomOutput/', 500, 'Random') | 29 | # random = GraphCollection('../input/randomOutput/', 500, 'Random') |
32 | # alloy = GraphCollection('../input/alloy/', 500, 'Alloy (30 nodes)') | 30 | # alloy = GraphCollection('../input/alloy/', 500, 'Alloy (30 nodes)') |
33 | # realistic_viatra = GraphCollection('../input/viatra_output_consistent_100/', 50, 'Realistic Viatra With Some Constraints (100 nodes)') | 31 | # realistic_viatra = GraphCollection('../input/viatra_output_consistent_100/', 50, 'Realistic Viatra With Some Constraints (100 nodes)') |
34 | models_to_compare_na = [human, human2] | 32 | models_to_compare_na = [human, alloy,base, real, random, na_rep] |
35 | models_to_compare_mpc = [human, human2] | 33 | models_to_compare_mpc = [human, alloy,base, real, random, mpc_rep] |
36 | models_to_compare_od = [human, human2] | 34 | models_to_compare_od = [human, alloy,base, real, random, od_rep] |
37 | 35 | models_to_compare_nt = [human, alloy,base, real, random, type_rep] | |
36 | for modelCollection in models_to_compare_nt: | ||
37 | type_dists = [] | ||
38 | for nt in modelCollection.nts: | ||
39 | type_dist = [] | ||
40 | for key in types: | ||
41 | type_dist.append(nt.get(key, 0.0)) | ||
42 | type_dists.append(type_dist) | ||
43 | modelCollection.nts = type_dists | ||
44 | |||
45 | |||
38 | # define output folder | 46 | # define output folder |
39 | outputFolder = '../output/' | 47 | outputFolder = '../output/' |
40 | 48 | ||
41 | #calculate metrics | 49 | #calculate metrics |
42 | metricStat(models_to_compare_na, 'Node Activity', nodeActivity, 0, outputFolder) | 50 | # metricStat(models_to_compare_na, 'Node_Activity', nodeActivity, 0, outputFolder) |
43 | metricStat(models_to_compare_od, 'Out Degree', outDegree, 1, outputFolder) | 51 | metricStat(models_to_compare_od, 'Out_Degree', outDegree, 1, outputFolder) |
44 | metricStat(models_to_compare_mpc, 'MPC', mpc, 2, outputFolder) | 52 | # metricStat(models_to_compare_mpc, 'MPC', mpc, 2, outputFolder) |
53 | # metricStat(models_to_compare_nt, 'Node Types', nodeType, 3, outputFolder) | ||
45 | 54 | ||
46 | def calculateKSMatrix(dists): | 55 | def calculateKSMatrix(dists): |
47 | dist = [] | 56 | dist = [] |
@@ -65,18 +74,19 @@ def calculateMDS(dissimilarities): | |||
65 | return trans | 74 | return trans |
66 | 75 | ||
67 | def plot(graphTypes, coords, title='',index = 0, savePath = ''): | 76 | def plot(graphTypes, coords, title='',index = 0, savePath = ''): |
68 | color = ['blue', 'red', 'yellow', 'green', 'k'] | 77 | color = ['blue', 'm', 'gold', 'green', 'k', 'red'] |
69 | plt.figure(index, figsize=(7, 4)) | 78 | markers = ['o', 'v', '+', 'x', '^', '*'] |
70 | plt.title(title) | 79 | plt.figure(index, figsize=(5, 4)) |
80 | # plt.title(title) | ||
71 | index = 0 | 81 | index = 0 |
72 | for i in range(len(graphTypes)): | 82 | for i in range(len(graphTypes)): |
73 | x = (coords[index:index+graphTypes[i].size, 0].tolist()) | 83 | x = (coords[index:index+graphTypes[i].size, 0].tolist()) |
74 | y = (coords[index:index+graphTypes[i].size, 1].tolist()) | 84 | y = (coords[index:index+graphTypes[i].size, 1].tolist()) |
75 | index += graphTypes[i].size | 85 | index += graphTypes[i].size |
76 | plt.plot(x, y, color=color[i], marker='o', label = graphTypes[i].name, linestyle='', alpha=0.7) | 86 | plt.plot(x, y, color=color[i], marker=markers[i], label = graphTypes[i].name, linestyle='', alpha=0.7) |
87 | plt.savefig(fname = savePath+'.png', dpi=500) | ||
77 | plt.legend(loc='upper right') | 88 | plt.legend(loc='upper right') |
78 | plt.savefig(fname = savePath, dpi=150) | 89 | plt.savefig(fname = savePath+'_lengend.png', dpi=500) |
79 | #graph.show() | ||
80 | 90 | ||
81 | def mkdir_p(mypath): | 91 | def mkdir_p(mypath): |
82 | '''Creates a directory. equivalent to using mkdir -p on the command line''' | 92 | '''Creates a directory. equivalent to using mkdir -p on the command line''' |
@@ -99,7 +109,7 @@ def metricStat(graphTypes, metricName, metric, graphIndex, outputFolder): | |||
99 | print('calculate' + metricName +' for ' + outputFolder) | 109 | print('calculate' + metricName +' for ' + outputFolder) |
100 | mkdir_p(outputFolder) | 110 | mkdir_p(outputFolder) |
101 | out_d_coords = calculateMDS(calculateKSMatrix(metrics)) | 111 | out_d_coords = calculateMDS(calculateKSMatrix(metrics)) |
102 | plot(graphTypes, out_d_coords, metricName, graphIndex,outputFolder + '/'+ metricName+'.png') | 112 | plot(graphTypes, out_d_coords, metricName, graphIndex,outputFolder + '/'+ metricName) |
103 | 113 | ||
104 | def nodeActivity(graphType): | 114 | def nodeActivity(graphType): |
105 | return graphType.nas | 115 | return graphType.nas |
@@ -110,5 +120,8 @@ def outDegree(graphType): | |||
110 | def mpc(graphType): | 120 | def mpc(graphType): |
111 | return graphType.mpcs | 121 | return graphType.mpcs |
112 | 122 | ||
123 | def nodeType(graphType): | ||
124 | return graphType.nts | ||
125 | |||
113 | if __name__ == '__main__': | 126 | if __name__ == '__main__': |
114 | main() \ No newline at end of file | 127 | main() \ No newline at end of file |