Module net.automatalib.core
Package net.automatalib.automaton.base
Class AbstractFastMutable<S extends AbstractFastState<?>,I,T,SP,TP>
- java.lang.Object
-
- net.automatalib.automaton.base.AbstractFastMutable<S,I,T,SP,TP>
-
- All Implemented Interfaces:
Iterable<S>,SupportsGrowingAlphabet<I>,Automaton<S,I,T>,FiniteRepresentation,InputAlphabetHolder<I>,StateIDs<S>,StateLocalInput<S,I>,FiniteAlphabetAutomaton<S,I,T>,MutableAutomaton<S,I,T,SP,TP>,ShrinkableAutomaton<S,I,T,SP,TP>,SimpleAutomaton<S,I>,UniversalAutomaton<S,I,T,SP,TP>,UniversalFiniteAlphabetAutomaton<S,I,T,SP,TP>,GraphViewable,SimpleTS<S,I>,TransitionSystem<S,I,T>,UniversalTransitionSystem<S,I,T,SP,TP>
- Direct Known Subclasses:
AbstractFastMutableDet,AbstractFastMutableNondet
public abstract class AbstractFastMutable<S extends AbstractFastState<?>,I,T,SP,TP> extends Object implements ShrinkableAutomaton<S,I,T,SP,TP>, UniversalFiniteAlphabetAutomaton<S,I,T,SP,TP>, StateIDs<S>, SupportsGrowingAlphabet<I>, StateLocalInput<S,I>
Shared functionality for (non-) deterministic mutable automata.
-
-
Field Summary
Fields Modifier and Type Field Description protected Alphabet<I>inputAlphabet
-
Constructor Summary
Constructors Constructor Description AbstractFastMutable(Alphabet<I> inputAlphabet)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddAlphabetSymbol(I symbol)Notifies the data structure that a new symbol should be added to the alphabet.SaddState(@Nullable SP property)Adds a new state with the given property to the automaton.voidclear()Removes all states and transitions.<V> MutableMapping<S,V>createDynamicStateMapping()Creates aMutableMappingallowing to associate arbitrary data with this transition system's states.protected abstract ScreateState(@Nullable SP property)Alphabet<I>getInputAlphabet()SgetState(int id)Return for a given id the state of the automaton identified by it.intgetStateId(S state)Returns for a given state of the automaton an integer uniquely identifying the state.Collection<S>getStates()Retrieves all states of the transition system.voidremoveAllTransitions(S state)voidremoveState(S state, @Nullable S replacement)Removes a state from the automaton.StateIDs<S>stateIDs()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.automatalib.automaton.FiniteAlphabetAutomaton
getTransitions, graphView
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Methods inherited from interface net.automatalib.automaton.MutableAutomaton
addInitialState, addInitialState, addState, addTransition, addTransition, addTransitions, copyTransition, createTransition, removeAllTransitions, removeTransition, setInitial, setStateProperty, setTransitionProperty, setTransitions
-
Methods inherited from interface net.automatalib.automaton.ShrinkableAutomaton
removeState
-
Methods inherited from interface net.automatalib.automaton.simple.SimpleAutomaton
createStaticStateMapping, iterator, size
-
Methods inherited from interface net.automatalib.ts.simple.SimpleTS
getInitialStates, getStates, getSuccessors
-
Methods inherited from interface net.automatalib.automaton.concept.StateLocalInput
getLocalInputs
-
Methods inherited from interface net.automatalib.ts.TransitionSystem
getSuccessor, getSuccessors, getTransitions, powersetView
-
Methods inherited from interface net.automatalib.automaton.UniversalAutomaton
transitionGraphView
-
Methods inherited from interface net.automatalib.automaton.UniversalFiniteAlphabetAutomaton
transitionGraphView
-
Methods inherited from interface net.automatalib.ts.UniversalTransitionSystem
getStateProperty, getTransitionProperty
-
-
-
-
Method Detail
-
getStateId
public int getStateId(S state)
Description copied from interface:StateIDsReturns for a given state of the automaton an integer uniquely identifying the state. The returned ids should be within the range of the number of states of the automaton so that they can be used for array-based indexing.- Specified by:
getStateIdin interfaceStateIDs<S extends AbstractFastState<?>>- Parameters:
state- the state whose id should be retrieved- Returns:
- the (positive) id of the given automaton state
-
getState
public S getState(int id)
Description copied from interface:StateIDsReturn for a given id the state of the automaton identified by it.- Specified by:
getStatein interfaceStateIDs<S extends AbstractFastState<?>>- Parameters:
id- the id of the state to be returned- Returns:
- the automaton state identified by the given
id.
-
addState
public S addState(@Nullable SP property)
Description copied from interface:MutableAutomatonAdds a new state with the given property to the automaton.- Specified by:
addStatein interfaceMutableAutomaton<S extends AbstractFastState<?>,I,T,SP,TP>- Parameters:
property- the property of the new state- Returns:
- the newly created state
-
removeAllTransitions
public void removeAllTransitions(S state)
- Specified by:
removeAllTransitionsin interfaceMutableAutomaton<S extends AbstractFastState<?>,I,T,SP,TP>
-
removeState
public void removeState(S state, @Nullable S replacement)
Description copied from interface:ShrinkableAutomatonRemoves a state from the automaton. All ingoing transitions to this state are redirected to the given replacement state. If anullreplacement is given, then this method behaves like the aboveShrinkableAutomaton.removeState(Object).- Specified by:
removeStatein interfaceShrinkableAutomaton<S extends AbstractFastState<?>,I,T,SP,TP>- Parameters:
state- the state to removereplacement- the replacement state, ornull
-
clear
public void clear()
Description copied from interface:MutableAutomatonRemoves all states and transitions.- Specified by:
clearin interfaceMutableAutomaton<S extends AbstractFastState<?>,I,T,SP,TP>
-
getInputAlphabet
public Alphabet<I> getInputAlphabet()
- Specified by:
getInputAlphabetin interfaceInputAlphabetHolder<S extends AbstractFastState<?>>
-
createDynamicStateMapping
public <V> MutableMapping<S,V> createDynamicStateMapping()
Description copied from interface:SimpleTSCreates aMutableMappingallowing to associate arbitrary data with this transition system's states. The returned mapping maintains the association even when the transition system is modified.- Specified by:
createDynamicStateMappingin interfaceSimpleAutomaton<S extends AbstractFastState<?>,I>- Specified by:
createDynamicStateMappingin interfaceSimpleTS<S extends AbstractFastState<?>,I>- Type Parameters:
V- the value type of the mapping- Returns:
- the mutable mapping
-
addAlphabetSymbol
public void addAlphabetSymbol(I symbol)
Description copied from interface:SupportsGrowingAlphabetNotifies the data structure that a new symbol should be added to the alphabet. Behavior depends on the implementation:- After adding a new symbol, the symbol-related data may either be initialized with default values or undefined.
- Duplicate symbols may: (1) be handled accordingly, (2) be ignored or (3) result in an error.
GrowingAlphabet) to handle potentially shared state across multiple instances. If the needed requirements are not met, aGrowingAlphabetNotSupportedExceptioncan be thrown.- Specified by:
addAlphabetSymbolin interfaceSupportsGrowingAlphabet<S extends AbstractFastState<?>>- Parameters:
symbol- the symbol to add to the alphabet.
-
getStates
public Collection<S> getStates()
Description copied from interface:SimpleAutomatonRetrieves all states of the transition system. Implementing classes should return an unmodifiable collection- Specified by:
getStatesin interfaceSimpleAutomaton<S extends AbstractFastState<?>,I>- Returns:
- all states in the transition system
-
stateIDs
public StateIDs<S> stateIDs()
- Specified by:
stateIDsin interfaceSimpleAutomaton<S extends AbstractFastState<?>,I>
-
-