Show / Hide Table of Contents

Class SolverBase<T>

The base of the Generic Solvers, which handles all the common functionality.

Inheritance
System.Object
SolverBase<T>
AStar<T>
BreadthFirst<T>
Greedy<T>
Implements
IGraphSolver<T>
IComparer<PathFinder.Solvers.Generic.GraphNodeMetaData<T>>
Namespace: PathFinder.Solvers.Generic
Assembly: PathFinder.dll
Syntax
public abstract class SolverBase<T> : object, IGraphSolver<T>, IComparer<GraphNodeMetaData<T>> where T : IEquatable<T>
Type Parameters
Name Description
T

The type of the nodes to traverse.

Properties

| Improve this Doc View Source

Closed

A list of nodes which have already been checked.

Declaration
public IEnumerable<T> Closed { get; }
Property Value
Type Description
IEnumerable<T>
| Improve this Doc View Source

ClosedCount

Count of closed nodes.

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

Current

The last node to be checked.

Declaration
public T Current { get; }
Property Value
Type Description
T
| Improve this Doc View Source

CurrentBestPath

The current best path to get as close as possible to the Destination.

Declaration
public IList<T> CurrentBestPath { get; }
Property Value
Type Description
IList<T>
Remarks

Not guaranteed to be a "good" path, and may vary greatly each tick.

| Improve this Doc View Source

Destination

The destination node to search for.

Declaration
public T Destination { get; }
Property Value
Type Description
T
| Improve this Doc View Source

MaxTicks

The maximum number of ticks this solver can perform before giving up.

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

Open

A List of nodes which still need to be checked.

Declaration
public IEnumerable<T> Open { get; }
Property Value
Type Description
IEnumerable<T>
| Improve this Doc View Source

OpenCount

Count of open nodes.

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

Origin

The starting node to search from.

Declaration
public T Origin { get; }
Property Value
Type Description
T
| Improve this Doc View Source

Path

The path from the Origin to the Destination. Will be null if State is not Success.

Declaration
public IList<T> Path { get; }
Property Value
Type Description
IList<T>
| Improve this Doc View Source

PathCost

The cost to get from the Origin to the Destination via the path.

Declaration
public double PathCost { get; }
Property Value
Type Description
System.Double
| Improve this Doc View Source

State

The current SolverState.

Declaration
public SolverState State { get; protected set; }
Property Value
Type Description
SolverState
| Improve this Doc View Source

Ticks

The number of ticks this solver has performed.

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

Methods

| Improve this Doc View Source

Run(Int32)

Runs the solver until a path is found, the allotted ticks is exhausted, or a path could not be found.

Declaration
public SolverState Run(int numTicks = null)
Parameters
Type Name Description
System.Int32 numTicks
Returns
Type Description
SolverState

The SolverState the solver is in after the run.

| Improve this Doc View Source

Stop()

Stop the current solver.

Declaration
public void Stop()

Implements

IGraphSolver<T>
IComparer<>
  • Improve this Doc
  • View Source
☀
☾
Back to top Generated by DocFX