Module org.jhotdraw8.graph
Package org.jhotdraw8.graph.path
Interface ArrowSequenceFinder<V,A,C extends Number & Comparable<C>>
- Type Parameters:
V- the vertex data typeA- the arrow data typeC- the cost number type
- All Known Subinterfaces:
CombinedSequenceFinder<V,A, C>
- All Known Implementing Classes:
SimpleCombinedSequenceFinder
public interface ArrowSequenceFinder<V,A,C extends Number & Comparable<C>>
Interface for finding arrow sequences up to (inclusive) a maximal cost
in a directed graph.
-
Method Summary
Modifier and TypeMethodDescriptiondefault @Nullable SimpleOrderedPair<ImmutableList<A>, C> Finds an arrow sequence from start to goal.default @Nullable OrderedPair<ImmutableList<A>, C> findArrowSequence(@NonNull V start, @NonNull V goal, int maxDepth, @NonNull C costLimit, @NonNull AddToSet<V> visited) Finds an arrow sequence from start to goal.default @Nullable SimpleOrderedPair<ImmutableList<A>, C> Finds an arrow sequence from start to goal.default @Nullable SimpleOrderedPair<ImmutableList<A>, C> findArrowSequence(@NonNull Iterable<V> startVertices, @NonNull Predicate<V> goalPredicate, int maxDepth, @NonNull C costLimit) Finds an arrow sequence from a set of start vertices to a vertex that satisfies the goal predicate.findArrowSequence(@NonNull Iterable<V> startVertices, @NonNull Predicate<V> goalPredicate, int maxDepth, @NonNull C costLimit, @NonNull AddToSet<V> visited) Finds an arrow sequence from a set of start vertices to a vertex that satisfies the goal predicate.default @Nullable SimpleOrderedPair<ImmutableList<A>, C> findArrowSequence(@NonNull Iterable<V> startVertices, @NonNull Predicate<V> goalPredicate, @NonNull C costLimit) Finds an arrow sequence from a set of start vertices to a vertex that satisfies the goal predicate.default @Nullable SimpleOrderedPair<ImmutableList<A>, C> Finds an arrow sequence through the given waypoints.findArrowSequenceOverWaypoints(@NonNull Iterable<V> waypoints, int maxDepth, @NonNull C costLimit, @NonNull Supplier<AddToSet<V>> visitedSetFactory) Finds an arrow sequence through the given waypoints.default @Nullable SimpleOrderedPair<ImmutableList<A>, C> Finds an arrow sequence through the given waypoints.static <VV,AA, CC extends Number & Comparable<CC>>
@Nullable SimpleOrderedPair<ImmutableList<AA>, CC> findArrowSequenceOverWaypoints(@NonNull Iterable<VV> waypoints, @NonNull BiFunction<VV, VV, OrderedPair<ImmutableList<AA>, CC>> findArrowSequenceFunction, @NonNull CC zero, @NonNull BiFunction<CC, CC, CC> sumFunction) Helper function for implementingfindArrowSequenceOverWaypoints(Iterable, int, Number, Supplier).
-
Method Details
-
findArrowSequence
@Nullable SimpleOrderedPair<ImmutableList<A>,C> findArrowSequence(@NonNull Iterable<V> startVertices, @NonNull Predicate<V> goalPredicate, int maxDepth, @NonNull C costLimit, @NonNull AddToSet<V> visited) Finds an arrow sequence from a set of start vertices to a vertex that satisfies the goal predicate.- Parameters:
startVertices- the start vertexgoalPredicate- the goal predicatemaxDepth- the maximal depth (inclusive) of the search Must be >= 0.costLimit- the algorithm-specific cost limitvisited- the visited function- Returns:
- an ordered pair (arrow sequence, cost), or null if no sequence was found.
-
findArrowSequence
default @Nullable SimpleOrderedPair<ImmutableList<A>,C> findArrowSequence(@NonNull Iterable<V> startVertices, @NonNull Predicate<V> goalPredicate, int maxDepth, @NonNull C costLimit) Finds an arrow sequence from a set of start vertices to a vertex that satisfies the goal predicate.- Parameters:
startVertices- the start vertexgoalPredicate- the goal predicatemaxDepth- the maximal depth (inclusive) of the search Must be >= 0.costLimit- the algorithm-specific cost limit- Returns:
- an ordered pair (arrow sequence, cost), or null if no sequence was found.
-
findArrowSequence
default @Nullable SimpleOrderedPair<ImmutableList<A>,C> findArrowSequence(@NonNull Iterable<V> startVertices, @NonNull Predicate<V> goalPredicate, @NonNull C costLimit) Finds an arrow sequence from a set of start vertices to a vertex that satisfies the goal predicate.- Parameters:
startVertices- the start vertexgoalPredicate- the goal predicatecostLimit- the algorithm-specific cost limit- Returns:
- an ordered pair (arrow sequence, cost), or null if no sequence was found.
-
findArrowSequence
default @Nullable OrderedPair<ImmutableList<A>,C> findArrowSequence(@NonNull V start, @NonNull V goal, int maxDepth, @NonNull C costLimit, @NonNull AddToSet<V> visited) Finds an arrow sequence from start to goal.- Parameters:
start- the start vertexgoal- the goal vertexmaxDepth- the maximal depth (inclusive) of the search Must be >= 0.costLimit- the algorithm-specific cost limitvisited- the visited function- Returns:
- an ordered pair (arrow sequence, cost), or null if no sequence was found.
-
findArrowSequence
default @Nullable SimpleOrderedPair<ImmutableList<A>,C> findArrowSequence(@NonNull V start, @NonNull V goal, int maxDepth, @NonNull C costLimit) Finds an arrow sequence from start to goal.- Parameters:
start- the start vertexgoal- the goal vertexmaxDepth- the maximal depth (inclusive) of the search Must be >= 0.costLimit- the algorithm-specific cost limit- Returns:
- an ordered pair (arrow sequence, cost), or null if no sequence was found.
-
findArrowSequence
default @Nullable SimpleOrderedPair<ImmutableList<A>,C> findArrowSequence(@NonNull V start, @NonNull V goal, @NonNull C costLimit) Finds an arrow sequence from start to goal.- Parameters:
start- the start vertexgoal- the goal vertexcostLimit- the algorithm-specific cost limit- Returns:
- an ordered pair (arrow sequence, cost), or null if no sequence was found.
-
findArrowSequenceOverWaypoints
@Nullable SimpleOrderedPair<ImmutableList<A>,C> findArrowSequenceOverWaypoints(@NonNull Iterable<V> waypoints, int maxDepth, @NonNull C costLimit, @NonNull Supplier<AddToSet<V>> visitedSetFactory) Finds an arrow sequence through the given waypoints.- Parameters:
waypoints- a list of waypointsmaxDepth- the maximal depth (inclusive) of the search Must be >= 0.costLimit- the algorithm-specific cost limit for paths between waypointsvisitedSetFactory- the visited set factory- Returns:
- an ordered pair (arrow sequence, cost), or null if no sequence was found.
-
findArrowSequenceOverWaypoints
default @Nullable SimpleOrderedPair<ImmutableList<A>,C> findArrowSequenceOverWaypoints(@NonNull Iterable<V> waypoints, int maxDepth, @NonNull C costLimit) Finds an arrow sequence through the given waypoints.- Parameters:
waypoints- a list of waypointsmaxDepth- the maximal depth (inclusive) of the search Must be >= 0.costLimit- the algorithm-specific cost limit for paths between waypoints- Returns:
- an ordered pair (arrow sequence, cost), or null if no sequence was found.
-
findArrowSequenceOverWaypoints
default @Nullable SimpleOrderedPair<ImmutableList<A>,C> findArrowSequenceOverWaypoints(@NonNull Iterable<V> waypoints, @NonNull C costLimit) Finds an arrow sequence through the given waypoints.- Parameters:
waypoints- a list of waypointscostLimit- the algorithm-specific cost limit for paths between waypoints- Returns:
- an ordered pair (arrow sequence, cost), or null if no sequence was found.
-
findArrowSequenceOverWaypoints
static <VV,AA, @Nullable SimpleOrderedPair<ImmutableList<AA>,CC extends Number & Comparable<CC>> CC> findArrowSequenceOverWaypoints(@NonNull Iterable<VV> waypoints, @NonNull BiFunction<VV, VV, OrderedPair<ImmutableList<AA>, CC>> findArrowSequenceFunction, @NonNull CC zero, @NonNull BiFunction<CC, CC, CC> sumFunction) Helper function for implementingfindArrowSequenceOverWaypoints(Iterable, int, Number, Supplier).- Type Parameters:
VV- the vertex typeCC- the number type- Parameters:
waypoints- the waypointsfindArrowSequenceFunction- the search function, for examplethis::findArrowSequencezero- the zero valuesumFunction- the sum function- Returns:
- an ordered pair with the combined sequence
-