mirror of
https://github.com/anvaka/ngraph.path.git
synced 2026-01-25 15:23:38 +00:00
Removed class syntax
This commit is contained in:
parent
0ce6681436
commit
5601dee87e
@ -58,7 +58,7 @@ This code will correctly print a path: `d <- c <- a`.
|
||||
|
||||
When pathfinder searches for a path between two nodes it considers all
|
||||
neighbors of a given node without any preference. In some cases we may want to
|
||||
guide pathfinder and tell it our preferred exploration direction.
|
||||
guide the pathfinder and tell it our preferred exploration direction.
|
||||
|
||||
For example, when each node in a graph has coordinates, we can assume that
|
||||
nodes that are closer towards the path-finder's target should be explored
|
||||
|
||||
@ -1,20 +1,18 @@
|
||||
class NodeSearchState {
|
||||
constructor(node) {
|
||||
this.node = node;
|
||||
var NodeSearchState = function NodeSearchState(node) {
|
||||
this.node = node;
|
||||
|
||||
// How we came to this node?
|
||||
this.parent = null;
|
||||
// How we came to this node?
|
||||
this.parent = null;
|
||||
|
||||
this.closed = false;
|
||||
this.open = 0;
|
||||
this.closed = false;
|
||||
this.open = 0;
|
||||
|
||||
this.distanceToSource = Number.POSITIVE_INFINITY;
|
||||
// the f(n) = g(n) + h(n) value
|
||||
this.fScore = Number.POSITIVE_INFINITY;
|
||||
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;
|
||||
}
|
||||
}
|
||||
// used to reconstruct heap when fScore is updated.
|
||||
this.heapIndex = -1;
|
||||
};
|
||||
|
||||
module.exports = NodeSearchState;
|
||||
Loading…
x
Reference in New Issue
Block a user