NavEdge(from, to, cost)

Class for representing navigation edges.

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.

Author:

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.

Returns:
Edge -

A new 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.

Returns:
Edge -

A reference to this edge.

Overrides:

fromJSON(json) → {Edge}

Restores this instance from the given JSON object.

Parameters:
Name Type Description
json Object

The JSON object.

Returns:
Edge -

A reference to this edge.

Overrides:

toJSON() → {Object}

Transforms this instance into a JSON object.

Returns:
Object -

The JSON object.

Overrides: