Module jumper.core.path
The path
class.
The `path` class represents a path from a `start` location to a `goal`. An instance from this class would be a result of a request addressed to `pathfinder:getPath`. A `path` is basically a set of `nodes`, aligned in a specific order, defining a way to follow for moving agents.
Info:
- Copyright: 2012-2013
- License: MIT
- Author: Roland Yonaba
Functions
new () | Inits a new `path` object. |
iter () | Iterates on each single `node` along a `path`. |
nodes () | Iterates on each single `node` along a `path`. |
getLength () | Evaluates the `path` length |
fill () | Path filling function. |
filter () | Path compression. |
Tables
path | The `path` class |
Functions
- new ()
-
Inits a new `path` object.
Returns:
-
path
a `path` object
- iter ()
-
Iterates on each single `node` along a `path`. At each step of iteration,
returns a `node` and plus a count value. Aliased as path:nodes
Returns:
- node a `node`
- int the count for the number of nodes
See also:
- nodes ()
-
Iterates on each single `node` along a `path`. At each step of iteration,
returns a `node` and plus a count value. Aliased for path:iter
Returns:
- node a `node`
- int the count for the number of nodes
See also:
- getLength ()
-
Evaluates the `path` length
Returns:
-
number
the `path` length
- fill ()
-
Path filling function. Interpolates between non contiguous locations along a `path`
to build a fully continuous `path`. This maybe useful when using `Jump Point Search` finder.
Does the opposite of path:filter
See also:
- filter ()
-
Path compression. Given a `path`, eliminates useless nodes to return a lighter `path`. Does
the opposite of path:fill
See also: