Skip to content

Commit

Permalink
ttt: faster stateIDs
Browse files Browse the repository at this point in the history
  • Loading branch information
mtf90 committed Mar 19, 2024
1 parent db1406a commit 5f811f0
Showing 1 changed file with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -47,6 +48,7 @@ public abstract class AbstractTTTHypothesis<S extends TTTState<I, D>, I, D, T>
implements DeterministicAutomaton<S, I, T>,
FiniteAlphabetAutomaton<S, I, T>,
DeterministicAutomaton.FullIntAbstraction<T>,
StateIDs<S>,
SupportsGrowingAlphabet<I> {

protected final List<S> states = new ArrayList<>();
Expand Down Expand Up @@ -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<S> stateIDs() {
return this;
}

public static final class TTTEdge<I, D> {

public final TTTTransition<I, D> transition;
Expand Down

0 comments on commit 5f811f0

Please sign in to comment.