dev1an / a-star Goto Github PK
View Code? Open in Web Editor NEWA* pathfinding library in Swift.
License: MIT License
A* pathfinding library in Swift.
License: MIT License
So the doc comments on the cost don’t make it clear that it is only called on adjacent nodes (and I’m mostly guessing this is true). It is probably important to note because local costs can be easy to do exactly, but it can be much harder to do no -local costs!
So it would be nice if cost noted it only is passed adjacent nodes, and estimatedCost notes it can be asked to estimate a cost to any node.
☝️
Hello Sorry, for saying this as an issue, but didn't know how tot talk to you, I don't know how to run and test your code, I have dowloaded it, open it on Xcode and click play, but it doesn't open anything(I have iOs experience, but never scene a Xcode project that builds to My Mac )
Just watched this
https://youtu.be/gGQ-vAmdAOI?t=171
was thinking of extending some of the classes to handle other use cases.
I used A-Star to write a "Hitman Go" level solver:
https://jackpal.github.io/2022/04/29/A_Solver_for_Hitman_Go_Levels.html
A-Star worked well for me. Thanks for providing it!
However, I ran into an issue when writing unit tests: For many game levels, the path returned by findPath varies from run to run of the test. For example a diagonal path on a 2D grid might return North, East on one run, and East, North on the next run.
After thinking about it, I think the reason for this variation is that the GraphNode nodesAdjacent func returns a Set rather than a NSOrderedSet. Set doesn't guarantee an iteration order for its elements. So I think even though my app always inserts nodes into the set the same order, when A-Star iterates over the set of elements, it will iterate over them in random order.
It would be better (in terms of being able to reproduce results) if GraphNode nodesAdjacent either returned a NSOrderedSet, or even just a plain Array.
(I think I can work around the issue by slightly biasing my edge weights in a checkerboard pattern, but it seems like the problem will hit other users too, so you might want to fix 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.