pathfinding 3.0.1 copy "pathfinding: ^3.0.1" to clipboard
pathfinding: ^3.0.1 copied to clipboard

A Dart port of https://github.com/qiao/PathFinding.js library

PathFinding.dart #

A Dart port of https://github.com/qiao/PathFinding.js library

Installing #

http://pub.dartlang.org/packages/pathfinding#installing

Usage: #

import 'package:pathfinding/finders/jps.dart';
import 'package:pathfinding/core/grid.dart';

main() {
  var grid = new Grid(4, 4, [
    [0, 0, 1, 1], // 0 - walkable, 1 - not walkable
    [1, 0, 1, 1],
    [1, 0, 1, 1],
    [1, 0, 0, 0]
  ]);
  var jps = new JumpPointFinder();
  var path = jps.findPath(0, 0, 3, 3, grid);
  print(path); // [[0, 0], [1, 1], [1, 2], [2, 3], [3, 3]]
}

Available finders: #

  • AStar
  • JumpPointFinder

TODO:

  • BreadthFirst
  • Dijkstra
  • BiBreadthFirst
  • BiDijkstra
  • BiAStarFinder
  • BestFirstFinder
  • BiBestFirstFinder

Benchmarks #

$ dart test benchmark/benchmarks.dart 
00:05 +0: loading benchmark/benchmarks.dart                                                                                                                              
AStarFinder(RunTime): 41619.873239436616 us.
JumpPointFinder(RunTime): 7654.5874125874125 us.
7
likes
140
points
239
downloads

Publisher

unverified uploader

Weekly Downloads

A Dart port of https://github.com/qiao/PathFinding.js library

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

More

Packages that depend on pathfinding