Package net.automatalib.ts.modal
Class AbstractCompactMTS<I,T,TP extends MutableModalEdgeProperty>
- java.lang.Object
-
- net.automatalib.automaton.base.AbstractCompact<I,T,Void,TP>
-
- net.automatalib.ts.modal.AbstractCompactMTS<I,T,TP>
-
- Type Parameters:
I
- input symbol typeTP
- (specific) transition property type
- All Implemented Interfaces:
Iterable<Integer>
,SupportsGrowingAlphabet<I>
,Automaton<Integer,I,T>
,FiniteRepresentation
,InputAlphabetHolder<I>
,StateIDs<Integer>
,StateLocalInput<Integer,I>
,FiniteAlphabetAutomaton<Integer,I,T>
,MutableAutomaton<Integer,I,T,Void,TP>
,SimpleAutomaton<Integer,I>
,UniversalAutomaton<Integer,I,T,Void,TP>
,UniversalFiniteAlphabetAutomaton<Integer,I,T,Void,TP>
,GraphViewable
,ModalTransitionSystem<Integer,I,T,TP>
,MutableModalTransitionSystem<Integer,I,T,TP>
,SimpleTS<Integer,I>
,TransitionSystem<Integer,I,T>
,UniversalTransitionSystem<Integer,I,T,Void,TP>
- Direct Known Subclasses:
CompactMTS
public abstract class AbstractCompactMTS<I,T,TP extends MutableModalEdgeProperty> extends AbstractCompact<I,T,Void,TP> implements MutableModalTransitionSystem<Integer,I,T,TP>
An abstract base-implementation forMutableModalTransitionSystem
s.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class net.automatalib.automaton.base.AbstractCompact
AbstractCompact.Payload
-
Nested classes/interfaces inherited from interface net.automatalib.ts.modal.ModalTransitionSystem
ModalTransitionSystem.MTSGraphView<S,I,T,TP extends ModalEdgeProperty,M extends ModalTransitionSystem<S,I,T,TP>>
-
-
Field Summary
-
Fields inherited from class net.automatalib.automaton.base.AbstractCompact
DEFAULT_INIT_CAPACITY, DEFAULT_RESIZE_FACTOR, INVALID_STATE
-
-
Constructor Summary
Constructors Constructor Description AbstractCompactMTS(Alphabet<I> alphabet)
AbstractCompactMTS(Alphabet<I> alphabet, int stateCapacity, float resizeFactor)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description T
addModalTransition(Integer src, I input, Integer tgt, ModalEdgeProperty.ModalType modalType)
protected abstract TP
buildModalProperty(ModalEdgeProperty.ModalType type)
void
clear()
Removes all states and transitions.protected abstract TP
getDefaultTransitionProperty()
Set<Integer>
getInitialStates()
Retrieves the set of initial states of the transition system.Void
getStateProperty(Integer state)
Retrieves the state property for the given state.Collection<T>
getTransitions(Integer state, I input)
Retrieves the transitions that can be triggered by the given input symbol.void
removeAllTransitions(Integer state)
void
removeAllTransitions(Integer state, I input)
void
setInitial(Integer state, boolean initial)
void
setStateProperty(int state, Void property)
void
setStateProperty(Integer state, Void property)
void
setTransitions(Integer state, I input, Collection<? extends T> transitions)
protected void
updateTransitionStorage(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, 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 net.automatalib.automaton.concept.InputAlphabetHolder
getInputAlphabet
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Methods inherited from interface net.automatalib.ts.modal.ModalTransitionSystem
iterator, size, transitionGraphView
-
Methods inherited from interface net.automatalib.automaton.MutableAutomaton
addInitialState, addInitialState, addState, addState, addTransition, addTransition, addTransitions, copyTransition, createTransition, removeTransition, setTransitionProperty
-
Methods inherited from interface net.automatalib.ts.modal.MutableModalTransitionSystem
createTransition
-
Methods inherited from interface net.automatalib.automaton.simple.SimpleAutomaton
createDynamicStateMapping, createStaticStateMapping, getStates, stateIDs
-
Methods inherited from interface net.automatalib.ts.simple.SimpleTS
getStates, getSuccessors, getSuccessors
-
Methods inherited from interface net.automatalib.ts.TransitionSystem
getSuccessor, getSuccessors, powersetView
-
Methods inherited from interface net.automatalib.automaton.UniversalFiniteAlphabetAutomaton
transitionGraphView
-
Methods inherited from interface net.automatalib.ts.UniversalTransitionSystem
getTransitionProperty
-
-
-
-
Method Detail
-
setInitial
public void setInitial(Integer state, boolean initial)
- Specified by:
setInitial
in interfaceMutableAutomaton<Integer,I,T,Void,TP extends MutableModalEdgeProperty>
-
setStateProperty
public void setStateProperty(Integer state, Void property)
- Specified by:
setStateProperty
in interfaceMutableAutomaton<Integer,I,T,Void,TP extends MutableModalEdgeProperty>
-
setStateProperty
public void setStateProperty(int state, Void property)
- Specified by:
setStateProperty
in classAbstractCompact<I,T,Void,TP extends MutableModalEdgeProperty>
-
setTransitions
public void setTransitions(Integer state, I input, Collection<? extends T> transitions)
- Specified by:
setTransitions
in interfaceMutableAutomaton<Integer,I,T,Void,TP extends MutableModalEdgeProperty>
-
removeAllTransitions
public void removeAllTransitions(Integer state, I input)
- Specified by:
removeAllTransitions
in interfaceMutableAutomaton<Integer,I,T,Void,TP extends MutableModalEdgeProperty>
-
removeAllTransitions
public void removeAllTransitions(Integer state)
- Specified by:
removeAllTransitions
in interfaceMutableAutomaton<Integer,I,T,Void,TP extends MutableModalEdgeProperty>
-
addModalTransition
public T addModalTransition(Integer src, I input, Integer tgt, ModalEdgeProperty.ModalType modalType)
- Specified by:
addModalTransition
in interfaceMutableModalTransitionSystem<Integer,I,T,TP extends MutableModalEdgeProperty>
-
getStateProperty
public Void getStateProperty(Integer state)
Description copied from interface:UniversalTransitionSystem
Retrieves the state property for the given state.- Specified by:
getStateProperty
in interfaceUniversalTransitionSystem<Integer,I,T,Void,TP extends MutableModalEdgeProperty>
- Parameters:
state
- the state.- Returns:
- the corresponding property.
-
getTransitions
public Collection<T> getTransitions(Integer state, I input)
Description copied from interface:TransitionSystem
Retrieves the transitions that can be triggered by the given input symbol.The return value must not be
null
; if there are no transitions triggered by the specified input,Collections.emptySet()
should be returned.- Specified by:
getTransitions
in interfaceTransitionSystem<I,T,TP extends MutableModalEdgeProperty>
- Parameters:
state
- the source state.input
- the input symbol.- Returns:
- the transitions triggered by the given input
-
getInitialStates
public Set<Integer> getInitialStates()
Description copied from interface:SimpleTS
Retrieves the set of initial states of the transition system.- Specified by:
getInitialStates
in interfaceSimpleTS<I,T>
- Returns:
- the initial states.
-
clear
public void clear()
Description copied from interface:MutableAutomaton
Removes all states and transitions.- Specified by:
clear
in interfaceMutableAutomaton<Integer,I,T,Void,TP extends MutableModalEdgeProperty>
- Overrides:
clear
in classAbstractCompact<I,T,Void,TP extends MutableModalEdgeProperty>
-
updateTransitionStorage
protected void updateTransitionStorage(AbstractCompact.Payload payload)
Description copied from class:AbstractCompact
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)
.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:
updateTransitionStorage
in classAbstractCompact<I,T,Void,TP extends MutableModalEdgeProperty>
- 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.
-
getDefaultTransitionProperty
protected abstract TP getDefaultTransitionProperty()
-
buildModalProperty
protected abstract TP buildModalProperty(ModalEdgeProperty.ModalType type)
-
-