Skip to main content

A*搜索算法

Project description

  • A*寻路算法 pip install xhAStar

使用方法

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


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.2.tar.gz (3.3 kB view hashes)

Uploaded Source

Built Distribution

xhAStar-0.0.2-py3-none-any.whl (3.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page