Repository navigation
Conversation
There was a problem hiding this comment.
Thanks for this! It seems this is mostly about getting rid of createEdgeKey(base, adj, edge, reverse). Apparently we both started in different places: I was trying to get edge states by edge keys and you first tried to replace the edge key usages. So this is nice and when we combine both we are done :) So let's come back here once #2150 is merged?
| int baseNode = getOtherNode(origEdgeId, edge.getAdjNode()); | ||
| return GHUtility.createEdgeKey(baseNode, edge.getAdjNode(), origEdgeId, reverse); | ||
| EdgeIteratorState origEdge = graph.getBaseGraph().getEdgeIteratorState(origEdgeId, edge.getAdjNode()); | ||
| return origEdge.getEdgeKey(reverse); |
There was a problem hiding this comment.
Using getOtherNode is better for performance here, I agree these getTraversalId methods are a bit twisted any hopefully this can be improved.
There was a problem hiding this comment.
Then again we should not need this at all and the edge key should be known already. But then we need to store the first/last orig edge key (not id) for the edge-based CH shortcuts (but maybe this is better anyway...).
| int getEdge(); | ||
|
|
||
| default int getEdgeKey(boolean reverse) { | ||
| return GHUtility.createEdgeKey(getBaseNode(), getAdjNode(), getEdge(), reverse); |
There was a problem hiding this comment.
I if we try to get rid of GHUtility#createEdgeKey(base, adj, edge, reverse) we should probably get rid of TraversalMode#createTraversalId(base, adj, edge, reverse) as well.
This is how far I got. May be of use on its own (?) because I (think I) managed to get rid of one overloaded method in the CH class hierarchy which goes back and forth a lot..
What I did:
getEdgeKey()onEdgeIteratorStateand implement by callingGHUtility.createEdgeKeyGHUtility.createEdgeKeyby that callWhat I would ultimately want to do:
EdgeIteratorState) by the one commented-out there. Because that is the other notion of edge direction that we have, and I only want us to have one (the direction that was used to create the edge):What's the problem:
CHPreparationGraph:Feel free to ignore if not useful.