HeuristicPolicyManhattan()

Class for representing a heuristic for graph search algorithms based on the manhattan distance. The heuristic assumes that the node have a position property of type Vector3.

new HeuristicPolicyManhattan()

Author:

Methods

static calculate(graph, source, target) → {Number}

Calculates the manhattan distance between two nodes.

Parameters:
Name Type Description
graph Graph

The graph.

source Number

The index of the source node.

target Number

The index of the target node.

Returns:
Number -

The manhattan distance between both nodes.