Module org.jhotdraw8.graph
Package org.jhotdraw8.graph.path
Interface ArcSequenceFinder<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 ArcSequenceFinder<V,A,C extends Number & Comparable<C>>
Interface for finding
Arc sequences up to (inclusive)
a maximal cost in a directed graph.-
Method Summary
Modifier and TypeMethodDescriptiondefault @Nullable OrderedPair<ImmutableList<Arc<V, A>>, C> Finds an arc sequence from start to goal.default @Nullable OrderedPair<ImmutableList<Arc<V, A>>, C> findArcSequence(@NonNull V start, @NonNull V goal, int maxDepth, @NonNull C costLimit, @NonNull AddToSet<V> visited) Finds an arc sequence from start to goal.default @Nullable OrderedPair<ImmutableList<Arc<V, A>>, C> Finds an arc sequence from start to goal.findArcSequence(@NonNull Iterable<V> startVertices, @NonNull Predicate<V> goalPredicate, int maxDepth, @NonNull C costLimit, @NonNull AddToSet<V> visited) Finds an arc sequence from a set of start vertices to a vertex that satisfies the goal predicate.default @Nullable OrderedPair<ImmutableList<Arc<V, A>>, C> Finds an arc sequence through the given waypoints.findArcSequenceOverWaypoints(@NonNull Iterable<V> waypoints, int maxDepth, @NonNull C costLimit, @NonNull Supplier<AddToSet<V>> visitedSetFactory) Finds an arc sequence through the given waypoints.default @Nullable OrderedPair<ImmutableList<Arc<V, A>>, C> Finds an arc sequence through the given waypoints.static <VV,AA, CC extends Number & Comparable<CC>>
@Nullable OrderedPair<ImmutableList<Arc<VV, AA>>, CC> findArcSequenceOverWaypoints(@NonNull Iterable<VV> waypoints, @NonNull BiFunction<VV, VV, OrderedPair<ImmutableList<Arc<VV, AA>>, CC>> findArcSequenceFunction, @NonNull CC zero, @NonNull BiFunction<CC, CC, CC> sumFunction) Helper function for implementingfindArcSequenceOverWaypoints(Iterable, int, Number, Supplier).
-
Method Details
-
findArcSequence
@Nullable OrderedPair<ImmutableList<Arc<V,A>>, findArcSequenceC> (@NonNull Iterable<V> startVertices, @NonNull Predicate<V> goalPredicate, int maxDepth, @NonNull C costLimit, @NonNull AddToSet<V> visited) Finds an arc sequence from a set of start vertices to a vertex that satisfies the goal predicate.- Parameters:
startVertices- the start verticesgoalPredicate- the goal vertexmaxDepth- the maximal depth (inclusive) of the search Must be >= 0.costLimit- the algorithm-specific search limitvisited- the visited function- Returns:
- an ordered pair (arc sequence, cost), or null if no sequence was found.
-
findArcSequence
default @Nullable OrderedPair<ImmutableList<Arc<V,A>>, findArcSequenceC> (@NonNull V start, @NonNull V goal, int maxDepth, @NonNull C costLimit, @NonNull AddToSet<V> visited) Finds an arc 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 (arc sequence, cost), or null if no sequence was found.
-
findArcSequence
default @Nullable OrderedPair<ImmutableList<Arc<V,A>>, findArcSequenceC> (@NonNull V start, @NonNull V goal, int maxDepth, @NonNull C costLimit) Finds an arc 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 (arc sequence, cost), or null if no sequence was found.
-
findArcSequence
default @Nullable OrderedPair<ImmutableList<Arc<V,A>>, findArcSequenceC> (@NonNull V start, @NonNull V goal, @NonNull C costLimit) Finds an arc sequence from start to goal.- Parameters:
start- the start vertexgoal- the goal vertexcostLimit- the algorithm-specific cost limit- Returns:
- an ordered pair (arc sequence, cost), or null if no sequence was found.
-
findArcSequenceOverWaypoints
@Nullable OrderedPair<ImmutableList<Arc<V,A>>, findArcSequenceOverWaypointsC> (@NonNull Iterable<V> waypoints, int maxDepth, @NonNull C costLimit, @NonNull Supplier<AddToSet<V>> visitedSetFactory) Finds an arc sequence through the given waypoints.- Parameters:
waypoints- an iterable 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 (arc sequence, cost), or null if no sequence was found.
-
findArcSequenceOverWaypoints
default @Nullable OrderedPair<ImmutableList<Arc<V,A>>, findArcSequenceOverWaypointsC> (@NonNull Iterable<V> waypoints, int maxDepth, @NonNull C costLimit) Finds an arc sequence through the given waypoints.- Parameters:
waypoints- an iterable 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 (arc sequence, cost), or null if no sequence was found.
-
findArcSequenceOverWaypoints
default @Nullable OrderedPair<ImmutableList<Arc<V,A>>, findArcSequenceOverWaypointsC> (@NonNull Iterable<V> waypoints, @NonNull C costLimit) Finds an arc sequence through the given waypoints.- Parameters:
waypoints- an iterable of waypointscostLimit- the algorithm-specific cost limit for paths between waypoints- Returns:
- an ordered pair (arc sequence, cost), or null if no sequence was found.
-
findArcSequenceOverWaypoints
static <VV,AA, @Nullable OrderedPair<ImmutableList<Arc<VV,CC extends Number & Comparable<CC>> AA>>, findArcSequenceOverWaypointsCC> (@NonNull Iterable<VV> waypoints, @NonNull BiFunction<VV, VV, OrderedPair<ImmutableList<Arc<VV, AA>>, CC>> findArcSequenceFunction, @NonNull CC zero, @NonNull BiFunction<CC, CC, CC> sumFunction) Helper function for implementingfindArcSequenceOverWaypoints(Iterable, int, Number, Supplier).- Type Parameters:
VV- the vertex typeCC- the number type- Parameters:
waypoints- the waypointsfindArcSequenceFunction- the search function, for examplethis::findArrowSequencezero- the zero valuesumFunction- the sum function- Returns:
- an ordered pair with the combined sequence
-