We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6c8da6b commit ef546b9Copy full SHA for ef546b9
benchmark/benchmark.js
@@ -40,12 +40,16 @@ function benchmark(opt) {
40
var fields = [
41
opt.header,
42
(''+result.time + 'ms').yellow,
43
- 'length' , result.returnValue.length,
+ 'length' , formatFloat(PF.Util.pathLength(result.returnValue)),
44
opt.footer,
45
];
46
console.log(fields.join(' '));
47
}
48
49
+function formatFloat(float) {
50
+ return Math.round(float * 1000) / 1000;
51
+}
52
+
53
function map2grid(map) {
54
return new PF.Grid(map.width, map.height, map.grid);
55
@@ -63,7 +67,7 @@ testCases.forEach(function(test) {
63
67
64
68
var result = benchmark({
65
69
header: 'AStarFinder',
66
- finder: new PF.AStarFinder,
70
+ finder: new PF.AStarFinder({allowDiagonal: true}),
71
grid: grid,
72
startX: scen.startX,
73
startY: scen.startY,
0 commit comments