andrewrk / andrewrk/node-astar

document impassability

Open
#10 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
69
Forks
18
PR merge metrics
No merged PRs in 30d

Description

Describe in the API docs how to use the options to make a node impassable.

Consider this grid:

```
┌───┐
│ A │
├───┤
│ │
├───┤
│ B │
└───┘
```

Where:
- empty cells should be impassable -- walls, mountains, lava, force-field, whatever
- the caller wants to ask for a path from cell `A` to cell `B`, which ought to be impossible

It appears this cannot be accomplished by the `distance` function, e.g. by returning `Number.POSITIVE_INFINITY` as the cost for entering an impassable node. Instead, it seems like the `neighbor` function must choose to omit nodes which should be treated as impassable.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.