Open
Conversation
when many varying path lengths are used, distributes the path finding per iterationsPerCalculation on up to limit paths. when calculate() is called, switch to a solving a different path in the queue instead of solving them sequentially.
Owner
prettymuchbryce
left a comment
There was a problem hiding this comment.
Hey misterhat. Thanks for this contribution. I think it's a nice idea for a feature.
I left a couple of comments. Let me know what you think about my API suggestion.
Would you mind writing a couple of tests as well?
* remove parallelLimit and replace it with binary parallel compute option * added unit tests for serial and parallel path computing
Author
|
Ok I think this is what you asked for? I restored the original bin/* files from the master branch, changed the API + typescript bindings and added unit tests for serial and parallel pathfinding. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
add
.setParallelLimit(limit)when many varying path lengths are used, distributes the path finding per iterationsPerCalculation on up to limit paths. when calculate() is called, switch to a solving a different path in the queue instead of solving them sequentially.
if the parallel limit is 1, easystar acts as it currently does by resolving each path in the order they were submitted. if it's set to 2, it will switch between two path finding instances every
.calculate()call. if -1, switch the path finding instance every time.calculate()is called.it still results in the same total amount of time to calculate the paths, but the load distribution could be useful.
e.g.
with setParallelLimit unset or set to 1, it resolves the long-paths first (at ~400ms each), then the short-paths after ~2 seconds. with setParallelLimit set to -1, it resolves the short-paths from 60-120ms and the long paths after ~2 seconds.
this is useful if you have small paths mixed with large paths, as the small paths can return much quicker even if they were added during the solving of a much larger and slower path.