/// <summary>Returns an <c>IDirectedPath</c> for the optimal path from coordinates <c>start</c> to <c>goal</c>.</summary> /// <param name="start">Coordinates for the <c>last</c> step on the desired path.</param> /// <param name="goal">Coordinates for the <c>first</c> step on the desired path.</param> /// <param name="board">An object satisfying the interface <c>INavigableBoardFwd</c>.</param> /// <returns></returns> /// ///<remarks>Note that <c>heuristic</c> <b>must</b> be monotonic in order for the algorithm to perform properly.</remarks> #pragma warning disable 1658, 1584 /// <seealso cref="http://www.cs.trincoll.edu/~ram/cpsc352/notes/astar.html"/> #pragma warning restore 1633, 1658, 1584 public static IDirectedPath FindDirectedPathFwd( IHex start, IHex goal, IDirectedNavigableBoard board ) { if (board == null) throw new ArgumentNullException("board"); return FindDirectedPathFwd(start, goal, board.DirectedStepCost, board.Heuristic); }
/// <summary>As <c>FindDirectedPathFwd</c>, except with the steps stacked in reverse.</summary> /// <remarks> /// The path steps are ordered in reverse as the forward half-path has been stacked /// onto the reverse half-path during post-processing, instead of the reverse. /// </remarks> /// <see cref="FindDirectedPathFwd"/> public static IDirectedPath FindDirectedPathRev( IHex start, IHex goal, IDirectedNavigableBoard board ) { if (board == null) { throw new ArgumentNullException("board"); } return(FindDirectedPath(start, goal, board.DirectedStepCost, board.Landmarks).PathRev); }
/// <summary>Returns an <c>IDirectedPath</c> for the optimal path from coordinates <c>start</c> to <c>goal</c>.</summary> /// <param name="start">Coordinates for the <c>last</c> step on the desired path.</param> /// <param name="goal">Coordinates for the <c>first</c> step on the desired path.</param> /// <param name="board">An object satisfying the interface <c>INavigableBoardFwd</c>.</param> /// <returns></returns> /// ///<remarks>Note that <c>heuristic</c> <b>must</b> be monotonic in order for the algorithm to perform properly.</remarks> #pragma warning disable 1658, 1584 /// <seealso cref="http://www.cs.trincoll.edu/~ram/cpsc352/notes/astar.html"/> #pragma warning restore 1633, 1658, 1584 public static IDirectedPath FindDirectedPathFwd( IHex start, IHex goal, IDirectedNavigableBoard board ) { if (board == null) { throw new ArgumentNullException("board"); } return(FindDirectedPathFwd(start, goal, board.DirectedStepCost, board.Heuristic)); }
/// <summary>As <c>FindDirectedPathFwd</c>, except with the steps stacked in reverse.</summary> /// <remarks> /// The path steps are ordered in reverse as the forward half-path has been stacked /// onto the reverse half-path during post-processing, instead of the reverse. /// </remarks> /// <see cref="FindDirectedPathFwd"/> public static IDirectedPath FindDirectedPathRev( IHex start, IHex goal, IDirectedNavigableBoard board ) { if (board == null) throw new ArgumentNullException("board"); return FindDirectedPath(start, goal, board.DirectedStepCost, board.Landmarks).PathRev; }
public PathShortcut(IHex start, IHex goal, IDirectedNavigableBoard board) { DirectedPath = BidirectionalPathfinder.FindDirectedPathFwd(start, goal, board); Goal = goal; }