aboutsummaryrefslogtreecommitdiffstats
path: root/subprojects/store-reasoning/src
diff options
context:
space:
mode:
Diffstat (limited to 'subprojects/store-reasoning/src')
-rw-r--r--subprojects/store-reasoning/src/main/java/tools/refinery/store/reasoning/interpretation/PartialNeighbourhoodCalculator.java16
1 files changed, 10 insertions, 6 deletions
diff --git a/subprojects/store-reasoning/src/main/java/tools/refinery/store/reasoning/interpretation/PartialNeighbourhoodCalculator.java b/subprojects/store-reasoning/src/main/java/tools/refinery/store/reasoning/interpretation/PartialNeighbourhoodCalculator.java
index 859cf7c1..67e20dbc 100644
--- a/subprojects/store-reasoning/src/main/java/tools/refinery/store/reasoning/interpretation/PartialNeighbourhoodCalculator.java
+++ b/subprojects/store-reasoning/src/main/java/tools/refinery/store/reasoning/interpretation/PartialNeighbourhoodCalculator.java
@@ -21,13 +21,12 @@ import java.util.List;
21 21
22public class PartialNeighbourhoodCalculator extends AbstractNeighbourhoodCalculator<PartialInterpretation<?, ?>> { 22public class PartialNeighbourhoodCalculator extends AbstractNeighbourhoodCalculator<PartialInterpretation<?, ?>> {
23 private final ModelQueryAdapter queryAdapter; 23 private final ModelQueryAdapter queryAdapter;
24 private final Concreteness concreteness;
24 25
25 public static final StateCodeCalculatorFactory FACTORY = 26 protected PartialNeighbourhoodCalculator(Model model, IntSet individuals, Concreteness concreteness, int depth) {
26 (model, ignoredInterpretations, individuals) -> new PartialNeighbourhoodCalculator(model, individuals); 27 super(model, individuals, depth);
27
28 protected PartialNeighbourhoodCalculator(Model model, IntSet individuals) {
29 super(model, individuals);
30 queryAdapter = model.getAdapter(ModelQueryAdapter.class); 28 queryAdapter = model.getAdapter(ModelQueryAdapter.class);
29 this.concreteness = concreteness;
31 } 30 }
32 31
33 @Override 32 @Override
@@ -42,7 +41,7 @@ public class PartialNeighbourhoodCalculator extends AbstractNeighbourhoodCalcula
42 var partialSymbols = adapter.getStoreAdapter().getPartialSymbols(); 41 var partialSymbols = adapter.getStoreAdapter().getPartialSymbols();
43 return partialSymbols.stream() 42 return partialSymbols.stream()
44 .<PartialInterpretation<?, ?>>map(partialSymbol -> 43 .<PartialInterpretation<?, ?>>map(partialSymbol ->
45 adapter.getPartialInterpretation(Concreteness.PARTIAL, (PartialSymbol<?, ?>) partialSymbol)) 44 adapter.getPartialInterpretation(concreteness, (PartialSymbol<?, ?>) partialSymbol))
46 .toList(); 45 .toList();
47 } 46 }
48 47
@@ -60,4 +59,9 @@ public class PartialNeighbourhoodCalculator extends AbstractNeighbourhoodCalcula
60 protected Cursor<Tuple, ?> getCursor(PartialInterpretation<?, ?> interpretation) { 59 protected Cursor<Tuple, ?> getCursor(PartialInterpretation<?, ?> interpretation) {
61 return interpretation.getAll(); 60 return interpretation.getAll();
62 } 61 }
62
63 public static StateCodeCalculatorFactory factory(Concreteness concreteness, int depth) {
64 return (model, interpretations, individuals) -> new PartialNeighbourhoodCalculator(model, individuals,
65 concreteness, depth);
66 }
63} 67}