use of com.graphhopper.routing.util.Bike2WeightFlagEncoder in project graphhopper by graphhopper.
the class FastestWeightingTest method testTime.
@Test
public void testTime() {
FlagEncoder tmpEnc = new Bike2WeightFlagEncoder();
GraphHopperStorage g = new GraphBuilder(EncodingManager.create(tmpEnc)).create();
Weighting w = new FastestWeighting(tmpEnc);
IntsRef edgeFlags = GHUtility.setSpeed(15, 15, tmpEnc, g.getEncodingManager().createEdgeFlags());
tmpEnc.getAverageSpeedEnc().setDecimal(true, edgeFlags, 10.0);
EdgeIteratorState edge = GHUtility.createMockedEdgeIteratorState(100000, edgeFlags);
assertEquals(375 * 60 * 1000, w.calcEdgeMillis(edge, false));
assertEquals(600 * 60 * 1000, w.calcEdgeMillis(edge, true));
g.close();
}
Aggregations