File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
src/main/java/edu/kit/travart/dopler/transformation/util Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 44
55import at .jku .cps .travart .core .common .IStatistics ;
66import edu .kit .dopler .model .Dopler ;
7+ import edu .kit .dopler .model .EnumerationDecision ;
78
89public class DoplerStatistics implements IStatistics <Dopler > {
910
@@ -22,8 +23,14 @@ public static DoplerStatistics getInstance() {
2223 public int getVariabilityElementsCount (Dopler model ) {
2324 // TODO Is is the right way to calculate size for DOPLER decision models?
2425 // Previously: Only #decisions + #assets
25- return model .getDecisions ().stream ().mapToInt (e -> e .getRules ().size ()).sum ()
26- + model .getAssets ().size ();
26+ // Try to calculate the number of branches
27+ return model .getDecisions ().stream ().mapToInt (e -> {
28+ if (e instanceof EnumerationDecision ) {
29+ return ((EnumerationDecision ) e ).getEnumeration ().getEnumerationLiterals ().size ();
30+ } else {
31+ return 1 ;
32+ }
33+ }).sum () + model .getAssets ().size ();
2734 }
2835
2936 @ Override
You can’t perform that action at this time.
0 commit comments