public abstract class AbstractCompactDeterministic<I,T,SP,TP> extends Object implements MutableDeterministic<Integer,I,T,SP,TP>, StateIDs<Integer>, UniversalFiniteAlphabetAutomaton<Integer,I,T,SP,TP>
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 |
addIntInitialState() |
int |
addIntInitialState(SP property) |
int |
addIntState() |
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) |
protected int |
createState() |
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) |
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.
|
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) |
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 stateId,
int inputIdx,
int succId) |
void |
setTransition(int stateId,
int inputIdx,
int succId,
TP property) |
void |
setTransition(int state,
int inputIdx,
T trans) |
int |
size()
Retrieves the size (number of states) of this transition system.
|
StateIDs<Integer> |
stateIDs() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addTransition, removeAllTransitions, removeTransition, setInitial, setTransition, setTransitions
getSuccessor, getSuccessors, getTransitions, transToSet
getInitialStates, getState, getStates, getSuccessor, getSuccessors, stateToSet
addInitialState, addInitialState, addState, addTransition, addTransitions, setTransitionProperty
transitionGraphView
createStaticStateMapping, iterator
forEach, spliterator
getTransitionProperty
powersetView
createDynamicStateMapping, getSuccessors
transitionGraphView
graphView
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, int stateCapacity)
public AbstractCompactDeterministic(Alphabet<I> alphabet, float resizeFactor)
protected static final int getId(Integer id)
protected static final Integer makeId(int id)
protected void ensureCapacity()
public final void ensureCapacity(int newCapacity)
public int size()
SimpleAutomaton
size
in interface SimpleAutomaton<Integer,I>
public void setInitialState(int stateId)
public void setInitialState(Integer state)
MutableDeterministic
null
can be passed.setInitialState
in interface MutableDeterministic<Integer,I,T,SP,TP>
state
- the new initial state, or null
.public void setTransition(int state, int inputIdx, T trans)
public void setTransition(int stateId, int inputIdx, int succId)
public void setTransition(int stateId, int inputIdx, int succId, TP property)
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 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 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(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 addIntInitialState(SP property)
public int addIntInitialState()
public int addIntState()
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>
public Alphabet<I> getInputAlphabet()
getInputAlphabet
in interface InputAlphabetHolder<I>
Copyright © 2015. All rights reserved.