示例#1
0
文件: Search.cs 项目: lanicon/Theta
 /// <summary>Runs the Greedy search algorithm algorithm on a graph.</summary>
 /// <param name="start">The node to start at.</param>
 /// <param name="graph">The graph to search against.</param>
 /// <param name="heuristic">Computes the heuristic value of a given node in a graph.</param>
 /// <param name="goal">Predicate for determining if we have reached the goal node.</param>
 /// <returns>Stepper of the shortest path or null if no path exists.</returns>
 public static Stepper <T> Greedy(T start, Theta.Structures.Graph <T> graph, Heuristic heuristic, Goal goal)
 {
     return(Greedy(start, graph.Neighbors, heuristic, goal));
 }
示例#2
0
文件: Search.cs 项目: lanicon/Theta
 /// <summary>Runs the Greedy search algorithm algorithm on a graph.</summary>
 /// <param name="start">The node to start at.</param>
 /// <param name="graph">The graph to search against.</param>
 /// <param name="heuristic">Computes the heuristic value of a given node in a graph.</param>
 /// <param name="goal">Predicate for determining if we have reached the goal node.</param>
 /// <param name="equate">Delegate for checking for equality between two nodes.</param>
 /// <returns>Stepper of the shortest path or null if no path exists.</returns>
 public static Stepper <T> Greedy(T start, Theta.Structures.Graph <T> graph, Heuristic heuristic, T goal, Equate <T> equate)
 {
     return(Greedy(start, graph.Neighbors, heuristic, (T node) => { return equate(node, goal); }));
 }
示例#3
0
文件: Search.cs 项目: lanicon/Theta
 /// <summary>Runs the A* search algorithm algorithm on a graph.</summary>
 /// <param name="start">The node to start at.</param>
 /// <param name="graph">The graph to perform the search on.</param>
 /// <param name="heuristic">Computes the heuristic value of a given node in a graph.</param>
 /// <param name="cost">Computes the cost of moving from the current node to a specific neighbor.</param>
 /// <param name="goal">The goal node.</param>
 /// <returns>Stepper of the shortest path or null if no path exists.</returns>
 public static Stepper <T> Astar(T start, Theta.Structures.Graph <T> graph, Heuristic heuristic, Cost cost, T goal)
 {
     return(Astar(start, graph, heuristic, cost, goal, Equate.Default));
 }
示例#4
0
文件: Search.cs 项目: lanicon/Theta
 /// <summary>Runs the Greedy search algorithm algorithm on a graph.</summary>
 /// <param name="start">The node to start at.</param>
 /// <param name="graph">The graph to search against.</param>
 /// <param name="heuristic">Computes the heuristic value of a given node in a graph.</param>
 /// <param name="goal">Predicate for determining if we have reached the goal node.</param>
 /// <returns>Stepper of the shortest path or null if no path exists.</returns>
 public static Stepper <T> Greedy(T start, Theta.Structures.Graph <T> graph, Heuristic heuristic, T goal)
 {
     return(Greedy(start, graph, heuristic, goal, Equate.Default));
 }
示例#5
0
文件: Search.cs 项目: lanicon/Theta
 /// <summary>Runs the A* search algorithm algorithm on a graph.</summary>
 /// <param name="start">The node to start at.</param>
 /// <param name="graph">The graph to perform the search on.</param>
 /// <param name="heuristic">Computes the heuristic value of a given node in a graph.</param>
 /// <param name="cost">Computes the cost of moving from the current node to a specific neighbor.</param>
 /// <param name="goal">Predicate for determining if we have reached the goal node.</param>
 /// <returns>Stepper of the shortest path or null if no path exists.</returns>
 public static Stepper <T> Astar(T start, Theta.Structures.Graph <T> graph, Heuristic heuristic, Cost cost, Goal goal)
 {
     return(Astar(start, graph.Neighbors, heuristic, cost, goal));
 }