• API Documentation
Show / Hide Table of Contents
  • Rebus
    • Arguments
    • Biome
    • CantorPairing
    • CommandRequest
    • CommandResponse
    • CommandType
    • Commodity
    • Configuration
    • ConflictEventArgs
    • Depths
    • Economy
    • Fleet
    • HexPoint
    • IGameService
    • ILoginService
    • Player
    • Unit
    • User
    • Zone
    • ZoneInfo
  • Rebus.Client
    • GraphicsEngine
    • Layout
    • RpcClient
    • ZoneVisualizer
  • Rebus.Client.Lenses
    • BiomeLens
    • ConstellationLens
    • Lens
    • PopulationLens
    • StarLens
  • Rebus.Server
    • AStarSearch
    • EvaluationContext
    • FisherYatesShuffle
    • JuliaSet
    • PowerSet
  • Rebus.Server.Considerations
    • Agent
    • Behavior
    • BehaviorCollection
    • Consideration
    • ConsiderationCollection
    • FunctionConsideration
    • LinearConsideration
    • QuadraticConsideration
  • Rebus.Server.Functions
    • IFunctions<T>
  • System
    • NegativeExponentialRandom
  • System.Text.Json.Serialization.Converters
    • ComplexConverter
    • CultureInfoConverter
    • IPAddressConverter

Class AStarSearch

Provides an implementation of the A* search algorithm. This class cannot be inherited.

Inheritance
Object
AStarSearch
Inherited Members
Object.Equals(Object)
Object.Equals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Object.ReferenceEquals(Object, Object)
Object.ToString()
Namespace: Rebus.Server
Assembly: Rebus.Server.dll
Syntax
public static class AStarSearch
Remarks

The implementation of this class was inspired by and based on this Wikipedia article.

Methods

Search<T>(T, T, IFunctions<T>)

Finds the shortest path between two nodes.

Declaration
public static Stack<T> Search<T>(T source, T destination, IFunctions<T> functions)
    where T : IEquatable<T>
Parameters
Type Name Description
T source

The source node.

T destination

The destination node.

IFunctions<T> functions

The set of graph-node functions.

Returns
Type Description
Stack<T>

A stack containing the ordered set of nodes leading from the source node to the destination node, or an empty stack if no such path exists.

Type Parameters
Name Description
T

See Also

A* search algorithm - Wikipedia
In This Article
Back to top © 2021-2022 Ishan Pranav. All rights reserved. Licensed under the MIT License.