diff options
author | 2019-08-08 16:45:45 -0400 | |
---|---|---|
committer | 2019-08-08 16:45:45 -0400 | |
commit | c33f0b9c4e112ee573d1b26d205a253cc0e487f8 (patch) | |
tree | 1ec2c4ab56b5bc0d0d56fa111bab0520c05604b4 /Metrics/Metrics-Calculation/metrics_plot/utils | |
parent | Further development of realistic solver, create generation config for ecore m... (diff) | |
download | VIATRA-Generator-c33f0b9c4e112ee573d1b26d205a253cc0e487f8.tar.gz VIATRA-Generator-c33f0b9c4e112ee573d1b26d205a253cc0e487f8.tar.zst VIATRA-Generator-c33f0b9c4e112ee573d1b26d205a253cc0e487f8.zip |
Configurations for generation and new domain for generation ecore model
Diffstat (limited to 'Metrics/Metrics-Calculation/metrics_plot/utils')
3 files changed, 7 insertions, 0 deletions
diff --git a/Metrics/Metrics-Calculation/metrics_plot/utils/GraphType.py b/Metrics/Metrics-Calculation/metrics_plot/utils/GraphType.py index feb9a0a9..0a9a95c5 100644 --- a/Metrics/Metrics-Calculation/metrics_plot/utils/GraphType.py +++ b/Metrics/Metrics-Calculation/metrics_plot/utils/GraphType.py | |||
@@ -30,3 +30,6 @@ class GraphStat: | |||
30 | self.id = (contents[constants.STATE_ID])[0] | 30 | self.id = (contents[constants.STATE_ID])[0] |
31 | if constants.Node_TYPE_KEY in contents: | 31 | if constants.Node_TYPE_KEY in contents: |
32 | self.nodeTypeStat = contents[constants.Node_TYPE_KEY] | 32 | self.nodeTypeStat = contents[constants.Node_TYPE_KEY] |
33 | if constants.VIOLATION in contents: | ||
34 | self.violations = int(contents[constants.VIOLATION][0]) | ||
35 | |||
diff --git a/Metrics/Metrics-Calculation/metrics_plot/utils/constants.py b/Metrics/Metrics-Calculation/metrics_plot/utils/constants.py index 51e538f8..be115a05 100644 --- a/Metrics/Metrics-Calculation/metrics_plot/utils/constants.py +++ b/Metrics/Metrics-Calculation/metrics_plot/utils/constants.py | |||
@@ -28,3 +28,5 @@ HUMAN_MPC_REP = '../input/humanOutput/R_2016324_run_1.csv' | |||
28 | 28 | ||
29 | HUMAN_NA_REP = '../input/humanOutput/R_2017419_run_1.csv' | 29 | HUMAN_NA_REP = '../input/humanOutput/R_2017419_run_1.csv' |
30 | 30 | ||
31 | VIOLATION = 'violations' | ||
32 | |||
diff --git a/Metrics/Metrics-Calculation/metrics_plot/utils/readCSV.py b/Metrics/Metrics-Calculation/metrics_plot/utils/readCSV.py index 1cec2f0c..394168d8 100644 --- a/Metrics/Metrics-Calculation/metrics_plot/utils/readCSV.py +++ b/Metrics/Metrics-Calculation/metrics_plot/utils/readCSV.py | |||
@@ -30,6 +30,8 @@ def readcsvfile(filename): | |||
30 | elif(arr[0] == constants.NODE_TYPE): | 30 | elif(arr[0] == constants.NODE_TYPE): |
31 | types = data[i+1].replace('\n', '').split(',') | 31 | types = data[i+1].replace('\n', '').split(',') |
32 | numbers = data[i+2].replace('\n', '').split(',') | 32 | numbers = data[i+2].replace('\n', '').split(',') |
33 | #convert number to floats | ||
34 | numbers = [float(n) for n in numbers] | ||
33 | contents[constants.Node_TYPE_KEY] = {t : n for t, n in zip(types, numbers)} | 35 | contents[constants.Node_TYPE_KEY] = {t : n for t, n in zip(types, numbers)} |
34 | # NA and OD are integers, and store other information as string | 36 | # NA and OD are integers, and store other information as string |
35 | else: | 37 | else: |