flamapy / fm_metamodel

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

See if we can optimize the generation of sets of features and relatiuons for certain operations such as those in montecarlo methods #27

Open jagalindo opened 3 years ago

jagalindo commented 3 years ago

Currently, we trasverse the tree structure everytime we ask for the set of features within a feature model. This is convinient for scenarios in which the model evolves and multiple operations affect the imput. However, this is a cou intensive method that hinders good performance when coping with operations that iteratibely configure products (e.g. montecarlo methods)

jmhorcas commented 3 years ago

I was thinking about this issue. Some comments:

  1. Extend the current models to make a version of them "inmutables" as other classes in Python like the frozenset. This would serve for Monte Carlo methods, but may introduce inconsistencies when mixing both structures. Also, currently there are some design inconsistencies within the FM metamodel. For example, I suggested in last version that classes offer a __hash__ method, but this method shouldn't exist because of __hash__ only makes sense with inmutable objects.

  2. Changing the current structure to store the features and relations based on a more efficiency structure like dictionaries (maps). This requires a considerable effort because the current metamodel is not well encapsulated (e.g., attributes are accessed from outside in other algorithms/parsers/classes). See the first comment above about OOP.