summaryrefslogtreecommitdiff
path: root/lib/model.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/model.py')
-rw-r--r--lib/model.py16
1 files changed, 16 insertions, 0 deletions
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}