use of com.graphhopper.routing.ev.BooleanEncodedValue in project graphhopper by graphhopper.
the class GraphHopperMultimodalIT method testSubnetworkRemoval.
@Test
public void testSubnetworkRemoval() {
Profile foot = graphHopperGtfs.getProfile("foot");
BooleanEncodedValue footSub = graphHopperGtfs.getEncodingManager().getBooleanEncodedValue(Subnetwork.key(foot.getName()));
// Go through all edges on removed foot subnetworks, and check that we can get to our destination station from there
List<GHResponse> responses = new ArrayList<>();
AllEdgesIterator edges = graphHopperGtfs.getGraphHopperStorage().getAllEdges();
while (edges.next()) {
if (edges.get(footSub)) {
Request ghRequest = new Request(Arrays.asList(new GHPointLocation(new GHPoint(graphHopperGtfs.getGraphHopperStorage().getNodeAccess().getLat(edges.getBaseNode()), graphHopperGtfs.getGraphHopperStorage().getNodeAccess().getLon(edges.getBaseNode()))), new GHStationLocation("EMSI")), LocalDateTime.of(2007, 1, 1, 6, 40, 0).atZone(zoneId).toInstant());
// Yes, I can walk very fast, 50 km/h. Problem?
ghRequest.setWalkSpeedKmH(50);
// But I dislike walking a lot.
ghRequest.setBetaStreetTime(20);
GHResponse response = graphHopper.route(ghRequest);
responses.add(response);
}
}
// There is a removed subnetwork -- otherwise there's nothing to check
assumeThat(responses).isNotEmpty();
assertThat(responses).allMatch(r -> !r.getAll().isEmpty());
}
Aggregations