public abstract class AbstractCompactSimpleDet<I,SP> extends Object implements MutableDeterministic<Integer,I,Integer,SP,Void>, UniversalFiniteAlphabetAutomaton<Integer,I,Integer,SP,Void>, StateIDs<Integer>
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 int[] |
transitions |
Modifier | Constructor and Description |
---|---|
|
AbstractCompactSimpleDet(Alphabet<I> alphabet) |
protected |
AbstractCompactSimpleDet(Alphabet<I> alphabet,
AbstractCompactSimpleDet<?,?> other) |
|
AbstractCompactSimpleDet(Alphabet<I> alphabet,
float resizeFactor) |
|
AbstractCompactSimpleDet(Alphabet<I> alphabet,
int stateCapacity) |
|
AbstractCompactSimpleDet(Alphabet<I> alphabet,
int stateCapacity,
float resizeFactor) |
protected |
AbstractCompactSimpleDet(Alphabet<I> alphabet,
int numStates,
int initial,
int[] transitions,
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.
|
Integer |
copyTransition(Integer trans,
Integer succ) |
Integer |
createTransition(Integer successor,
Void properties) |
void |
ensureCapacity(int newCapacity) |
protected void |
ensureCapacity(int oldCap,
int newCap) |
Integer |
getInitialState()
Retrieves the initial state of this transition system.
|
Alphabet<I> |
getInputAlphabet() |
int |
getIntInitialState() |
int |
getIntState(Iterable<? extends I> input) |
int |
getIntSuccessor(int state,
I input) |
int |
getIntSuccessor(int state,
Iterable<? extends I> input) |
int |
getIntTransition(int state,
I input) |
Integer |
getState(int id) |
Integer |
getState(Iterable<? extends I> input)
Retrieves the state reachable by the given sequence of input symbols
from the initial state.
|
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(Integer transition)
Retrieves the successor state of a given transition.
|
Integer |
getSuccessor(Integer state,
Iterable<? extends I> input)
Retrieves the successor state reachable by the given sequence of
input symbols.
|
Integer |
getTransition(Integer state,
I input)
Retrieves the transition triggered by the given input symbol.
|
Void |
getTransitionProperty(Integer transition)
Retrieves the transition property for the given state.
|
protected abstract void |
initState(int stateId,
SP property) |
void |
removeAllTransitions(int state) |
void |
removeAllTransitions(Integer state) |
void |
setInitialState(int state) |
void |
setInitialState(Integer state)
Sets the initial state to the given state.
|
void |
setStateProperty(Integer state,
SP property) |
abstract void |
setStateProperty(int stateId,
SP property) |
void |
setTransition(Integer state,
I input,
Integer transition)
Sets the transition for the given state and input symbol.
|
void |
setTransition(int state,
I input,
int succ) |
void |
setTransition(int state,
int inputIdx,
int succ) |
void |
setTransitionProperty(Integer transition,
Void property) |
int |
size()
Retrieves the size (number of states) of this transition system.
|
StateIDs<Integer> |
stateIDs() |
protected static Integer |
wrapState(int id) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addTransition, removeAllTransitions, removeTransition, setInitial, setTransition, setTransitions
getSuccessor, getSuccessors, getTransitions, transToSet
getInitialStates, getStates, getSuccessors, stateToSet
addInitialState, addInitialState, addState, addTransition, addTransitions
transitionGraphView
createStaticStateMapping, iterator
forEach, spliterator
powersetView
createDynamicStateMapping, getSuccessors
transitionGraphView
graphView
public static final float DEFAULT_RESIZE_FACTOR
public static final int DEFAULT_INIT_CAPACITY
protected final int alphabetSize
protected int[] transitions
protected int stateCapacity
protected int numStates
protected int initial
protected final float resizeFactor
public AbstractCompactSimpleDet(Alphabet<I> alphabet, int stateCapacity, float resizeFactor)
protected AbstractCompactSimpleDet(Alphabet<I> alphabet, int numStates, int initial, int[] transitions, float resizeFactor)
protected AbstractCompactSimpleDet(Alphabet<I> alphabet, AbstractCompactSimpleDet<?,?> other)
public void ensureCapacity(int newCapacity)
protected void ensureCapacity(int oldCap, int newCap)
public Alphabet<I> getInputAlphabet()
getInputAlphabet
in interface InputAlphabetHolder<I>
public int size()
SimpleAutomaton
size
in interface SimpleAutomaton<Integer,I>
public Collection<Integer> getStates()
SimpleAutomaton
getStates
in interface SimpleAutomaton<Integer,I>
public int getStateId(Integer state)
getStateId
in interface StateIDs<Integer>
public Integer getInitialState()
SimpleDTS
getInitialState
in interface SimpleDTS<Integer,I>
SimpleTS.getInitialStates()
public int getIntInitialState()
public Integer getTransition(Integer state, I input)
DeterministicTransitionSystem
getTransition
in interface DeterministicTransitionSystem<Integer,I,Integer>
state
- the source state.input
- the input symbol.null
if no transition is triggered.TransitionSystem.getTransitions(Object, Object)
public int getIntTransition(int state, I input)
public void setInitialState(int state)
public void setInitialState(Integer state)
MutableDeterministic
null
can be passed.setInitialState
in interface MutableDeterministic<Integer,I,Integer,SP,Void>
state
- the new initial state, or null
.public void setTransition(int state, int inputIdx, int succ)
public void setTransition(int state, I input, int succ)
public void setTransition(Integer state, I input, Integer transition)
MutableDeterministic
setTransition
in interface MutableDeterministic<Integer,I,Integer,SP,Void>
state
- the source stateinput
- the triggering input symboltransition
- the transitionpublic void clear()
MutableAutomaton
public void removeAllTransitions(int state)
public void removeAllTransitions(Integer state)
removeAllTransitions
in interface MutableAutomaton<Integer,I,Integer,SP,Void>
public Integer copyTransition(Integer trans, Integer succ)
copyTransition
in interface MutableAutomaton<Integer,I,Integer,SP,Void>
public Integer getSuccessor(Integer transition)
TransitionSystem
getSuccessor
in interface TransitionSystem<Integer,I,Integer>
transition
- the transition.public int getIntSuccessor(int state, I input)
public abstract SP getStateProperty(int stateId)
public SP getStateProperty(Integer state)
UniversalTransitionSystem
getStateProperty
in interface UniversalTransitionSystem<Integer,I,Integer,SP,Void>
state
- the state.public Void getTransitionProperty(Integer transition)
UniversalTransitionSystem
getTransitionProperty
in interface UniversalTransitionSystem<Integer,I,Integer,SP,Void>
transition
- the transition.protected abstract void initState(int stateId, SP property)
public int addIntState(SP property)
public int addIntState()
public int addIntInitialState(SP property)
public int addIntInitialState()
public Integer addState(SP property)
MutableAutomaton
public abstract void setStateProperty(int stateId, SP property)
public void setStateProperty(Integer state, SP property)
setStateProperty
in interface MutableAutomaton<Integer,I,Integer,SP,Void>
public void setTransitionProperty(Integer transition, Void property)
setTransitionProperty
in interface MutableAutomaton<Integer,I,Integer,SP,Void>
public Integer createTransition(Integer successor, Void properties)
createTransition
in interface MutableAutomaton<Integer,I,Integer,SP,Void>
public StateIDs<Integer> stateIDs()
stateIDs
in interface SimpleAutomaton<Integer,I>
public Integer getSuccessor(Integer state, Iterable<? extends I> input)
SimpleDTS
getSuccessor
in interface SimpleDTS<Integer,I>
state
- the source state.input
- the input symbol.null
if no state is reachable by this symbol.SimpleTS.getSuccessors(Object, Iterable)
public Integer getState(Iterable<? extends I> input)
SimpleDTS
getState
in interface SimpleDTS<Integer,I>
input
- the input word.null
if no state is reachable by this word.SimpleTS.getStates(Iterable)
protected static Integer wrapState(int id)
Copyright © 2015. All rights reserved.