From 5f811f00b2f1239c01baef9ac0204bd582007394 Mon Sep 17 00:00:00 2001 From: Markus Frohme Date: Tue, 19 Mar 2024 11:22:41 +0100 Subject: [PATCH] ttt: faster stateIDs --- .../ttt/base/AbstractTTTHypothesis.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/algorithms/active/ttt/src/main/java/de/learnlib/algorithm/ttt/base/AbstractTTTHypothesis.java b/algorithms/active/ttt/src/main/java/de/learnlib/algorithm/ttt/base/AbstractTTTHypothesis.java index b49c7ba69a..d745c3db28 100644 --- a/algorithms/active/ttt/src/main/java/de/learnlib/algorithm/ttt/base/AbstractTTTHypothesis.java +++ b/algorithms/active/ttt/src/main/java/de/learnlib/algorithm/ttt/base/AbstractTTTHypothesis.java @@ -25,6 +25,7 @@ import net.automatalib.alphabet.SupportsGrowingAlphabet; import net.automatalib.automaton.DeterministicAutomaton; import net.automatalib.automaton.FiniteAlphabetAutomaton; +import net.automatalib.automaton.concept.StateIDs; import net.automatalib.automaton.fsa.DFA; import net.automatalib.graph.Graph; import net.automatalib.visualization.DefaultVisualizationHelper; @@ -47,6 +48,7 @@ public abstract class AbstractTTTHypothesis, I, D, T> implements DeterministicAutomaton, FiniteAlphabetAutomaton, DeterministicAutomaton.FullIntAbstraction, + StateIDs, SupportsGrowingAlphabet { protected final List states = new ArrayList<>(); @@ -201,6 +203,21 @@ public int size() { return states.size(); } + @Override + public int getStateId(S state) { + return state.id; + } + + @Override + public S getState(int id) { + return this.states.get(id); + } + + @Override + public StateIDs stateIDs() { + return this; + } + public static final class TTTEdge { public final TTTTransition transition;