Skip to content

Feature maximum visited nodes - #681

Merged
karussell merged 1 commit into
graphhopper:masterfrom
boldtrn:feature_maximum_visited_nodes
Mar 10, 2016
Merged

karussell merged 1 commit into
graphhopper:masterfrom
boldtrn:feature_maximum_visited_nodes

Conversation

@boldtrn

@boldtrn boldtrn commented Mar 9, 2016

Copy link
Copy Markdown
Member

This PR contains the ability to limit the number of visitedNodes that a non-ch RoutingAlgorithm visits.

This can be specified in the config and via an URL parameter.

Fixes #473 and therefor #104

@boldtrn

boldtrn commented Mar 9, 2016

Copy link
Copy Markdown
Member Author

@karussell I think we have an issue with our current travis configuration. I forgot to run the whole test-suite before pushing and it failed for me locally. Since the js tests succeed, travis seems to think that all tests succeed. Btw, I am currently fixing the issues ;).

@boldtrn

boldtrn commented Mar 9, 2016

Copy link
Copy Markdown
Member Author

Ok. PR should be fine. What do you think?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here is a minor mistake

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but not important to add a test as we have your nice PR soon and throw this away :)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yes, we can actually delete the isMaxVisitedNodesExceeded method, since it is not used here. We delegate the maxVisitedNodes to the Dijkstra and the Dijkstra cares about the maxVisistedNodes.

@karussell

Copy link
Copy Markdown
Member

Thanks - looks really good!

I think we have an issue with our current travis configuration. I forgot to run the
whole test-suite before pushing and it failed for me locally. Since the js tests succeed,
travis seems to think that all tests succeed.

Do you mean that although tests are failing locally, travis is fine with it because only the JS tests are passing?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here the parameter shouldn't be plain "max_visited_nodes" ?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

problem is that we are very inconsistent with this and it has a reason: from URL or JS one expects some_thing from within Java one expects someThing. What we could do is internally convert all someThing into some_thing or migrate all remaining someThing to my preferred naming some_thing "somehow"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes we can change the name in both cases (config and url) so we do not have the routing. in front. I thought it would be better understandable since the number of parameters is growing.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The routing in front is good as indeed the count is growing. Also please for now use someThing notation - I've created #682 to make everything more consistent or to be able to use both.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, so I shall use camel case in the url, as well?

@boldtrn

boldtrn commented Mar 9, 2016

Copy link
Copy Markdown
Member Author

Do you mean that although tests are failing locally, travis is fine with it because only the JS tests are passing?

Yes, have a look at this test. It fails but travis does not fail https://travis-ci.org/graphhopper/graphhopper/jobs/114835803#L1152

@karussell

Copy link
Copy Markdown
Member

Yes, have a look at this test.

Outch - ugly! Thanks for finding this!

@boldtrn

boldtrn commented Mar 10, 2016

Copy link
Copy Markdown
Member Author

Ok, I updated my branch. I renamed the URL parameter using camelCase.

@karussell

Copy link
Copy Markdown
Member

Thanks a lot! One minor in the exception -> routing.max_visited_nodes. Would you also squash the commits into one?

@boldtrn
boldtrn force-pushed the feature_maximum_visited_nodes branch from a90fe6a to 7046e05 Compare March 10, 2016 09:29
Fixed some formatting issues

Added security catch if URL parameter contains values greater than the configured

Fixed failing Tests

Updated according to comments

Updated according to comments

Update
@boldtrn
boldtrn force-pushed the feature_maximum_visited_nodes branch from 7046e05 to c5b6b7f Compare March 10, 2016 09:33
@boldtrn

boldtrn commented Mar 10, 2016

Copy link
Copy Markdown
Member Author

Squashed it

karussell added a commit that referenced this pull request Mar 10, 2016
Limit search via maximum visited nodes. Fixes #473
@karussell
karussell merged commit 2b34274 into graphhopper:master Mar 10, 2016
@karussell

Copy link
Copy Markdown
Member

Thanks - merged!

@karussell karussell added this to the 0.7 milestone Mar 10, 2016
@boldtrn
boldtrn deleted the feature_maximum_visited_nodes branch October 6, 2017 01:14
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.

3 participants