diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/loader.py | 3 | ||||
-rw-r--r-- | lib/model.py | 16 |
2 files changed, 19 insertions, 0 deletions
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} |