-
Notifications
You must be signed in to change notification settings - Fork 7
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
refactor: refactor station graph to isolate algorithm, data structure and topological #302
Conversation
issue: #282
Will read it later. Please follow the PR template and always add entry in CHANGELOG-FORK.md. The rules in https://github.com/Telenav/osrm-backend/wiki/CHANGELOG. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll approve the PR first. But please remember to add the entry in CHANGELOG-FORK.md before merge. Also, use Resolves #282
in the PR description can link and close the issue automatically, which reduces your manual work, have a try! :)
duration float64 | ||
} | ||
|
||
type edgeIDAndData struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll prefer to name it edge
. Name the the former edge
to metric
or something like this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good suggestion. Will consider to make the change in the next pull.
func (nc *nodeContainer) getNode(id nodeID) *node { | ||
if n, ok := nc.id2NodePtr[id]; ok { | ||
return n | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefer to remove the else
. See https://github.com/golang/go/wiki/CodeReviewComments#indent-error-flow
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agree.
Issue
#282
Description
Remove
neighbor
innode
, keep connectivity information insidegraph
Abstract the layer of interface
Graph
, make algorithm such asDijkstra
depends on interface onlyAbstract the layer of
connectivitymap.Querier
, which hides the logic for how connectivity is been builtsearch along route charge station query
, user just pass in the connectivity graph of charge stations between low energy pointcharge station based routing
, user just pass in the pre-built connectivity graph between each charge stationsRemove logic of building graph in
stationgraph
, put them inside ofnode_graph
. All connectivity is build on the fly, not like previous version,stationgraph
babysits the creation of graph. The responsibility ofstationgraph
now is calling internal functions to do the work and convert result to certain format.More information could be found here:
osrm-backend/integration/service/oasis/stationgraph/doc.go
Line 1 in 9022026
To to:
connectivitymap.Querier
toconnectivitymap.TopoQuerier
, still consideringlocationinfo
, usenav.location
internal
Tasklist