Function
heuristic
(source: { x: number; y: number }, target: { x: number; y: number })
Source from the content-addressed store, hash-verified
| 2474 | }) |
| 2475 | |
| 2476 | const heuristic = (source: { x: number; y: number }, target: { x: number; y: number }) => |
| 2477 | Math.abs(source.x - target.x) + Math.abs(source.y - target.y) |
| 2478 | |
| 2479 | const result = Graph.astar(graph, { source: nodeA!, target: nodeC!, cost: (edge) => edge, heuristic }) |
| 2480 | expect(Option.isSome(result)).toBe(true) |
Tested by
no test coverage detected