ngraph.path/a-star/NodeSearchState.js
2017-09-10 16:37:17 -07:00

18 lines
414 B
JavaScript

var NodeSearchState = function NodeSearchState(node) {
this.node = node;
// How we came to this node?
this.parent = null;
this.closed = false;
this.open = 0;
this.distanceToSource = Number.POSITIVE_INFINITY;
// the f(n) = g(n) + h(n) value
this.fScore = Number.POSITIVE_INFINITY;
// used to reconstruct heap when fScore is updated.
this.heapIndex = -1;
};
module.exports = NodeSearchState;