MCPcopy Index your code
hub / github.com/Effect-TS/effect / heuristic

Function heuristic

packages/effect/test/Graph.test.ts:2476–2477  ·  view source on GitHub ↗
(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)

Callers 1

astarFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected