Class TSTraversal
- java.lang.Object
-
- net.automatalib.util.ts.traversal.TSTraversal
-
public final class TSTraversal extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static intNO_LIMIT
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <S,I,T,D>
booleanbreadthFirst(TransitionSystem<S,? super I,T> ts, int limit, Collection<? extends I> inputs, TSTraversalVisitor<S,I,T,D> visitor)Traverses the given transition system in a breadth-first fashion.static <S,I,T,D>
voidbreadthFirst(TransitionSystem<S,? super I,T> ts, Collection<? extends I> inputs, TSTraversalVisitor<S,I,T,D> visitor)Traverses the given transition system in a breadth-first fashion.static <S,I>
Iterator<S>breadthFirstIterator(TransitionSystem<S,I,?> ts, Collection<? extends I> inputs)Returns anIteratorfor the (reachable) states of the given transition system in breadth-first order.static <S,I>
Iterable<S>breadthFirstOrder(TransitionSystem<S,I,?> ts, Collection<? extends I> inputs)Returns anIterablefor the (reachable) states of the given transition system in breadth-first order.static <S,I,T,D>
booleandepthFirst(TransitionSystem<S,? super I,T> ts, int limit, Collection<? extends I> inputs, TSTraversalVisitor<S,I,T,D> visitor)Traverses the given transition system in a depth-first fashion.static <S,I,T,D>
voiddepthFirst(TransitionSystem<S,I,T> ts, Collection<? extends I> inputs, TSTraversalVisitor<S,I,T,D> visitor)Traverses the given transition system in a depth-first fashion.static <S,I>
Iterator<S>depthFirstIterator(TransitionSystem<S,I,?> ts, Collection<? extends I> inputs)Returns anIteratorfor the (reachable) states of the given transition system in depth-first order.static <S,I>
Iterable<S>depthFirstOrder(TransitionSystem<S,I,?> ts, Collection<? extends I> inputs)Returns anIterablefor the (reachable) states of the given transition system in depth-first order.static <S,I,T,D>
booleantraverse(TraversalOrder order, TransitionSystem<S,? super I,T> ts, int limit, Collection<? extends I> inputs, TSTraversalVisitor<S,I,T,D> visitor)Traverses the given transition system in a given order.static <S,I,T,D>
voidtraverse(TraversalOrder order, TransitionSystem<S,? super I,T> ts, Collection<? extends I> inputs, TSTraversalVisitor<S,I,T,D> visitor)Traverses the given transition system in a given order.
-
-
-
Field Detail
-
NO_LIMIT
public static final int NO_LIMIT
- See Also:
- Constant Field Values
-
-
Method Detail
-
breadthFirst
public static <S,I,T,D> void breadthFirst(TransitionSystem<S,? super I,T> ts, Collection<? extends I> inputs, TSTraversalVisitor<S,I,T,D> visitor)
Traverses the given transition system in a breadth-first fashion. The traversal is steered by the specified visitor.- Type Parameters:
S- state typeI- input symbol typeT- transition typeD- (user) data type- Parameters:
ts- the transition systeminputs- the input alphabetvisitor- the visitor
-
breadthFirst
public static <S,I,T,D> boolean breadthFirst(TransitionSystem<S,? super I,T> ts, int limit, Collection<? extends I> inputs, TSTraversalVisitor<S,I,T,D> visitor)
Traverses the given transition system in a breadth-first fashion. The traversal is steered by the specified visitor.- Type Parameters:
S- state typeI- input symbol typeT- transition typeD- (user) data type- Parameters:
ts- the transition systemlimit- the upper bound on the number of states to be visitedinputs- the input alphabetvisitor- the visitor- Returns:
falseif the number of explored states reachedlimit,trueotherwise
-
breadthFirstOrder
public static <S,I> Iterable<S> breadthFirstOrder(TransitionSystem<S,I,?> ts, Collection<? extends I> inputs)
Returns anIterablefor the (reachable) states of the given transition system in breadth-first order.- Type Parameters:
S- state typeI- input symbol type- Parameters:
ts- the transition systeminputs- the inputs which should be considered for the traversal- Returns:
- an
Iterablefor the (reachable) states of the given transition system in breadth-first order
-
breadthFirstIterator
public static <S,I> Iterator<S> breadthFirstIterator(TransitionSystem<S,I,?> ts, Collection<? extends I> inputs)
Returns anIteratorfor the (reachable) states of the given transition system in breadth-first order.- Type Parameters:
S- state typeI- input symbol type- Parameters:
ts- the transition systeminputs- the inputs which should be considered for the traversal- Returns:
- an
Iteratorfor the (reachable) states of the given transition system in breadth-first order
-
depthFirst
public static <S,I,T,D> void depthFirst(TransitionSystem<S,I,T> ts, Collection<? extends I> inputs, TSTraversalVisitor<S,I,T,D> visitor)
Traverses the given transition system in a depth-first fashion. The traversal is steered by the specified visitor.- Type Parameters:
S- state typeI- input symbol typeT- transition typeD- (user) data type- Parameters:
ts- the transition systeminputs- the input alphabetvisitor- the visitor
-
depthFirst
public static <S,I,T,D> boolean depthFirst(TransitionSystem<S,? super I,T> ts, int limit, Collection<? extends I> inputs, TSTraversalVisitor<S,I,T,D> visitor)
Traverses the given transition system in a depth-first fashion. The traversal is steered by the specified visitor.- Type Parameters:
S- state typeI- input symbol typeT- transition typeD- (user) data type- Parameters:
ts- the transition systemlimit- the upper bound on the number of states to be visitedinputs- the input alphabetvisitor- the visitor- Returns:
falseif the number of explored states reachedlimit,trueotherwise
-
depthFirstOrder
public static <S,I> Iterable<S> depthFirstOrder(TransitionSystem<S,I,?> ts, Collection<? extends I> inputs)
Returns anIterablefor the (reachable) states of the given transition system in depth-first order.- Type Parameters:
S- state typeI- input symbol type- Parameters:
ts- the transition systeminputs- the inputs which should be considered for the traversal- Returns:
- an
Iterablefor the (reachable) states of the given transition system in depth-first order
-
depthFirstIterator
public static <S,I> Iterator<S> depthFirstIterator(TransitionSystem<S,I,?> ts, Collection<? extends I> inputs)
Returns anIteratorfor the (reachable) states of the given transition system in depth-first order.- Type Parameters:
S- state typeI- input symbol type- Parameters:
ts- the transition systeminputs- the inputs which should be considered for the traversal- Returns:
- an
Iteratorfor the (reachable) states of the given transition system in depth-first order
-
traverse
public static <S,I,T,D> void traverse(TraversalOrder order, TransitionSystem<S,? super I,T> ts, Collection<? extends I> inputs, TSTraversalVisitor<S,I,T,D> visitor)
Traverses the given transition system in a given order. The traversal is steered by the specified visitor.- Type Parameters:
S- state typeI- input symbol typeT- transition typeD- (user) data type- Parameters:
order- the order in which the states should be traversedts- the transition systeminputs- the input alphabetvisitor- the visitor
-
traverse
public static <S,I,T,D> boolean traverse(TraversalOrder order, TransitionSystem<S,? super I,T> ts, int limit, Collection<? extends I> inputs, TSTraversalVisitor<S,I,T,D> visitor)
Traverses the given transition system in a given order. The traversal is steered by the specified visitor.- Type Parameters:
S- state typeI- input symbol typeT- transition typeD- (user) data type- Parameters:
order- the order in which the states should be traversedts- the transition systemlimit- the upper bound on the number of states to be visitedinputs- the input alphabetvisitor- the visitor- Returns:
falseif the number of explored states reachedlimit,trueotherwise
-
-