Jump Point Search Implementation for Path Finding, in Rust

Related tags

Command-line jps
Overview

jps : Jump Point Search in Rust.

Jump Point Search Algorithm Implementation in Rust.

Current implementation status

JPS Implementation

  • 3D case

Lifetime

Currently no lifetime notation is used, and hence a few unnecessary copies have to be performed. Lifetime is needed to be considered for improving the speed/efficiency.

Usage

Add this to your Cargo.toml:

[dependencies]
jps = "1.0"

Two steps to use JPS:

  1. create a GraphSearch using either new_v1 or new_v2
  2. call plan_main to plan a path from start to goal.
/* using HashMap as the map input.
`fmap` can be `None` such that a grid will be regarded as free as long as it is not occupied and is within the legal boxed-boundary. */
GraphSearch::new_v1(
        fmap_: Option<HashSet<(i32, i32, i32)>>,
        omap_: HashSet<(i32, i32, i32)>,
        xdim: i32,
        ydim: i32,
        zdim: i32,
        eps_: f32,
    )-> Self

/* using a binary map as the map input */
GraphSearch::new_v2(
        map: &[bool],
        xdim: i32,
        ydim: i32,
        zdim: i32,
        eps_: f32,
        // goal: (i32, i32, i32),
        // use_jps_: bool,
    ) -> Self

/* path-finding */
plan_main(
        &mut self,
        start: (i32, i32, i32),
        goal: (i32, i32, i32),
        usejps: bool,
        max_expand: i32,
    ) -> bool

Example & Test

cargo test -- --show-output

the output shows:

path is :
(0, 0, 0) ➡ (0, 1, 0)➡ (0, 2, 0)➡ (0, 3, 0)➡ (1, 4, 1)➡ (2, 4, 1)➡ (3, 4, 1)➡ (4, 3, 2)➡ (4, 2, 2)➡ (4, 1, 2)➡ (3, 0, 3)➡ (2, 1, 4)➡ (2, 2, 4)➡ (3, 3, 4)➡ (4, 4, 4)
turnings are :
(0, 0, 0) (0, 3, 0) (1, 4, 1) (3, 4, 1) (4, 3, 2) (4, 1, 2) (3, 0, 3) (2, 1, 4) (2, 2, 4) (4, 4, 4)

Reference

Logic follows the C++ version (https://github.com/KumarRobotics/jps3d)

Also NOTE that some functions havn't been thoroughly tested, so please let me know if there is any error.

You might also like...
A path-normalization pentesting tool.

pathbuster A path-normalization pentesting tool Todos • Installation • Usage • Examples • Contributing • License • Join Discord Todos Implement --filt

lace up GFA files using panSN path name sub-ranges to coordinate the lacing

gfalace gfalace is a Rust-based tool designed to process a collection of GFA (Graphical Fragment Assembly) files. It aims to interpret the path names

🔭 Search Dash.app from Neovim with Telescope. Built with Rust 🦀 and Lua
🔭 Search Dash.app from Neovim with Telescope. Built with Rust 🦀 and Lua

Dash.nvim Query Dash.app within Neovim with a Telescope picker! The theme used in the recording is lighthaus.nvim. Note: Dash is a Mac-only app, so yo

CLI search and replace | Space Age seD
CLI search and replace | Space Age seD

SAD! Space Age seD What does it do? Basically sad is a Batch File Edit tool. It will show you a really nice diff of proposed changes before you commit

Like grep, but uses tree-sitter grammars to search

tree-grepper Works like grep, but uses tree-sitter to search for structure instead of strings. Installing This isn't available packaged anywhere. That

full text search manpages

buke full text search manpages cargo run --release -- --build builds an sqlite3 database out of all manpages in your $MANPATH cargo run --release -- "

Search PyPI for packages from the command line.
Search PyPI for packages from the command line.

PPS -- Python Package Index Search Search the PyPI for packages by name, which was done by pip search in the past. This was heavily inspired by pip_se

Grep with human-friendly search output
Grep with human-friendly search output

hgrep: Human-friendly GREP hgrep is a grep tool to search files with given pattern and print the matched code snippets with human-friendly syntax high

fas stand for Find all stuff and it's a go app that simplify the find command and allow you to easily search everything you nedd
fas stand for Find all stuff and it's a go app that simplify the find command and allow you to easily search everything you nedd

fas fas stands for Find all stuff and it's a rust app that simplify the find command and allow you to easily search everything you need. Note: current

Owner
null
Pathfinding on grids using jumping point search and connected components.

grid_pathfinding A grid-based pathfinding system. Implements Jump Point Search with improved pruning rules for speedy pathfinding. Pre-computes connec

Thom van der Woude 16 Dec 12, 2022
Jumpy is a tool that allows to quickly jump to one of the directory you've visited in the past

Jumpy Jumpy is a tool that allows to quickly jump to one of the directory you've visited in the past. It is heavily inspired by Zoxide but is more lig

Clément Nerma 2 Oct 3, 2022
A small unix and windows lib to search for executables in PATH folders.

A small unix and windows lib to search for executables in path folders.

Robiot 2 Dec 25, 2021
lsp server for finding ES statements that throw!

Well, Does it Throw? TLDR; This is a blazingly fast lsp server to find throw statements in your javascript code. It's written in Rust and based on SWC

Michael Angelo Rivera 11 Nov 13, 2023
Multiple precision floating point numbers implemented purely in Rust.

Multiple precision floating point numbers implemented purely in Rust. Rationale There are several notable implementations of numbers with increased pr

null 11 Nov 23, 2022
Wena is a micro-framework that provides an elegant starting point for your console application.

Wena was created by Nuno Maduro, and is a Rust Lang micro-framework that provides an elegant starting point for your console application. This project

null 251 Dec 11, 2022
A GPT-3 access point through Nostr, powered by lightning

Geppeto A Nostr based API for GPT-3, powered on Lightning. The bot listens for event kind 29000 (inspired by NIP-9000) and will query the prompt to th

null 5 May 24, 2023
Add path effects to open glyphs in a UFO file

ufostroker Add path effects to open contours in a UFO file Given a glyph with open contours: You can apply a noodle effect: ufostroker -i Open.ufo -o

Simon Cozens 5 Jun 28, 2021
A command-line tool aiming to upload the local image used in your markdown file to the GitHub repo and replace the local file path with the returned URL.

Pup A command line tool aiming to upload the local image used in your markdown file to the GitHub repo and replace the local file path with the return

SteveLau 11 Aug 17, 2022
Generate commands that add node_modules/.bin to PATH

npx-bin-helper Generate commands that add node_modules/.bin to PATH. Supports Linux, MacOS and Windows. Installation cargo install npx-bin-helper Usag

Yumeoto Zorin 2 Nov 11, 2022