Leaf features

Description: Identifies all leaf features in the feature model. Leaf features are those that do not have any child features and represent the most specific options in a product line.

Application: Useful for identifying the end features that define the specific details of a product.

Example: Listing features at the bottom of the hierarchy that do not branch into further sub-features.


Code Examples

Command line usage

flamapy leaf_features "path/to/feature/model"

Python easy to use facade usage

from flamapy.interfaces.python.flamapy_feature_model import FLAMAFeatureModel
# Load the feature model
fm = FLAMAFeatureModel("path/to/feature/model")
# Identify leaf features
operation = fm.leaf_features()
print(operation)

Python flamapy framework usage

from flamapy.core.discover import DiscoverMetamodels
# Initiallize the dicover metamodel
dm = DiscoverMetamodels()
# Call the operation. Transformations will be automatically executed
result = dm.use_operation_from_file("FMLeafFeatures","path/to/feature/model")
print(result)

Python flamapy framework ADVANCED usage

from flamapy.core.discover import DiscoverMetamodels
# Initiallize the dicover metamodel
dm = DiscoverMetamodels()
# Get the fm metamodel representation using the transformation 
# required to get to the fm metamodel
feature_model = dm.use_transformation_t2m("path/to/feature/model",'fm') 
# Call the operation, no automatic transformations will be needed
result = dm.use_operation(feature_model,'FMLeafFeatures').get_result()
print(result)