sector library

Classes

AbsentMapEntry<K, V> Collections
An entry for an absent key-value pair in an IndexMap.
AdjacencyListGraph<E> Graphs
An unweighted graph suitable for sparse graphs.
Astar<E> Pathfinding
Pathfinding algorithm that finds an optimal shortest path using a heuristic.
BreadthFirstSearch<E> Pathfinding
Pathfinding algorithm that search the shallowest nodes in a graph first.
DepthFirstSearch<E> Pathfinding
Pathfinding algorithm that explores the graph in depth first order.
Dijkstra<E> Pathfinding
Pathfinding algorithm that finds the best path in a weighted graph.
Edge<E> Graphs
A graph edge connecting two nodes.
FixedLengthIterable<E> Collections
An Iterable for classes that have an efficient fixed length property.
FlatQueue Collections
A very fast and tiny binary heap priority queue that stores (int, double).
FringeAstar<E> Pathfinding
Pathfinding algorithm that finds an optimal shortest path using a heuristic.
Goal<T> Pathfinding
Represents a goal in a pathfinding algorithm.
Graph<E> Graphs
A collection of nodes and edges where edges connect exactly two nodes.
GraphBase<E> Graphs
A base interface for graphs.
GreedyBestFirstSearch<E> Pathfinding
Pathfinding algorithm that chooses the locally optimal path at each step.
Grid<E> Grids
A collection of elements accessible by a two-dimensional index.
GridHeuristic Pathfinding
A heuristic that estimates the minimum total cost of reaching a Pos goal.
GridWalkable<E> Grids
Adapts a Grid into a WeightedWalkable.
Heuristic<T> Pathfinding
A heuristic estimates the minimum total cost of reaching a Goal.
IndexedMapEntry<K, V> Collections
An entry for an present or absent key-value pair in an IndexMap.
IndexMap<K, V> Collections
A hash map where element iteration order is independent of their hash codes.
IndexSet<E> Collections
A hash set where element iteration order is independent of their hash codes.
ListGrid<E> Grids
A dense grid implementation using a 1-dimension List to store elements.
Path<T> Pathfinding
A representation of a path in a graph.
PathfinderBase<E>
A base interface for pathfinding algorithms.
Pos Grids
An immutable 2D fixed-point vector.
PresentMapEntry<K, V> Collections
An entry for a present key-value pair in an IndexMap.
Rect Grids
An immutable 2D fixed-point rectangle.
ScalarEvent<E> Graphs
A captured Tracer.pushScalar event.
SkipEvent<E> Graphs
A captured Tracer.onSkip event.
SplayTreeGrid<E> Grids
A sparse grid implementation backed by a SplayTreeMap.
TraceEvent<E> Graphs
An event captured by a TraceRecorder.
Tracer<E> Graphs
A utility for capturing events during a graph traversal or pathfinding.
TraceRecorder<E> Graphs
A utility for recording events during a graph traversal or pathfinding.
VisitEvent<E> Graphs
A captured Tracer.onVisit event.
Walkable<E> Graphs
A collection of values, or "nodes", that can be traversed incrementally.
WalkableBase<E> Graphs
A base interface for walkable collections.
WeightedEdge<V> Graphs
A weighted graph edge connecting two nodes.
WeightedGraph<V> Graphs
A graph where edges have an associated weight, or "cost", a double value.
WeightedWalkable<E> Graphs
A collection of nodes and edges that can be traversed incrementally.

Mixins

BestPathfinder<E> Pathfinding
Visits a WeightedWalkable's nodes, finding a best path to a goal node.
HeuristicPathfinder<E> Pathfinding
Visits a WeightedWalkable's nodes, finding a best path to a goal node.
Pathfinder<E> Pathfinding
Visits a Walkable's node, finding one or more paths to a goal node.
UndirectedGraph<E> Graphs
A mixin that that adapts a Graph to be undirected.

Extension Types

TraceKey Graphs
A known key for a scalar value in a trace.

Constants

astar → const Astar<Object?> Pathfinding
Pathfinding algorithm that finds an optimal shortest path using a heuristic.
breadthFirstSearch → const BreadthFirstSearch<Object?> Pathfinding
Pathfinding algorithm that search the shallowest nodes in a graph first.
depthFirstSearch → const DepthFirstSearch<Object?> Pathfinding
Pathfinding algorithm that explores the graph in depth first order.
dijkstra → const Dijkstra<Object?> Pathfinding
Pathfinding algorithm that finds the best path in a weighted graph.
fringeAstar → const FringeAstar<Object?> Pathfinding
Pathfinding algorithm that finds an optimal shortest path using a heuristic.
greedyBestFirstSearch → const GreedyBestFirstSearch<Object?> Pathfinding
Pathfinding algorithm that chooses the locally optimal path at each step.

Functions

breadthFirst<T>(WalkableBase<T> graph, {required T start, Tracer<T>? tracer}) Iterable<T> Graphs
Visits nodes in a graph structure, shallowest nodes first, from start.
countPaths<T>(WalkableBase<T> walkable, {required T start, required Goal<T> goal, Tracer<T>? tracer}) int Pathfinding
Counts the total number of paths from start to a goal in a walkable.
depthFirst<T>(WalkableBase<T> graph, {required T start, Tracer<T>? tracer}) Iterable<T> Graphs
Visits nodes in a graph structure, deepest nodes first, from start.
stronglyConnected<T>(WalkableBase<T> graph, {Iterable<T>? from, Tracer<T>? tracer}) List<List<T>> Graphs
Partitions nodes reachable in a graph into strongly connected components.
topologicalSort<T>(Iterable<T> roots, {required Iterable<T> successors(T)}) List<T> Graphs
Returns a topological sort of the directed edges provided, if one exists.

Typedefs

Crawler<E> = Iterable<T> Function<T extends E>(WalkableBase<T> nodes, {required T start, Tracer<T>? tracer}) Graphs
A function that visits nodes in a graph structure starting from start.

Exceptions / Errors

CycleException<T> Graphs
Indicates a cycle was detected in a graph expected to be acyclic.