Class AbstractCompactSimpleNondet<I,SP>
- java.lang.Object
-
- net.automatalib.automaton.base.AbstractCompact<I,Integer,SP,Void>
-
- net.automatalib.automaton.base.AbstractCompactSimpleNondet<I,SP>
-
- Type Parameters:
I- input symbol typeSP- state property type
- All Implemented Interfaces:
Iterable<Integer>,SupportsGrowingAlphabet<I>,Automaton<Integer,I,Integer>,FiniteRepresentation,InputAlphabetHolder<I>,StateIDs<Integer>,StateLocalInput<Integer,I>,FiniteAlphabetAutomaton<Integer,I,Integer>,MutableAutomaton<Integer,I,Integer,SP,Void>,SimpleAutomaton<Integer,I>,UniversalAutomaton<Integer,I,Integer,SP,Void>,UniversalFiniteAlphabetAutomaton<Integer,I,Integer,SP,Void>,GraphViewable,SimpleTS<Integer,I>,TransitionSystem<Integer,I,Integer>,UniversalTransitionSystem<Integer,I,Integer,SP,Void>
- Direct Known Subclasses:
CompactNFA
public abstract class AbstractCompactSimpleNondet<I,SP> extends AbstractCompact<I,Integer,SP,Void>
Abstract super class that refinesAbstractCompactfor transition-property-less automata. As a result, transitions may be represented as integers (where a transition object effectively is the successor).Implementation note: This class uses
BitSets to store the successors of each state. This makes the memory consumption of this class depend on the number of states rather than the density of its adjacency matrix (since the maximum bit/index determines the size of eachBitSet). For the majority of cases (tests showed if the average number of outgoing transitions per state is more than 0.2% of the number of states) this still requires less memory than using e.g. aSetofIntegers. However, for very large but very sparseNFAs one may consider using theAbstractFastMutableNondetclass instead.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class net.automatalib.automaton.base.AbstractCompact
AbstractCompact.Payload
-
-
Field Summary
-
Fields inherited from class net.automatalib.automaton.base.AbstractCompact
DEFAULT_INIT_CAPACITY, DEFAULT_RESIZE_FACTOR, INVALID_STATE
-
-
Constructor Summary
Constructors Modifier Constructor Description AbstractCompactSimpleNondet(Alphabet<I> alphabet, int stateCapacity, float resizeFactor)protectedAbstractCompactSimpleNondet(Alphabet<I> alphabet, AbstractCompactSimpleNondet<?,?> other)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddTransition(int stateId, int inputIdx, int succId)voidaddTransition(int stateId, I input, int succId)voidaddTransition(Integer state, I input, Integer transition)voidclear()IntegercopyTransition(Integer trans, Integer succ)IntegercreateTransition(Integer successor, Void properties)Set<Integer>getInitialStates()IntegergetSuccessor(Integer transition)VoidgetTransitionProperty(Integer transition)Set<Integer>getTransitions(int state, int inputIdx)Set<Integer>getTransitions(int state, I input)Collection<Integer>getTransitions(Integer state, I input)voidremoveAllTransitions(int state)voidremoveAllTransitions(int stateId, int inputIdx)voidremoveAllTransitions(int stateId, I input)voidremoveAllTransitions(Integer state)voidremoveAllTransitions(Integer state, I input)voidremoveTransition(int stateId, int inputIdx, int successorId)voidremoveTransition(int stateId, I input, int successorId)voidremoveTransition(Integer state, I input, Integer transition)voidsetInitial(int state, boolean initial)voidsetInitial(Integer state, boolean initial)voidsetTransitionProperty(Integer transition, Void property)voidsetTransitions(int state, int inputIdx, Collection<? extends Integer> successors)voidsetTransitions(int state, I input, Collection<? extends Integer> successors)voidsetTransitions(Integer state, I input, Collection<? extends Integer> transitions)protected voidupdateTransitionStorage(AbstractCompact.Payload payload)Implementing classes should override this method in order to react to changes to the layout of their array-based transition data, e.g. due to calls toMutableAutomaton.addState()orAbstractCompact.addAlphabetSymbol(Object).-
Methods inherited from class net.automatalib.automaton.base.AbstractCompact
addAlphabetSymbol, addIntState, addState, getInputAlphabet, getLocalInputs, getState, getStateId, getStates, getSymbolIndex, numInputs, setStateProperty, size, stateIDs, toId, toMemoryIndex, toState, updateStateStorage, updateStateStorage, updateTransitionStorage, updateTransitionStorage, updateTransitionStorage
-
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, addTransitions, setStateProperty
-
Methods inherited from interface net.automatalib.automaton.simple.SimpleAutomaton
createDynamicStateMapping, createStaticStateMapping, iterator
-
Methods inherited from interface net.automatalib.ts.simple.SimpleTS
getStates, getSuccessors, getSuccessors
-
Methods inherited from interface net.automatalib.ts.TransitionSystem
getSuccessors, 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
-
-
-
-
Constructor Detail
-
AbstractCompactSimpleNondet
public AbstractCompactSimpleNondet(Alphabet<I> alphabet, int stateCapacity, float resizeFactor)
-
AbstractCompactSimpleNondet
protected AbstractCompactSimpleNondet(Alphabet<I> alphabet, AbstractCompactSimpleNondet<?,?> other)
-
-
Method Detail
-
updateTransitionStorage
protected void updateTransitionStorage(AbstractCompact.Payload payload)
Description copied from class:AbstractCompactImplementing classes should override this method in order to react to changes to the layout of their array-based transition data, e.g. due to calls toMutableAutomaton.addState()orAbstractCompact.addAlphabetSymbol(Object).Subclasses may use one of the
AbstractCompact.updateTransitionStorage(Object[], IntFunction, Object, Payload)... methods to conveniently delegate this task to this base class. This leaves subclasses only with the task to invoke the provided update methods for each of their local array storages.- Overrides:
updateTransitionStoragein classAbstractCompact<I,Integer,SP,Void>- Parameters:
payload- the payload containing the necessary information for the update operation. This object must be passed as-is to theAbstractCompact.updateTransitionStorage(Object[], IntFunction, Object, Payload)... methods.
-
setInitial
public void setInitial(Integer state, boolean initial)
-
setInitial
public void setInitial(int state, boolean initial)
-
clear
public void clear()
-
removeTransition
public void removeTransition(int stateId, I input, int successorId)
-
removeTransition
public void removeTransition(int stateId, int inputIdx, int successorId)
-
removeAllTransitions
public void removeAllTransitions(int stateId, I input)
-
removeAllTransitions
public void removeAllTransitions(int stateId, int inputIdx)
-
removeAllTransitions
public void removeAllTransitions(Integer state)
-
removeAllTransitions
public void removeAllTransitions(int state)
-
addTransition
public void addTransition(int stateId, I input, int succId)
-
addTransition
public void addTransition(int stateId, int inputIdx, int succId)
-
setTransitions
public void setTransitions(Integer state, I input, Collection<? extends Integer> transitions)
-
setTransitions
public void setTransitions(int state, I input, Collection<? extends Integer> successors)
-
setTransitions
public void setTransitions(int state, int inputIdx, Collection<? extends Integer> successors)
-
getTransitions
public Collection<Integer> getTransitions(Integer state, I input)
-
-