public abstract class AbstractCompactDeterministic<I,T,SP,TP> extends AbstractMutableDeterministic<Integer,I,T,SP,TP> implements StateIDs<Integer>, FiniteAlphabetAutomaton<Integer,I,T>, Graph<Integer,TransitionEdge<I,T>>
Modifier and Type | Field and Description |
---|---|
protected Alphabet<I> |
alphabet |
protected int |
alphabetSize |
static int |
DEFAULT_INIT_CAPACITY |
static float |
DEFAULT_RESIZE_FACTOR |
protected int |
initial |
protected int |
numStates |
protected float |
resizeFactor |
protected int |
stateCapacity |
protected Object[] |
transitions |
Constructor and Description |
---|
AbstractCompactDeterministic(Alphabet<I> alphabet) |
AbstractCompactDeterministic(Alphabet<I> alphabet,
float resizeFactor) |
AbstractCompactDeterministic(Alphabet<I> alphabet,
int stateCapacity) |
AbstractCompactDeterministic(Alphabet<I> alphabet,
int stateCapacity,
float resizeFactor) |
Modifier and Type | Method and Description |
---|---|
int |
addIntState(SP property) |
Integer |
addState(SP property)
Adds a state to the automaton.
|
void |
clear()
Removes all states and transitions.
|
abstract T |
copyTransition(T trans,
int succId) |
T |
copyTransition(T trans,
Integer succ) |
<V> MutableMapping<Integer,V> |
createDynamicNodeMapping() |
protected int |
createState() |
<V> MutableMapping<Integer,V> |
createStaticNodeMapping() |
T |
createTransition(Integer succ,
TP property) |
abstract T |
createTransition(int succId,
TP property) |
protected void |
ensureCapacity() |
void |
ensureCapacity(int newCapacity) |
protected static int |
getId(Integer id) |
Integer |
getInitialState()
Retrieves the initial state of this transition system.
|
Alphabet<I> |
getInputAlphabet() |
int |
getIntInitialState() |
abstract int |
getIntSuccessor(T transition) |
Collection<Integer> |
getNodes()
Retrieves an (unmodifiable) collection of the nodes in this graph.
|
Collection<TransitionEdge<I,T>> |
getOutgoingEdges(Integer node)
Retrieves the outgoing edges of a given node.
|
Integer |
getState(int id) |
int |
getStateId(Integer state) |
abstract SP |
getStateProperty(int stateId) |
SP |
getStateProperty(Integer state)
Retrieves the state property for the given state.
|
Collection<Integer> |
getStates()
Retrieves all states of the transition system.
|
Integer |
getSuccessor(T transition)
Retrieves the successor state of a given transition.
|
Integer |
getTarget(TransitionEdge<I,T> edge)
Retrieves, for a given edge, its target node.
|
T |
getTransition(Integer state,
I input)
Retrieves the transition triggered by the given input symbol.
|
T |
getTransition(int stateId,
I input) |
T |
getTransition(int stateId,
int inputIdx) |
protected static Integer |
makeId(int id) |
NodeIDs<Integer> |
nodeIDs() |
void |
removeAllTransitions(Integer state) |
void |
setInitialState(int stateId) |
void |
setInitialState(Integer state)
Sets the initial state to the given state
|
void |
setStateProperty(Integer state,
SP property) |
abstract void |
setStateProperty(int state,
SP property) |
void |
setTransition(Integer state,
I input,
T transition)
Sets the transition for the given state and input symbol.
|
void |
setTransition(int state,
int inputIdx,
T trans) |
StateIDs<Integer> |
stateIDs() |
addInitialState, addInitialState, addState, addTransition, addTransition, addTransition, addTransitions, removeAllTransitions, removeAllTransitions, removeTransition, removeTransition, setInitial, setInitial, setTransition, setTransition, setTransitions, setTransitions
iterator, size
getInitialStates, getInitialStates, getState, getState, getSuccessor, getSuccessor, getSuccessor, getSuccessor, getTransitions, getTransitions
createDynamicStateMapping, createDynamicStateMapping, createStaticStateMapping, createStaticStateMapping, getStates, getStates, getSuccessors, getSuccessors, getSuccessors, getSuccessors, getSuccessors, getSuccessors, powersetView, powersetView
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getTransitions, powersetView
size
createDynamicStateMapping, createStaticStateMapping, getInitialStates, getStates, getSuccessors, getSuccessors, getSuccessors
forEach, iterator, spliterator
getState, getSuccessor, getSuccessor
setTransitionProperty
getTransitionProperty
public static final float DEFAULT_RESIZE_FACTOR
public static final int DEFAULT_INIT_CAPACITY
protected final int alphabetSize
protected Object[] transitions
protected int stateCapacity
protected int numStates
protected int initial
protected final float resizeFactor
public AbstractCompactDeterministic(Alphabet<I> alphabet)
public AbstractCompactDeterministic(Alphabet<I> alphabet, int stateCapacity)
public AbstractCompactDeterministic(Alphabet<I> alphabet, float resizeFactor)
public AbstractCompactDeterministic(Alphabet<I> alphabet, int stateCapacity, float resizeFactor)
protected void ensureCapacity()
public final void ensureCapacity(int newCapacity)
public void setInitialState(int stateId)
public void setInitialState(Integer state)
MutableDeterministic
setInitialState
in interface MutableDeterministic<Integer,I,T,SP,TP>
state
- the new initial statepublic void setTransition(int state, int inputIdx, T trans)
public void setTransition(Integer state, I input, T transition)
MutableDeterministic
setTransition
in interface MutableDeterministic<Integer,I,T,SP,TP>
state
- the source stateinput
- the triggering input symboltransition
- the transitionpublic abstract T createTransition(int succId, TP property)
public T createTransition(Integer succ, TP property)
createTransition
in interface MutableAutomaton<Integer,I,T,SP,TP>
public T copyTransition(T trans, Integer succ)
copyTransition
in interface MutableAutomaton<Integer,I,T,SP,TP>
public abstract T copyTransition(T trans, int succId)
public abstract int getIntSuccessor(T transition)
public final Integer getSuccessor(T transition)
TransitionSystem
getSuccessor
in interface TransitionSystem<Integer,I,T>
transition
- the transition.public Collection<Integer> getStates()
SimpleAutomaton
getStates
in interface SimpleAutomaton<Integer,I>
public int getStateId(Integer state)
getStateId
in interface StateIDs<Integer>
public int getIntInitialState()
public Integer getInitialState()
SimpleDTS
getInitialState
in interface SimpleDTS<Integer,I>
SimpleTS.getInitialStates()
public T getTransition(int stateId, int inputIdx)
public T getTransition(int stateId, I input)
public T getTransition(Integer state, I input)
DeterministicTransitionSystem
getTransition
in interface DeterministicTransitionSystem<Integer,I,T>
state
- the source state.input
- the input symbol.null
if no transition is triggered.TransitionSystem.getTransitions(Object, Object)
public abstract SP getStateProperty(int stateId)
public SP getStateProperty(Integer state)
UniversalTransitionSystem
getStateProperty
in interface UniversalTransitionSystem<Integer,I,T,SP,TP>
state
- the state.public void clear()
MutableAutomaton
protected final int createState()
public int addIntState(SP property)
public Integer addState(SP property)
MutableAutomaton
public abstract void setStateProperty(int state, SP property)
public void setStateProperty(Integer state, SP property)
setStateProperty
in interface MutableAutomaton<Integer,I,T,SP,TP>
public void removeAllTransitions(Integer state)
removeAllTransitions
in interface MutableAutomaton<Integer,I,T,SP,TP>
public StateIDs<Integer> stateIDs()
stateIDs
in interface SimpleAutomaton<Integer,I>
stateIDs
in class AbstractDeterministicAutomaton<Integer,I,T>
public Alphabet<I> getInputAlphabet()
getInputAlphabet
in interface InputAlphabetHolder<I>
public Collection<TransitionEdge<I,T>> getOutgoingEdges(Integer node)
IndefiniteGraph
getOutgoingEdges
in interface IndefiniteGraph<Integer,TransitionEdge<I,T>>
node
- the node.Collection
of all outgoing edges, or null
if
the node has no outgoing edges.public Integer getTarget(TransitionEdge<I,T> edge)
IndefiniteGraph
getTarget
in interface IndefiniteGraph<Integer,TransitionEdge<I,T>>
edge
- the edge.public <V> MutableMapping<Integer,V> createStaticNodeMapping()
createStaticNodeMapping
in interface IndefiniteGraph<Integer,TransitionEdge<I,T>>
public <V> MutableMapping<Integer,V> createDynamicNodeMapping()
createDynamicNodeMapping
in interface IndefiniteGraph<Integer,TransitionEdge<I,T>>
public Collection<Integer> getNodes()
Graph
Copyright © 2015. All Rights Reserved.