A*搜索算法
Project description
- A*寻路算法
使用方法
import astar
w, h = 6, 3
start, goal = (0, 0), (3, 2)
walls = [(2, 1), (3, 1), (4, 1)]
obj = astar.AStar(w, h, start, goal, walls, astar.MANHATTAN)
print(obj.result)
AStar参数说明
- w (int): 长
- h (int): 宽
- start (Tuple[int, int]): 起始点
- goal (Tuple[int, int]): 终点
- walls (List[Tuple[int, int]]): 墙壁坐标列表
- type (int, optional): 寻路类型. 默认为曼哈顿寻路 MANHATTAN.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
xhAStar-0.0.1.tar.gz
(3.1 kB
view hashes)