From 8977ed1cc14016d366508979c031d11b4a05e17a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Miguel=20Horcas?= Date: Mon, 27 May 2024 20:03:31 +0200 Subject: [PATCH] Fix base case zero configurations --- .../operations/bdd_feature_inclusion_probability.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/flamapy/metamodels/bdd_metamodel/operations/bdd_feature_inclusion_probability.py b/flamapy/metamodels/bdd_metamodel/operations/bdd_feature_inclusion_probability.py index d2c301d..a99e712 100644 --- a/flamapy/metamodels/bdd_metamodel/operations/bdd_feature_inclusion_probability.py +++ b/flamapy/metamodels/bdd_metamodel/operations/bdd_feature_inclusion_probability.py @@ -41,6 +41,8 @@ def feature_inclusion_probability(bdd_model: BDDModel, n_configs_op = BDDConfigurationsNumber() n_configs_op.set_partial_configuration(config) total_configs = n_configs_op.execute(bdd_model).get_result() + if total_configs == 0: + return {feature: 0.0 for feature in bdd_model.variables} prob: dict[Any, float] = defaultdict(float) if config is None: