Skip to main content

A toy module to generate a map and find the shortest path from two points on the map

Project description

kiri-pathfinding

PythonVersion PyPi

A toy module to generate a map and find the shortest path from two points on the map

Usage

from matplotlib import pyplot as plt
from kiri_pathfinding.map_generator import generate_map, draw_map
from kiri_pathfinding.pathfinding import PathFinding, draw_path

# genetate a map and find shortest path
data_map = generate_map(20, 20)
pathfinding = PathFinding(data_map)
path = pathfinding.find((0, 0), (19, 19))

# visualize
fig, ax = plt.subplots()
draw_map(data_map, ax)
draw_path(path, ax)

Example

example

The image above visualizes the generated map and the found path from point (0, 0) to point (19, 19).

Different colors on the map mean different terrains. Specifically, the green is grassland and the gray means roads, providing a lower movement cost. The brown and blue denote mud and river respectively, which are harder to pass.

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

kiri_pathfinding-1.2.0.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kiri_pathfinding-1.2.0-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file kiri_pathfinding-1.2.0.tar.gz.

File metadata

  • Download URL: kiri_pathfinding-1.2.0.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.2 CPython/3.10.8 Linux/5.15.0-1022-azure

File hashes

Hashes for kiri_pathfinding-1.2.0.tar.gz
Algorithm Hash digest
SHA256 79b5e361be9052adc9a6a794684649b8308c26a2b24a6955ae77d5a4980e332f
MD5 410641bb09e67468c7a059d2c75cae01
BLAKE2b-256 bae729e97fcc9a569a2b36b2d513cf784d09f44b05752e421dc36399a87ab46f

See more details on using hashes here.

File details

Details for the file kiri_pathfinding-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: kiri_pathfinding-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 7.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.2 CPython/3.10.8 Linux/5.15.0-1022-azure

File hashes

Hashes for kiri_pathfinding-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b8f11e2b0601daf2831f35fa415f47772297f08fb07a1d228840a3bff0b38f41
MD5 33bf828bd0b041f017acca8470666142
BLAKE2b-256 877b2bd76a1627eff324fac54d444a7ba5411bf02d6a6ee862d14463e0c00169

See more details on using hashes here.

Supported by

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