summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <daniel.friesel@uos.de>2021-10-11 14:07:20 +0200
committerDaniel Friesel <daniel.friesel@uos.de>2021-10-11 14:07:20 +0200
commit81499953a40fc980715f0fb3db80e18cbcf5de3c (patch)
treec1a4c42656a48d4947d35b3eff97eb03363f6c7a
parent2518f8d02b488d425a1fe91ca5500e3fa3936030 (diff)
AnalyticModel, PTAModel: add distinct_param_values_by_name
-rwxr-xr-xbin/analyze-kconfig.py7
-rw-r--r--lib/model.py19
2 files changed, 24 insertions, 2 deletions
diff --git a/bin/analyze-kconfig.py b/bin/analyze-kconfig.py
index 4a71617..ffe7648 100755
--- a/bin/analyze-kconfig.py
+++ b/bin/analyze-kconfig.py
@@ -134,7 +134,12 @@ def main():
raise NotImplementedError()
if args.info:
- print("TODO")
+ for name in model.names:
+ print(f"{name}:")
+ print(f""" Number of Measurements: {len(by_name[name]["param"])}""")
+ for i, param in enumerate(model.parameters):
+ param_values = model.distinct_param_values_by_name[name][i]
+ print(f" Parameter {param} ∈ {param_values}")
if args.export_tree:
with open("nfpkeys.json", "r") as f:
diff --git a/lib/model.py b/lib/model.py
index 3f784cc..590c6f0 100644
--- a/lib/model.py
+++ b/lib/model.py
@@ -5,7 +5,12 @@ import numpy as np
import os
from .automata import PTA, ModelAttribute
from .functions import StaticFunction, SubstateFunction, SplitFunction
-from .parameters import ParallelParamStats, ParamStats, codependent_param_dict
+from .parameters import (
+ ParallelParamStats,
+ ParamStats,
+ codependent_param_dict,
+ distinct_param_values,
+)
from .paramfit import ParamFit
from .utils import soft_cast_int, by_name_to_by_param, regression_measures
@@ -118,6 +123,12 @@ class AnalyticModel:
if self._num_args is None:
self._num_args = _num_args_from_by_name(by_name)
+ self.distinct_param_values_by_name = dict()
+ for name in self.names:
+ self.distinct_param_values_by_name[name] = distinct_param_values(
+ by_name[name]["param"]
+ )
+
self.fit_done = False
if compute_stats:
@@ -535,6 +546,12 @@ class PTAModel(AnalyticModel):
self.pta = pta
self.ignore_trace_indexes = ignore_trace_indexes
+ self.distinct_param_values_by_name = dict()
+ for name in self.names:
+ self.distinct_param_values_by_name[name] = distinct_param_values(
+ by_name[name]["param"]
+ )
+
self.fit_done = False
if traces is not None and pelt is not None: