Interface IGraphSolver<T>
All Generic Graph Solvers implement this interface. This ensures solvers can be used interchangeably depending on need.
Namespace: PathFinder.Solvers.Generic
Assembly: PathFinder.dll
Syntax
public interface IGraphSolver<T>
Type Parameters
Name | Description |
---|---|
T |
Properties
| Improve this Doc View SourceClosed
A list of nodes which have already been checked.
Declaration
IEnumerable<T> Closed { get; }
Property Value
Type | Description |
---|---|
IEnumerable<T> |
ClosedCount
Count of closed nodes.
Declaration
int ClosedCount { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Current
The last node to be checked.
Declaration
T Current { get; }
Property Value
Type | Description |
---|---|
T |
CurrentBestPath
The current best path to get as close as possible to the Destination.
Declaration
IList<T> CurrentBestPath { get; }
Property Value
Type | Description |
---|---|
IList<T> |
Remarks
Not guaranteed to be a "good" path, and may vary greatly each tick.
Destination
The destination node to search for.
Declaration
T Destination { get; }
Property Value
Type | Description |
---|---|
T |
MaxTicks
The maximum number of ticks this solver can perform before giving up.
Declaration
int MaxTicks { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Open
A List of nodes which still need to be checked.
Declaration
IEnumerable<T> Open { get; }
Property Value
Type | Description |
---|---|
IEnumerable<T> |
OpenCount
Count of open nodes.
Declaration
int OpenCount { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Origin
The starting node to search from.
Declaration
T Origin { get; }
Property Value
Type | Description |
---|---|
T |
Path
Declaration
IList<T> Path { get; }
Property Value
Type | Description |
---|---|
IList<T> |
PathCost
The cost to get from the Origin to the Destination via the path.
Declaration
double PathCost { get; }
Property Value
Type | Description |
---|---|
System.Double |
State
The current SolverState.
Declaration
SolverState State { get; }
Property Value
Type | Description |
---|---|
SolverState |
Ticks
The number of ticks this solver has performed.
Declaration
int Ticks { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Methods
| Improve this Doc View SourceRun(Int32)
Runs the solver until a path is found, the allotted ticks is exhausted, or a path could not be found.
Declaration
SolverState Run(int ticks = null)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | ticks | Number of ticks to run. Any number less than zero means run until MaxTicks |
Returns
Type | Description |
---|---|
SolverState | The SolverState the solver is in after the run. |
Stop()
Stop the current solver.
Declaration
void Stop()