Module org.jhotdraw8.graph
Package org.jhotdraw8.graph.path.algo
Interface VertexReachabilityAlgo<V,C extends Number & Comparable<C>>
- Type Parameters:
V- the vertex data typeC- the cost number type
public interface VertexReachabilityAlgo<V,C extends Number & Comparable<C>>
Interface for a reachability test algorithm.
-
Method Summary
Modifier and TypeMethodDescriptionbooleantryToReach(@NonNull Iterable<V> startVertices, @NonNull Predicate<V> goalPredicate, int maxDepth, @NonNull C zero, @NonNull C costLimit, @NonNull Function<V, Iterable<V>> nextVerticesFunction, @NonNull BiFunction<V, V, C> costFunction, @NonNull BiFunction<C, C, C> sumFunction, @NonNull AddToSet<V> visited) Search engine method.
-
Method Details
-
tryToReach
boolean tryToReach(@NonNull Iterable<V> startVertices, @NonNull Predicate<V> goalPredicate, int maxDepth, @NonNull C zero, @NonNull C costLimit, @NonNull Function<V, Iterable<V>> nextVerticesFunction, @NonNull BiFunction<V, V, C> costFunction, @NonNull BiFunction<C, C, C> sumFunction, @NonNull AddToSet<V> visited) Search engine method.- Parameters:
startVertices- the set of start verticesgoalPredicate- the goal predicatemaxDepth- the maximal depth (inclusive) of the search Must be >= 0.zero- the zero cost valuecostLimit- the algorithm-specific cost limitnextVerticesFunction- the next nodes functioncostFunction- the cost functionsumFunction- the sum function for adding two cost valuesvisited- the visited function- Returns:
- true on success
-