-
Notifications
You must be signed in to change notification settings - Fork 0
/
main_interop_matrix.py
35 lines (26 loc) · 1.05 KB
/
main_interop_matrix.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
from flamapy.metamodels.fm_metamodel.transformations import UVLReader
from rhea.fm_tools import FMToolInfo
from rhea.fm_concepts import (
FMConcept,
FMCMandatoryFeature,
FMCOptionalFeature,
FMCMutexGroup,
FMCAbstractFeature
)
FM_MODEL = 'JHipster_mux.uvl'
def main() -> None:
FM_CONCEPTS: list[FMConcept] = [FMCOptionalFeature, FMCMandatoryFeature, FMCAbstractFeature, FMCMutexGroup]
fm = UVLReader(FM_MODEL).transform()
glencoe_tool = FMToolInfo(name='Glencoe', support={FMCOptionalFeature, FMCMandatoryFeature})
for concept in FM_CONCEPTS:
support = 'NONE'
if concept in glencoe_tool.support:
support = 'OK'
elif concept.get_refactorings():
support = 'REF'
print(f'{concept.name()}: {len(concept.get_instances(fm))} -> Glencoe: {support}')
# for inst in concept.get_instances(fm):
# for refactoring in concept.get_refactorings():
# fm = refactoring.transform(model=fm, instance=inst)
if __name__ == '__main__':
main()