Show / Hide Table of Contents

    Class AStar

    Interface to setup and run the A* algorithm.

    Inheritance
    System.Object
    AStar
    Inherited Members
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: Fibula.Common.Utilities.Pathfinding
    Assembly: Fibula.Common.Utilities.dll
    Syntax
    public class AStar

    Constructors

    | Improve this Doc View Source

    AStar(INodeFactory, INode, INode, Int32)

    Initializes a new instance of the AStar class.

    Declaration
    public AStar(INodeFactory nodeFactory, INode start, INode goal, int maxSearchSteps = 100)
    Parameters
    Type Name Description
    INodeFactory nodeFactory

    A reference to the node factory in use.

    INode start

    The starting node for the AStar algorithm.

    INode goal

    The goal node for the AStar algorithm.

    System.Int32 maxSearchSteps

    Optional. The maximum number of Step operations to perform on the search.

    Properties

    | Improve this Doc View Source

    CurrentNode

    Gets the current node that the AStar algorithm is at.

    Declaration
    public INode CurrentNode { get; }
    Property Value
    Type Description
    INode

    Methods

    | Improve this Doc View Source

    GetLastPath()

    Gets the path of the last solution of the AStar algorithm. Will return a partial path if the algorithm has not finished yet.

    Declaration
    public IEnumerable<INode> GetLastPath()
    Returns
    Type Description
    System.Collections.Generic.IEnumerable<INode>

    Returns null if the algorithm has never been run.

    | Improve this Doc View Source

    Run()

    Steps the AStar algorithm forward until it either fails or finds the goal node.

    Declaration
    public SearchState Run()
    Returns
    Type Description
    SearchState

    Returns the state the algorithm finished in, Failed or GoalFound.

    | Improve this Doc View Source

    Step()

    Moves the AStar algorithm forward one step.

    Declaration
    public SearchState Step()
    Returns
    Type Description
    SearchState

    Returns the state the alorithm is in after the step, either Failed, GoalFound or still Searching.

    Extension Methods

    ObjectExtensions.YieldSingleItem<T>(T)
    ObjectExtensions.GetPropertyValue(Object, String)
    Validate.ThrowIfNull(Object, String)
    • Improve this Doc
    • View Source
    Back to top Copyright © 2018-2020 | The Fibula Project
    Generated using DocFX | Jose L. Nuñez de Caceres et al.