Class BasePTA<S extends AbstractBasePTAState<S,​SP,​TP>,​SP,​TP>

  • Type Parameters:
    S - state type
    SP - state property type
    TP - transition property type
    All Implemented Interfaces:
    Iterable<S>, net.automatalib.automaton.Automaton<S,​Integer,​PTATransition<S>>, net.automatalib.automaton.concept.FiniteRepresentation, net.automatalib.automaton.concept.InputAlphabetHolder<Integer>, net.automatalib.automaton.DeterministicAutomaton<S,​Integer,​PTATransition<S>>, net.automatalib.automaton.FiniteAlphabetAutomaton<S,​Integer,​PTATransition<S>>, net.automatalib.automaton.simple.SimpleAutomaton<S,​Integer>, net.automatalib.automaton.simple.SimpleDeterministicAutomaton<S,​Integer>, net.automatalib.automaton.UniversalAutomaton<S,​Integer,​PTATransition<S>,​SP,​TP>, net.automatalib.automaton.UniversalDeterministicAutomaton<S,​Integer,​PTATransition<S>,​SP,​TP>, net.automatalib.graph.concept.GraphViewable, net.automatalib.ts.DeterministicTransitionSystem<S,​Integer,​PTATransition<S>>, net.automatalib.ts.simple.SimpleDTS<S,​Integer>, net.automatalib.ts.simple.SimpleTS<S,​Integer>, net.automatalib.ts.TransitionSystem<S,​Integer,​PTATransition<S>>, net.automatalib.ts.UniversalDTS<S,​Integer,​PTATransition<S>,​SP,​TP>, net.automatalib.ts.UniversalTransitionSystem<S,​Integer,​PTATransition<S>,​SP,​TP>
    Direct Known Subclasses:
    AbstractBlueFringePTA

    public class BasePTA<S extends AbstractBasePTAState<S,​SP,​TP>,​SP,​TP>
    extends Object
    implements net.automatalib.automaton.UniversalDeterministicAutomaton<S,​Integer,​PTATransition<S>,​SP,​TP>, net.automatalib.automaton.FiniteAlphabetAutomaton<S,​Integer,​PTATransition<S>>
    Base class for prefix tree acceptors.
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface net.automatalib.automaton.UniversalDeterministicAutomaton

        net.automatalib.automaton.UniversalDeterministicAutomaton.FullIntAbstraction<T extends Object,​SP extends Object,​TP extends Object>, net.automatalib.automaton.UniversalDeterministicAutomaton.IntAbstraction<T extends Object,​SP extends Object,​TP extends Object>, net.automatalib.automaton.UniversalDeterministicAutomaton.StateIntAbstraction<I extends Object,​T extends Object,​SP extends Object,​TP extends Object>
    • Constructor Summary

      Constructors 
      Constructor Description
      BasePTA​(int alphabetSize, S root)
      Constructor.
    • Constructor Detail

      • BasePTA

        public BasePTA​(int alphabetSize,
                       S root)
        Constructor.
        Parameters:
        alphabetSize - the size of the input alphabet
        root - the root state
    • Method Detail

      • getRoot

        public S getRoot()
        Retrieves the root of the PTA.
        Returns:
        the root state
      • getInputAlphabet

        public net.automatalib.alphabet.Alphabet<Integer> getInputAlphabet()
        Specified by:
        getInputAlphabet in interface net.automatalib.automaton.concept.InputAlphabetHolder<S extends AbstractBasePTAState<S,​SP,​TP>>
      • addSample

        public void addSample​(net.automatalib.common.smartcollection.IntSeq sample,
                              SP lastProperty)
        Adds a sample to the PTA, and sets the property of the last reached (or inserted) state accordingly.
        Parameters:
        sample - the word to add to the PTA
        lastProperty - the property of the last state to set
      • getOrCreateState

        public S getOrCreateState​(net.automatalib.common.smartcollection.IntSeq word)
        Retrieves the state reached by the given word. If there is no path for the word in the PTA, it will be added to the PTA on-the-fly.
        Parameters:
        word - the word
        Returns:
        the state reached by this word, which might have been newly created (along with all required predecessor states)
      • addSampleWithStateProperties

        public void addSampleWithStateProperties​(net.automatalib.common.smartcollection.IntSeq sample,
                                                 List<? extends SP> lastStateProperties)
      • addSampleWithTransitionProperties

        public void addSampleWithTransitionProperties​(net.automatalib.common.smartcollection.IntSeq sample,
                                                      List<? extends TP> lastTransitionProperties)
      • getSuccessor

        public @Nullable S getSuccessor​(S state,
                                        Integer input)
        Specified by:
        getSuccessor in interface net.automatalib.ts.DeterministicTransitionSystem<S extends AbstractBasePTAState<S,​SP,​TP>,​SP,​TP>
        Specified by:
        getSuccessor in interface net.automatalib.ts.simple.SimpleDTS<S extends AbstractBasePTAState<S,​SP,​TP>,​SP>
      • getInitialState

        public S getInitialState()
        Specified by:
        getInitialState in interface net.automatalib.ts.simple.SimpleDTS<S extends AbstractBasePTAState<S,​SP,​TP>,​SP>
      • getVisualizationHelper

        protected net.automatalib.visualization.VisualizationHelper<S,​net.automatalib.automaton.graph.TransitionEdge<Integer,​PTATransition<S>>> getVisualizationHelper()