Module org.jhotdraw8.graph
Package org.jhotdraw8.graph.path
Class SimpleCombinedAllSequencesFinder<V,A,C extends Number & Comparable<C>>
java.lang.Object
org.jhotdraw8.graph.path.SimpleCombinedAllSequencesFinder<V,A,C>
- Type Parameters:
V- the vertex data typeA- the arrow data typeC- the cost number type
- All Implemented Interfaces:
AllArcSequencesFinder<V,,A, C> AllArrowsSequencesFinder<V,,A, C> AllVertexSequencesFinder<V,,A, C> CombinedAllSequencesFinder<V,A, C>
public class SimpleCombinedAllSequencesFinder<V,A,C extends Number & Comparable<C>>
extends Object
implements CombinedAllSequencesFinder<V,A,C>
Implements the
CombinedAllSequencesFinder interface.
See AllWalksSpliterator for a description of the underlying algorithm.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfindAllArcSequences(@NonNull Iterable<V> startVertices, @NonNull Predicate<V> goalPredicate, int maxDepth, @NonNull C costLimit) Finds all arc paths up to (including) the specified maximal cost.findAllArrowSequences(@NonNull Iterable<V> startVertices, @NonNull Predicate<V> goalPredicate, int maxDepth, @NonNull C costLimit) Finds all arrow paths up to (including) the specified maximal cost.findAllVertexSequences(@NonNull Iterable<V> startVertices, @NonNull Predicate<V> goalPredicate, int maxDepth, @NonNull C costLimit) Finds all vertex paths up to (including) the specified maximal cost.
-
Constructor Details
-
SimpleCombinedAllSequencesFinder
public SimpleCombinedAllSequencesFinder(@NonNull Function<V, Iterable<Arc<V, A>>> nextArcsFunction, @NonNull C zero, @NonNull Function3<V, V, A, C> costFunction, @NonNull BiFunction<C, C, C> sumFunction) Creates a new instance.- Parameters:
nextArcsFunction- the next arcs functionzero- the zero cost valuecostFunction- the cost functionsumFunction- the sum function
-
-
Method Details
-
findAllArcSequences
public @NonNull Iterable<OrderedPair<ImmutableList<Arc<V,A>>, findAllArcSequencesC>> (@NonNull Iterable<V> startVertices, @NonNull Predicate<V> goalPredicate, int maxDepth, @NonNull C costLimit) Description copied from interface:AllArcSequencesFinderFinds all arc paths up to (including) the specified maximal cost.- Specified by:
findAllArcSequencesin interfaceAllArcSequencesFinder<V,A, C extends Number & Comparable<C>> - Parameters:
startVertices- the set of start verticesgoalPredicate- the goal predicatemaxDepth- the maximal depth (inclusive) of the search Must be >= 0.costLimit- the algorithm-specific cost limit- Returns:
- all paths
-
findAllArrowSequences
public @NonNull Iterable<OrderedPair<ImmutableList<A>,C>> findAllArrowSequences(@NonNull Iterable<V> startVertices, @NonNull Predicate<V> goalPredicate, int maxDepth, @NonNull C costLimit) Description copied from interface:AllArrowsSequencesFinderFinds all arrow paths up to (including) the specified maximal cost.- Specified by:
findAllArrowSequencesin interfaceAllArrowsSequencesFinder<V,A, C extends Number & Comparable<C>> - Parameters:
startVertices- the set of start verticesgoalPredicate- the goal predicatemaxDepth- the maximal depth (inclusive) of the search Must be >= 0.costLimit- the algorithm-specific cost limit- Returns:
- all paths
-
findAllVertexSequences
public @NonNull Iterable<OrderedPair<ImmutableList<V>,C>> findAllVertexSequences(@NonNull Iterable<V> startVertices, @NonNull Predicate<V> goalPredicate, int maxDepth, @NonNull C costLimit) Description copied from interface:AllVertexSequencesFinderFinds all vertex paths up to (including) the specified maximal cost.- Specified by:
findAllVertexSequencesin interfaceAllVertexSequencesFinder<V,A, C extends Number & Comparable<C>> - Parameters:
startVertices- the set of start verticesgoalPredicate- the goal predicatemaxDepth- the maximal depth (inclusive) of the search Must be >= 0.costLimit- the algorithm-specific search limit- Returns:
- all paths
-