Path<T> class final Pathfinding

A representation of a path in a graph.

Each subsequent node in nodes is a neighbor of the previous node.

The first node in nodes is the start node, and the last node is the goal.

Equality

Two paths are considered equal if they have the same nodes in the same order.

Annotations

Constructors

Path(List<T> nodes)
Creates a path from a list of nodes.
const

Properties

cycle bool
Whether the path is considered a cycle.
no setter
goal → T
The goal node of the path.
no setter
hashCode int
The hash code for this object.
no setteroverride
isFound bool
Returns true if this path was considered found, i.e. non-empty.
no setter
isNotFound bool
Returns true if this path was considered not found, i.e. empty.
no setter
nodes List<T>
The nodes in the path.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
start → T
The start node of the path.
no setter

Methods

isIn(WalkableBase<T> graph) bool
Returns true if this is a valid path in the graph.
isInWithCost(WeightedWalkable<T> graph, double cost) → (bool, double)
Returns whether the path is valid and has a total cost of cost.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
override

Constants

notFound → const Path<Never>
A path that is considered not found.