HeuristicPolicyEuclid()

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

new HeuristicPolicyEuclid()

Author:

Methods

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

Calculates the euclidean 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 euclidean distance between both nodes.