A toy module to generate a map and find the shortest path from two points on the map
Project description
kiri-pathfinding
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
The image above visualizes the generated map and the found path from point (0, 0) to point (19, 19). The different colors on the map mean different terrains. The green means glass and others mean barriers with additional costs to pass.
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
kiri_pathfinding-1.1.0.tar.gz
(5.9 kB
view hashes)
Built Distribution
Close
Hashes for kiri_pathfinding-1.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b5e75f6b62096b6d739d5ef6f8ed5cae92ab8eec5ef7f1a6b84d4d0bd061d8f0 |
|
MD5 | 44876e790a243f4f700189eee9fbf05d |
|
BLAKE2b-256 | f0a90fcbaf02b037e80b7502fcaad566fa38b4c2c5b1621525514b392c92b04c |