21
21
22
22
import org .mindswap .pellet .jena .PelletReasonerFactory ;
23
23
import org .mindswap .pellet .jena .PelletInfGraph ;
24
+ import org .slf4j .Logger ;
25
+ import org .slf4j .LoggerFactory ;
24
26
25
27
public class Reasoner {
26
28
@@ -41,6 +43,8 @@ public class Reasoner {
41
43
public ReasonnerReport report = new ReasonnerReport ();
42
44
protected UnitsRepo unitsRepo ;
43
45
46
+ private final Logger log = LoggerFactory .getLogger (Reasoner .class );
47
+
44
48
public Reasoner (Model model , UnitsRepo unitsRepo ) {
45
49
this .model = model ;
46
50
this .unitsRepo = unitsRepo ;
@@ -53,7 +57,7 @@ public void run () {
53
57
convert source relations -> sourceRelations convert
54
58
calculate ecological flows -> calculate ecological flows
55
59
*/
56
- System . out . println ( "begin reasonning" );
60
+ log . info ( "Begin reasonning" );
57
61
infModel = ModelFactory .createInfModel ( jenaReasoner , model );
58
62
((PelletInfGraph ) infModel .getGraph ()).classify ();
59
63
((PelletInfGraph ) infModel .getGraph ()).realize ();
@@ -64,7 +68,7 @@ public void run () {
64
68
RepoFactory .setReasonnerReport (report );
65
69
relationRepo = RepoFactory .getRelationRepo ();
66
70
singleElementRepo = RepoFactory .getSingleElementRepo ();
67
- System . out . println ( "loading and translating sourceRelations" );
71
+ log . info ( "Loading and translating sourceRelations" );
68
72
for (Resource sourceRelationResource : relationRepo .getSourceRelationsResources ()) {
69
73
try {
70
74
SourceRelation sourceRelation = relationRepo .getSourceRelation (sourceRelationResource );
@@ -75,14 +79,14 @@ public void run () {
75
79
}
76
80
}
77
81
78
- System . out . println ( "getting single processes" );
82
+ log . info ( "Getting single processes" );
79
83
processes = singleElementRepo .getSingleProcesses ();
80
- System . out . println ("getting elementary flow types" );
84
+ log . info ("getting elementary flow types" );
81
85
elementaryFlowTypes = singleElementRepo .getElementaryFlowTypes ();
82
- System . out . println ( "getting impact types" );
86
+ log . info ( "Getting impact types" );
83
87
impactTypes = singleElementRepo .getImpactTypes ();
84
88
85
- System . out . println ( "creating ecological matrices" );
89
+ log . info ( "Creating ecological matrices" );
86
90
createEcologicalMatrix ();
87
91
createFlowToImpactsMatrix ();
88
92
@@ -95,20 +99,20 @@ public void run () {
95
99
//createMatrix();
96
100
//calculateCumulatedEcologicalFlows();
97
101
98
- System . out . println ( "creating matrix" );
102
+ log . info ( "Creating matrix" );
99
103
createMatrices ();
100
- System . out . println ( "calculating cumulative flows" );
104
+ log . info ( "Calculating cumulative flows" );
101
105
iterativeCalculationWithoutUncertainties ();
102
106
cumulativeEcologicalMatrix = transitiveDependencyMatrix .multiply (ecologicalMatrix );
103
- System . out . println ( "calculating impacts" );
107
+ log . info ( "Calculating impacts" );
104
108
impactMatrix = cumulativeEcologicalMatrix .multiply (flowToImpactsMatrix .transpose ());
105
109
106
- System . out . println ( "creating calculated flows" );
110
+ log . info ( "Creating calculated flows" );
107
111
createCumulatedEcologicalFlows ();
108
- System . out . println ( "creating impacts" );
112
+ log . info ( "Creating impacts" );
109
113
createImpacts ();
110
114
111
- System . out . println ( "reasoning finished" );
115
+ log . info ( "Reasoning finished" );
112
116
}
113
117
114
118
public void createMatrix () {
0 commit comments