tyoverby / astar Goto Github PK
View Code? Open in Web Editor NEWDEPRICATED
DEPRICATED
Hi, I'm evaluating pathfinding libraries. I like that this one seems to support caching of path analysis for multiple queries, but I can't figure out how to use the library.
For example, I have no idea what TwoDSearchProblem::get is supposed to return -- the only unit test returns None or Some(0), so I'm not sure what the effect of the u32 is.
Another thing I'd like to know is if there is any support for max distance in pathing. Without it, I believe that infinite loops would be trivial (by trying to path to an inaccessible location). Is there a way to limit the distance of a search?
This could just be a need for documentation, but one of my adjacency functions started with an empty Vec
and pushed new elements as it found them. I spent a chunk of time trying to trace down a segfault bug, because typed-arena
transmuted the memory to extend its lifetime.
I'm still not sure how to avoid segfaults, because it seems that anything that is called as an argument to alloc
cannot grow after initialization. Would it be possible to document the pieces of memory that can't grow, or perhaps there's a better solution where the Rust compiler could check them?
Edit: read the rust-lang community post for the reasons for this crash
Inside of Node, wrap the "state" around a RefCell<Option< >>
so that you can "move" out of it during path construction.
If I understand correctly, ReusableSearchProblem is meant to be usable for several searches with possibly different end nodes, so it doesn't seem to make sense that it can estimate the distance from a given node to the end.
Maybe ReusableSearchProblem should have a method
fn heuristic(&self, &N, &N) -> C
instead that gives a lower bound for the distance between two nodes.
Alternatively, astar_r could take a heuristic function as an argument.
If you agree with either of these, I'm happy to implement it.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.