-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added support for non uniform node cost #100
base: master
Are you sure you want to change the base?
Conversation
Added Grid.prototype.getCostAt Added Grid.prototype.setCostAt Updated Grid.prototype.clone to also clone node cost
Just a question about this great PR, do you need to tell the algorithms to look for cost or does it just happen? Just looking at your |
@rohan-deshpande the useCost is only used for tests, the additions I made will use the costs if they are provided to the constructor otherwise it just falls back to the normal equal cost routing. |
I tried this PR in your fork, and it could benefit from some adjustments in the Grid constructor arguments. Since it was originally designed for different argument types, you now have to pass dummy arguments for the height and width params: Or maybe this would be fine with appropriate documentation. |
@qiao Any reason why this can't get merged? I've been using the fork for a while now and would like to be able to go back to the main branch |
Hi, |
Added optional cost member to Node which will then be used by AStarFinder and DijkstraFinder.
Updated Grid with extra cost related functions and optional initialization of cost values.
I have also added test cases for added cost to nodes.
No changes to base API. If cost related data is omitted all will function exactly the same.