File tree Expand file tree Collapse file tree 1 file changed +39
-0
lines changed
src/main/java/edu/kit/travart/dopler/transformation/util Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Original file line number Diff line number Diff line change 1+ package edu .kit .travart .dopler .transformation .util ;
2+
3+ import org .apache .logging .log4j .Logger ;
4+
5+ import at .jku .cps .travart .core .common .IStatistics ;
6+ import edu .kit .dopler .model .Dopler ;
7+
8+ public class DoplerStatistics implements IStatistics <Dopler > {
9+
10+ private static DoplerStatistics instance ;
11+
12+ private DoplerStatistics () {}
13+
14+ public static DoplerStatistics getInstance () {
15+ if (instance == null ) {
16+ instance = new DoplerStatistics ();
17+ }
18+ return instance ;
19+ }
20+
21+ @ Override
22+ public int getVariabilityElementsCount (Dopler model ) {
23+ // TODO Is is the right way to calculate size for DOPLER decision models?
24+ // Previously: Only #decisions + #assets
25+ return model .getDecisions ().stream ().mapToInt (e -> e .getRules ().size ()).sum ()
26+ + model .getAssets ().size ();
27+ }
28+
29+ @ Override
30+ public int getConstraintsCount (Dopler model ) {
31+ return model .getDecisions ().size ();
32+ }
33+
34+ @ Override
35+ public void logModelStatistics (Logger logger , Dopler model ) {
36+ logger .info ("TODO: Implement statistics overview message for DOPLER" );
37+ }
38+
39+ }
You can’t perform that action at this time.
0 commit comments