Skip to content

Commit

Permalink
Does some clean-up.
Browse files Browse the repository at this point in the history
Signed-off-by: ammagamma <contactammagamma@gmail.com>
  • Loading branch information
easbar committed May 17, 2018
1 parent 298d969 commit 21b7870
Show file tree
Hide file tree
Showing 6 changed files with 191 additions and 442 deletions.
Expand Up @@ -77,15 +77,12 @@ public class EdgeBasedNodeContractor extends AbstractNodeContractor {
private int numPolledEdges; private int numPolledEdges;
private int numSearches; private int numSearches;


private final PMap options;

public EdgeBasedNodeContractor(Directory dir, GraphHopperStorage ghStorage, CHGraph prepareGraph, public EdgeBasedNodeContractor(Directory dir, GraphHopperStorage ghStorage, CHGraph prepareGraph,
TurnWeighting turnWeighting, PMap options) { TurnWeighting turnWeighting, PMap options) {
super(dir, ghStorage, prepareGraph, turnWeighting); super(dir, ghStorage, prepareGraph, turnWeighting);
this.turnWeighting = turnWeighting; this.turnWeighting = turnWeighting;
this.encoder = turnWeighting.getFlagEncoder(); this.encoder = turnWeighting.getFlagEncoder();
this.witnessSearchStrategy = new TurnReplacementSearch(); this.witnessSearchStrategy = new TurnReplacementSearch();
this.options = options;
} }


@Override @Override
Expand All @@ -95,9 +92,8 @@ public void initFromGraph() {
legacyWitnessPathFinder = arrayBasedWitnessPathFinder ? legacyWitnessPathFinder = arrayBasedWitnessPathFinder ?
new ArrayBasedLegacyWitnessPathFinder(prepareGraph, turnWeighting, TraversalMode.EDGE_BASED_2DIR, maxLevel) : new ArrayBasedLegacyWitnessPathFinder(prepareGraph, turnWeighting, TraversalMode.EDGE_BASED_2DIR, maxLevel) :
new MapBasedLegacyWitnessPathFinder(prepareGraph, turnWeighting, TraversalMode.EDGE_BASED_2DIR, maxLevel); new MapBasedLegacyWitnessPathFinder(prepareGraph, turnWeighting, TraversalMode.EDGE_BASED_2DIR, maxLevel);
witnessPathSearcher = arrayBasedWitnessPathFinder ? WitnessPathSearcher.Config config = new WitnessPathSearcher.Config();
new WitnessPathSearcher(ghStorage, prepareGraph, turnWeighting, options) : witnessPathSearcher = new WitnessPathSearcher(ghStorage, prepareGraph, turnWeighting, config);
new MapWitnessPathSearcher(ghStorage, prepareGraph, turnWeighting, options);
DefaultEdgeFilter inEdgeFilter = new DefaultEdgeFilter(encoder, true, false); DefaultEdgeFilter inEdgeFilter = new DefaultEdgeFilter(encoder, true, false);
DefaultEdgeFilter outEdgeFilter = new DefaultEdgeFilter(encoder, false, true); DefaultEdgeFilter outEdgeFilter = new DefaultEdgeFilter(encoder, false, true);
inEdgeExplorer = prepareGraph.createEdgeExplorer(inEdgeFilter); inEdgeExplorer = prepareGraph.createEdgeExplorer(inEdgeFilter);
Expand Down Expand Up @@ -547,7 +543,7 @@ public String getStatisticsString() {
String result = String.format("searches: %10s, polled-edges: %10s, stats(calc): %s, stats(contract): %s, %s", String result = String.format("searches: %10s, polled-edges: %10s, stats(calc): %s, stats(contract): %s, %s",
nf(totalNumSearches), nf(totalNumPolledEdges), nf(totalNumSearches), nf(totalNumPolledEdges),
countingShortcutHandler.getStats(), addingShortcutHandler.getStats(), countingShortcutHandler.getStats(), addingShortcutHandler.getStats(),
searchType == SearchType.AGGRESSIVE ? witnessPathSearcher.getStatusString() : legacyWitnessPathFinder.getStatusString()); searchType == SearchType.AGGRESSIVE ? witnessPathSearcher.getStatisticsString() : legacyWitnessPathFinder.getStatusString());
countingShortcutHandler.resetStats(); countingShortcutHandler.resetStats();
addingShortcutHandler.resetStats(); addingShortcutHandler.resetStats();
legacyWitnessPathFinder.resetStats(); legacyWitnessPathFinder.resetStats();
Expand Down

This file was deleted.

Expand Up @@ -28,7 +28,7 @@ class OnFlyStatisticsCalculator {
private double mean; private double mean;
private double varianceHelper; private double varianceHelper;


void addObservation(int value) { void addObservation(long value) {
count++; count++;
double delta = value - mean; double delta = value - mean;
mean += delta / count; mean += delta / count;
Expand Down

0 comments on commit 21b7870

Please sign in to comment.