new NavEdge(from, to, cost)
Constructs a navigation edge.
Parameters:
Name | Type | Default | Description |
---|---|---|---|
from |
Number | The index of the from node. |
|
to |
Number | The index of the to node. |
|
cost |
Number | 0 | The cost of this edge. |
Extends
Members
-
cost :Number
-
The cost of this edge. This could be for example a distance or time value.
- Overrides:
- Default Value:
- 0
-
from :Number
-
The index of the from node.
- Overrides:
- Default Value:
- -1
-
to :Number
-
The index of the to node.
- Overrides:
- Default Value:
- -1
Methods
-
clone() → {Edge}
-
Creates a new edge and copies all values from this edge.
- Overrides:
-
copy(edge) → {Edge}
-
Copies all values from the given edge to this edge.
Parameters:
Name Type Description edge
Edge The edge to copy.
- Overrides:
-
fromJSON(json) → {Edge}
-
Restores this instance from the given JSON object.
Parameters:
Name Type Description json
Object The JSON object.
- Overrides:
-
toJSON() → {Object}
-
Transforms this instance into a JSON object.
Returns:
Object -The JSON object.
- Overrides: