SP - state property typeTP - transition property typeS - state type@ParametersAreNonnullByDefault public class BasePTA<SP,TP,S extends AbstractBasePTAState<SP,TP,S>> extends Object implements net.automatalib.automata.UniversalDeterministicAutomaton<S,Integer,PTATransition<S>,SP,TP>
net.automatalib.automata.UniversalDeterministicAutomaton.FullIntAbstraction<T,SP,TP>, net.automatalib.automata.UniversalDeterministicAutomaton.IntAbstraction<T,SP,TP>, net.automatalib.automata.UniversalDeterministicAutomaton.StateIntAbstraction<I,T,SP,TP>| Modifier and Type | Field and Description |
|---|---|
protected int |
alphabetSize |
protected S |
root |
| Constructor and Description |
|---|
BasePTA(int alphabetSize,
S root)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addSample(int[] sample,
SP lastProperty)
Adds a sample to the PTA, and sets the property of the last reached (or inserted) state accordingly.
|
void |
addSampleWithStateProperties(int[] sample,
List<? extends SP> lastStateProperties) |
void |
addSampleWithTransitionProperties(int[] sample,
List<? extends TP> lastTransitionProperties) |
Iterator<S> |
bfsIterator()
Retrieves an iterator that can be used for iterating over all states in this PTA that are reachable from the root
state in a breadth-first order.
|
List<S> |
bfsStates()
Retrieves a list of all states in this PTA that are reachable from the root state.
|
int |
countStates()
Counts the number of states in this PTA.
|
S |
getInitialState() |
S |
getOrCreateState(int[] word)
Retrieves the state reached by the given word (represented as an
int array). |
S |
getRoot()
Retrieves the root of the PTA.
|
S |
getState(int[] word)
Retrieves the state reached by the given word (represented as an
int array). |
SP |
getStateProperty(S state) |
Collection<S> |
getStates() |
S |
getSuccessor(PTATransition<S> transition) |
S |
getSuccessor(S state,
Integer input) |
PTATransition<S> |
getTransition(S state,
Integer input) |
TP |
getTransitionProperty(PTATransition<S> transition) |
<I> net.automatalib.graphs.Graph<S,PTATransition<S>> |
graphView(net.automatalib.words.Alphabet<I> alphabet) |
Iterator<S> |
iterator() |
int |
size() |
<I> void |
toAutomaton(net.automatalib.automata.MutableDeterministic<?,I,?,? super SP,? super TP> automaton,
net.automatalib.words.Alphabet<I> alphabet) |
<S2,I,SP2,TP2> |
toAutomaton(net.automatalib.automata.MutableDeterministic<S2,I,?,? super SP2,? super TP2> automaton,
net.automatalib.words.Alphabet<I> alphabet,
Function<? super SP,? extends SP2> spExtractor,
Function<? super TP,? extends TP2> tpExtractor) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitfullIntAbstraction, fullIntAbstraction, stateIntAbstractiongetSuccessors, getTransitions, transToSetgetInitialStates, getState, getStates, getSuccessor, getSuccessors, stateToSetcreateStaticStateMapping, stateIDsforEach, spliterator@Nonnegative protected final int alphabetSize
public BasePTA(@Nonnegative int alphabetSize, S root)
alphabetSize - the size of the input alphabetroot - the root state@Nullable public S getState(int[] word)
int array). If there is no path for the
given word in the PTA, null is returned.word - the wordnull if there is no path for the given word in the PTApublic void addSample(int[] sample,
SP lastProperty)
sample - the word to add to the PTAlastProperty - the property of the last state to set@Nonnull public S getOrCreateState(int[] word)
int array). If there is no path for the
word in the PTA, it will be added to the PTA on-the-fly.word - the wordpublic void addSampleWithStateProperties(int[] sample,
List<? extends SP> lastStateProperties)
public void addSampleWithTransitionProperties(int[] sample,
List<? extends TP> lastTransitionProperties)
public <I> void toAutomaton(net.automatalib.automata.MutableDeterministic<?,I,?,? super SP,? super TP> automaton, net.automatalib.words.Alphabet<I> alphabet)
public <S2,I,SP2,TP2> void toAutomaton(net.automatalib.automata.MutableDeterministic<S2,I,?,? super SP2,? super TP2> automaton,
net.automatalib.words.Alphabet<I> alphabet,
Function<? super SP,? extends SP2> spExtractor,
Function<? super TP,? extends TP2> tpExtractor)
public <I> net.automatalib.graphs.Graph<S,PTATransition<S>> graphView(net.automatalib.words.Alphabet<I> alphabet)
@Nonnull public List<S> bfsStates()
@Nonnull public Iterator<S> bfsIterator()
public S getSuccessor(PTATransition<S> transition)
getSuccessor in interface net.automatalib.ts.TransitionSystem<S extends AbstractBasePTAState<SP,TP,S>,Integer,PTATransition<S extends AbstractBasePTAState<SP,TP,S>>>public S getSuccessor(S state, Integer input)
getSuccessor in interface net.automatalib.ts.DeterministicTransitionSystem<S extends AbstractBasePTAState<SP,TP,S>,Integer,PTATransition<S extends AbstractBasePTAState<SP,TP,S>>>getSuccessor in interface net.automatalib.ts.simple.SimpleDTS<S extends AbstractBasePTAState<SP,TP,S>,Integer>public Collection<S> getStates()
public int size()
@Nonnegative public int countStates()
public S getInitialState()
public PTATransition<S> getTransition(S state, Integer input)
getTransition in interface net.automatalib.ts.DeterministicTransitionSystem<S extends AbstractBasePTAState<SP,TP,S>,Integer,PTATransition<S extends AbstractBasePTAState<SP,TP,S>>>public SP getStateProperty(S state)
getStateProperty in interface net.automatalib.ts.UniversalTransitionSystem<S extends AbstractBasePTAState<SP,TP,S>,Integer,PTATransition<S extends AbstractBasePTAState<SP,TP,S>>,SP,TP>public TP getTransitionProperty(PTATransition<S> transition)
getTransitionProperty in interface net.automatalib.ts.UniversalTransitionSystem<S extends AbstractBasePTAState<SP,TP,S>,Integer,PTATransition<S extends AbstractBasePTAState<SP,TP,S>>,SP,TP>Copyright © 2018. All rights reserved.