Skip to content

Commit

Permalink
Makes maxVisitedNodes in NodeContractor a local variable.
Browse files Browse the repository at this point in the history
Signed-off-by: ammagamma <contactammagamma@gmail.com>
  • Loading branch information
easbar committed May 9, 2018
1 parent 0a1afb1 commit 3723f06
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ class NodeContractor {
private DijkstraOneToMany prepareAlgo; private DijkstraOneToMany prepareAlgo;
private int addedShortcutsCount; private int addedShortcutsCount;
private long dijkstraCount; private long dijkstraCount;
private int maxVisitedNodes = Integer.MAX_VALUE;
private StopWatch dijkstraSW = new StopWatch(); private StopWatch dijkstraSW = new StopWatch();
private int maxEdgesCount; private int maxEdgesCount;
private int maxLevel; private int maxLevel;
Expand Down Expand Up @@ -117,7 +116,7 @@ private CalcShortcutsResult calcShortcutCount(int node) {
* here the degree is not the total number of adjacent edges, but only the number of incoming edges * here the degree is not the total number of adjacent edges, but only the number of incoming edges
*/ */
private long findShortcuts(ShortcutHandler sch) { private long findShortcuts(ShortcutHandler sch) {
this.maxVisitedNodes = getMaxVisitedNodesEstimate(); int maxVisitedNodes = getMaxVisitedNodesEstimate();
long degree = 0; long degree = 0;
EdgeIterator incomingEdges = vehicleInExplorer.setBaseNode(sch.getNode()); EdgeIterator incomingEdges = vehicleInExplorer.setBaseNode(sch.getNode());
// collect outgoing nodes (goal-nodes) only once // collect outgoing nodes (goal-nodes) only once
Expand Down Expand Up @@ -293,7 +292,7 @@ float getDijkstraSeconds() {
* lead to a slowish or even endless loop. * lead to a slowish or even endless loop.
*/ */
public float calculatePriority(int node) { public float calculatePriority(int node) {
NodeContractor.CalcShortcutsResult calcShortcutsResult = calcShortcutCount(node); CalcShortcutsResult calcShortcutsResult = calcShortcutCount(node);


// # huge influence: the bigger the less shortcuts gets created and the faster is the preparation // # huge influence: the bigger the less shortcuts gets created and the faster is the preparation
// //
Expand Down

0 comments on commit 3723f06

Please sign in to comment.