Show / Hide Table of Contents

    Interface INode

    The A* algorithm takes a starting node and a goal node and searches from the start to the goal.

    The nodes can be setup in a graph ahead of running the algorithm or the children nodes can be generated on the fly when the A* algorithm requests the Children property.

    See the square puzzle implementation to see the children being generated on the fly instead of the classical image/graph search with walls.

    Namespace: Fibula.Common.Utilities.Pathfinding
    Assembly: Fibula.Common.Utilities.dll
    Syntax
    public interface INode

    Properties

    | Improve this Doc View Source

    EstimatedCost

    Gets the estimated cost for this node. This is the heuristic from this node to the goal node, or h.

    Declaration
    int EstimatedCost { get; }
    Property Value
    Type Description
    System.Int32
    | Improve this Doc View Source

    HasBeenVisited

    Gets or sets a value indicating whether this node is part of the closed list.

    Declaration
    bool HasBeenVisited { get; set; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    MovementCost

    Gets the movement cost for this node. This is the movement cost from this node to the starting node, or g.

    Declaration
    int MovementCost { get; }
    Property Value
    Type Description
    System.Int32
    | Improve this Doc View Source

    Parent

    Gets or sets the parent node to this node.

    Declaration
    INode Parent { get; set; }
    Property Value
    Type Description
    INode
    | Improve this Doc View Source

    ShouldBeVisited

    Gets or sets a value indicating whether this node is part of the open list.

    Declaration
    bool ShouldBeVisited { get; set; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    TotalCost

    Gets the total cost for this node. This is the sum of the cost from this node to the starting node, or g, plus the heuristic cost from this node to the goal node, or h. [t = g + h].

    Declaration
    int TotalCost { get; }
    Property Value
    Type Description
    System.Int32

    Methods

    | Improve this Doc View Source

    FindAdjacent(INodeFactory)

    Gets this node's adjacent nodes.

    Declaration
    IEnumerable<INode> FindAdjacent(INodeFactory nodeFactory)
    Parameters
    Type Name Description
    INodeFactory nodeFactory

    A reference to the factory to create new nodes.

    Returns
    Type Description
    System.Collections.Generic.IEnumerable<INode>

    The collection of adjacent nodes.

    | Improve this Doc View Source

    IsGoal(INode)

    Returns true if this node is the goal, false if it is not the goal.

    Declaration
    bool IsGoal(INode goal)
    Parameters
    Type Name Description
    INode goal

    The goal node to compare this node against.

    Returns
    Type Description
    System.Boolean

    True if this node is the goal, false if it s not the goal.

    | Improve this Doc View Source

    SetEstimatedCost(INode)

    Sets the estimated cost for the current node, or h.

    Declaration
    void SetEstimatedCost(INode goal)
    Parameters
    Type Name Description
    INode goal

    Goal node, for acces to the goals position.

    | Improve this Doc View Source

    SetMovementCost(INode)

    Sets the movement cost for the current node, or g.

    Declaration
    void SetMovementCost(INode parent)
    Parameters
    Type Name Description
    INode parent

    Parent node, for access to the parents movement cost.

    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.