From 1140488673066f8e42362f26318b644c82cbd261 Mon Sep 17 00:00:00 2001 From: Kristóf Marussy Date: Thu, 20 Jun 2024 21:07:52 +0200 Subject: refactor(dse): expose state coder parameters --- .../interpretation/PartialNeighbourhoodCalculator.java | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'subprojects/store-reasoning/src') 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; public class PartialNeighbourhoodCalculator extends AbstractNeighbourhoodCalculator> { private final ModelQueryAdapter queryAdapter; + private final Concreteness concreteness; - public static final StateCodeCalculatorFactory FACTORY = - (model, ignoredInterpretations, individuals) -> new PartialNeighbourhoodCalculator(model, individuals); - - protected PartialNeighbourhoodCalculator(Model model, IntSet individuals) { - super(model, individuals); + protected PartialNeighbourhoodCalculator(Model model, IntSet individuals, Concreteness concreteness, int depth) { + super(model, individuals, depth); queryAdapter = model.getAdapter(ModelQueryAdapter.class); + this.concreteness = concreteness; } @Override @@ -42,7 +41,7 @@ public class PartialNeighbourhoodCalculator extends AbstractNeighbourhoodCalcula var partialSymbols = adapter.getStoreAdapter().getPartialSymbols(); return partialSymbols.stream() .>map(partialSymbol -> - adapter.getPartialInterpretation(Concreteness.PARTIAL, (PartialSymbol) partialSymbol)) + adapter.getPartialInterpretation(concreteness, (PartialSymbol) partialSymbol)) .toList(); } @@ -60,4 +59,9 @@ public class PartialNeighbourhoodCalculator extends AbstractNeighbourhoodCalcula protected Cursor getCursor(PartialInterpretation interpretation) { return interpretation.getAll(); } + + public static StateCodeCalculatorFactory factory(Concreteness concreteness, int depth) { + return (model, interpretations, individuals) -> new PartialNeighbourhoodCalculator(model, individuals, + concreteness, depth); + } } -- cgit v1.2.3-54-g00ecf