mirror of
https://github.com/anvaka/ngraph.path.git
synced 2026-01-25 15:23:38 +00:00
18 lines
414 B
JavaScript
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; |