summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbin/analyze-archive.py12
-rw-r--r--lib/loader.py3
-rw-r--r--lib/model.py16
3 files changed, 30 insertions, 1 deletions
diff --git a/bin/analyze-archive.py b/bin/analyze-archive.py
index 25dfa27..ebf9f38 100755
--- a/bin/analyze-archive.py
+++ b/bin/analyze-archive.py
@@ -87,7 +87,17 @@ def model_quality_table(result_lists, info_list):
for i, results in enumerate(result_lists):
info = info_list[i]
buf += " ||| "
- if info is None or info(state_or_tran, key):
+ if (
+ info is None
+ or info(state_or_tran, key)
+ or (
+ key == "energy_Pt"
+ and (
+ info(state_or_tran, "power")
+ or info(state_or_tran, "duration")
+ )
+ )
+ ):
result = results["by_name"][state_or_tran][key]
buf += format_quality_measures(result)
else:
diff --git a/lib/loader.py b/lib/loader.py
index 43d591b..577336a 100644
--- a/lib/loader.py
+++ b/lib/loader.py
@@ -1181,6 +1181,9 @@ def _add_trace_data_to_aggregate(aggregate, key, element):
"power",
"rel_power_prev",
"rel_power_next",
+ "energy",
+ "rel_energy_prev",
+ "rel_energy_next",
]
# Uncomment this line if you also want to analyze mean transition power
# aggregate[key]['attributes'].append('power')
diff --git a/lib/model.py b/lib/model.py
index 781a29c..9070ece 100644
--- a/lib/model.py
+++ b/lib/model.py
@@ -1132,6 +1132,22 @@ class PTAModel:
)
measures = regression_measures(predicted_data, elem[key])
detailed_results[name][key] = measures
+ if elem["isa"] == "transition":
+ predicted_data = np.array(
+ list(
+ map(
+ lambda i: model_function(
+ name, "power", param=elem["param"][i]
+ )
+ * model_function(name, "duration", param=elem["param"][i]),
+ range(len(elem["power"])),
+ )
+ )
+ )
+ measures = regression_measures(
+ predicted_data, elem["power"] * elem["duration"]
+ )
+ detailed_results[name]["energy_Pt"] = measures
return {"by_name": detailed_results}