Skip to content
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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

paulrobello
Copy link

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.

@rohan-deshpande
Copy link

rohan-deshpande commented May 13, 2016

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 pathTests you have a property useCost: true on the AStar Cost test for instance, is this just for the testing purposes or do we need to set this in the algorithm constructor options?

@paulrobello
Copy link
Author

@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.

@mx781
Copy link

mx781 commented Mar 13, 2017

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: new pf.Grid(map, 0, 0, costs);

Or maybe this would be fine with appropriate documentation.

@rohan-deshpande
Copy link

rohan-deshpande commented Aug 29, 2017

@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

@simus100
Copy link

simus100 commented Apr 5, 2018

Hi,
What is the syntax for setting the cost of console nodes?
thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants