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

Issues with Path #1

Closed
SimonDarksideJ opened this issue Aug 3, 2017 · 5 comments
Closed

Issues with Path #1

SimonDarksideJ opened this issue Aug 3, 2017 · 5 comments
Assignees
Labels

Comments

@SimonDarksideJ
Copy link

Great library and love the lack of dependencies. However, it doesn't seem to sort on best path, or could just be the viewer maybe?

image

As you can see, it's clearly marking a path which is not "best".

Any thoughts?

@roy-t
Copy link
Owner

roy-t commented Aug 4, 2017

Hey Simon,

Wow that looks extremely wrong. The search time is also huge. I'll try to replicate this problem asap and I'll see if I can fix it!

@roy-t roy-t added the bug label Aug 4, 2017
@roy-t roy-t self-assigned this Aug 4, 2017
@roy-t roy-t closed this as completed in 7968e84 Aug 4, 2017
@roy-t
Copy link
Owner

roy-t commented Aug 4, 2017

I've found the bug and fixed it.
fix

I store the data of the grid in a 1D array, I did not always compute the index into that array correctly (dimx * x + y instead of dimx * y + x) at one place. I've made sure this cannot happen again. I've also tweaked the distance metric. Since the squared Euclidian distance metric I used actually overestimates the cost of getting somewhere. Which also resulted in sometimes slightly sub-optimal paths. I now use the Chebyshev distance metric.

I've uploaded the changes to the repository. I'll publish a new NuGet package at the end of the day, once I'm home. Thanks so much for reporting this problem!

@SimonDarksideJ
Copy link
Author

Thanks for catching it. Will do some more testing
At least it's best to find it early and then double down on Unit Tests :D

@roy-t
Copy link
Owner

roy-t commented Aug 4, 2017

I'll open a new issue for unit tests. Its definitely needed. But I'm having a hard time thinking of where/how to add them.

@roy-t
Copy link
Owner

roy-t commented Aug 4, 2017

The updated nuget package was release and is available at https://www.nuget.org/packages/RoyT.AStar/

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

No branches or pull requests

2 participants