flamapy / fm_metamodel

This repo host the feature model concrete classes
3 stars 5 forks source link

Error in "FMAverageBranchingFactor" operation? #21

Closed jmhorcas closed 3 years ago

jmhorcas commented 3 years ago

The calculation seems to be incorrect.

The calculation needs to consider the number of branches. The number of branches is the number of features that have at least one child. Current implementation considers all features including the leaf features which have not any branch. image

This may be correct if we consider leaf features to have a branching factor of zero, but in that case all feature models would return an average branching factor less than 1. Two examples: image

Moreover, current implementation returns always 0 or 1 because the value is rounded, but this should return a float.

Anyway, first, I think we need to clarify the definition of the operation. Is there a paper reference for a formal definition of this operation?

I suggest the following implementation that considers the number of branches, as well as a precision for the floating point result: image

jmhorcas commented 3 years ago

Fixed in f1cfd342be2e22daeb42c19956fe9c876965e4c8