From 875b8e5ebab3aed7bcf9eebd1bb9318a9c2951c6 Mon Sep 17 00:00:00 2001 From: Marko Burjek Date: Wed, 5 Jul 2017 14:10:12 +0200 Subject: [PATCH] ReverseSearch field is now on StreetRouter Instead of ProfileRequest --- .../com/conveyal/r5/api/ProfileResponse.java | 12 +-- .../PointToPointRouterServer.java | 9 ++- .../builder/PointToPointQuery.java | 7 +- .../conveyal/r5/profile/ProfileRequest.java | 7 -- .../com/conveyal/r5/streets/EdgeStore.java | 12 +-- .../com/conveyal/r5/streets/StreetRouter.java | 25 ++++--- .../r5/streets/ReverseRoutingTest.java | 4 +- .../r5/streets/TurnRestrictionTest.java | 74 +++++++++---------- 8 files changed, 71 insertions(+), 79 deletions(-) diff --git a/src/main/java/com/conveyal/r5/api/ProfileResponse.java b/src/main/java/com/conveyal/r5/api/ProfileResponse.java index 5cbb9e51c..3df5c4517 100644 --- a/src/main/java/com/conveyal/r5/api/ProfileResponse.java +++ b/src/main/java/com/conveyal/r5/api/ProfileResponse.java @@ -93,8 +93,6 @@ public void addTransitPath(Map accessRouter, if (accessPathIndex < 0) { //Here accessRouter needs to have this access mode since stopModeAccessMap is filled from accessRouter StreetRouter streetRouter = accessRouter.get(accessMode); - //FIXME: Must we really update this on every streetrouter? - streetRouter.profileRequest.reverseSearch = false; StreetRouter.State state = streetRouter.getStateAtVertex(startVertexStopIndex); if (state != null) { StreetPath streetPath; @@ -102,7 +100,7 @@ public void addTransitPath(Map accessRouter, streetPath = new StreetPath(state, streetRouter, accessMode, transportNetwork); } else { - streetPath = new StreetPath(state, transportNetwork, false); + streetPath = new StreetPath(state, transportNetwork, streetRouter.reverseSearch); //reverse search is false } StreetSegment streetSegment = new StreetSegment(streetPath, accessMode, transportNetwork.streetLayer); profileOption.addAccess(streetSegment, accessMode, startVertexStopIndex); @@ -122,11 +120,9 @@ public void addTransitPath(Map accessRouter, if (egressPathIndex < 0) { //Here egressRouter needs to have this egress mode since stopModeEgressMap is filled from egressRouter StreetRouter streetRouter = egressRouter.get(egressMode); - //FIXME: Must we really update this on every streetrouter? - streetRouter.profileRequest.reverseSearch = true; StreetRouter.State state = streetRouter.getStateAtVertex(endVertexStopIndex); if (state != null) { - StreetPath streetPath = new StreetPath(state, transportNetwork, true); + StreetPath streetPath = new StreetPath(state, transportNetwork, streetRouter.reverseSearch); // reverse search is true StreetSegment streetSegment = new StreetSegment(streetPath, egressMode, transportNetwork.streetLayer); profileOption.addEgress(streetSegment, egressMode, endVertexStopIndex); //This should never happen since stopModeEgressMap is filled from reached stops in egressRouter @@ -180,10 +176,9 @@ public void generateStreetTransfers(TransportNetwork transportNetwork, ProfileRe Map> transfersWithSameStart = transferToOption.keySet().stream() .collect(Collectors.groupingBy(Transfer::getAlightStop)); //LOG.info("Filling middle paths"); - boolean prevReverseSearch = request.reverseSearch; - request.reverseSearch = false; for (Map.Entry> entry: transfersWithSameStart.entrySet()) { StreetRouter streetRouter = new StreetRouter(transportNetwork.streetLayer); + //reverse search is false streetRouter.streetMode = StreetMode.WALK; streetRouter.profileRequest = request; //TODO: make configurable distanceLimitMeters in middle @@ -207,7 +202,6 @@ public void generateStreetTransfers(TransportNetwork transportNetwork, ProfileRe } } } - request.reverseSearch = prevReverseSearch; } /** Recompute stats for all options, should be done once all options have been added */ diff --git a/src/main/java/com/conveyal/r5/point_to_point/PointToPointRouterServer.java b/src/main/java/com/conveyal/r5/point_to_point/PointToPointRouterServer.java index 810523793..5e559c5c6 100644 --- a/src/main/java/com/conveyal/r5/point_to_point/PointToPointRouterServer.java +++ b/src/main/java/com/conveyal/r5/point_to_point/PointToPointRouterServer.java @@ -359,9 +359,10 @@ private static void run(TransportNetwork transportNetwork) { } ProfileRequest profileRequest = new ProfileRequest(); - Boolean reverseSearch = request.queryMap("reverse").booleanValue(); - if (reverseSearch != null && reverseSearch) { - profileRequest.reverseSearch = true; + Boolean reverseSearchB = request.queryMap("reverse").booleanValue(); + boolean reverseSearch = false; + if (reverseSearchB != null && reverseSearchB) { + reverseSearch = true; } profileRequest.zoneId = transportNetwork.getTimeZone(); profileRequest.fromLat = fromLat; @@ -410,7 +411,7 @@ private static void run(TransportNetwork transportNetwork) { featureCollection.put("type", "FeatureCollection"); List features = new ArrayList<>(); - fillFeature(transportNetwork, lastState, features, profileRequest.reverseSearch); + fillFeature(transportNetwork, lastState, features, reverseSearch); featureCollection.put("features", features); content.put("data", featureCollection); } else { diff --git a/src/main/java/com/conveyal/r5/point_to_point/builder/PointToPointQuery.java b/src/main/java/com/conveyal/r5/point_to_point/builder/PointToPointQuery.java index b731ea240..6c4576bd0 100644 --- a/src/main/java/com/conveyal/r5/point_to_point/builder/PointToPointQuery.java +++ b/src/main/java/com/conveyal/r5/point_to_point/builder/PointToPointQuery.java @@ -199,10 +199,9 @@ public ProfileResponse getPlan(ProfileRequest request) { private Map findEgressPaths(ProfileRequest request) { Map egressRouter = new HashMap<>(); //For egress - //TODO: this must be reverse search - request.reverseSearch = true; for(LegMode mode: request.egressModes) { StreetRouter streetRouter = new StreetRouter(transportNetwork.streetLayer); + streetRouter.reverseSearch = true; streetRouter.transitStopSearch = true; streetRouter.quantityToMinimize = StreetRouter.State.RoutingVariable.DURATION_SECONDS; if (egressUnsupportedModes.contains(mode)) { @@ -232,10 +231,10 @@ private Map findEgressPaths(ProfileRequest request) { * @param option */ private void findDirectPaths(ProfileRequest request, ProfileOption option) { - request.reverseSearch = false; //For direct modes for(LegMode mode: request.directModes) { StreetRouter streetRouter = new StreetRouter(transportNetwork.streetLayer); + //reverse search is false StreetPath streetPath; streetRouter.profileRequest = request; if (mode == LegMode.BICYCLE_RENT) { @@ -289,10 +288,10 @@ private void findDirectPaths(ProfileRequest request, ProfileOption option) { * @param request */ private HashMap findAccessPaths(ProfileRequest request) { - request.reverseSearch = false; // Routes all access modes HashMap accessRouter = new HashMap<>(); for(LegMode mode: request.accessModes) { + //reverse search is false StreetRouter streetRouter = new StreetRouter(transportNetwork.streetLayer); streetRouter.profileRequest = request; if (mode == LegMode.CAR_PARK) { diff --git a/src/main/java/com/conveyal/r5/profile/ProfileRequest.java b/src/main/java/com/conveyal/r5/profile/ProfileRequest.java index c516ea72d..142b39fec 100644 --- a/src/main/java/com/conveyal/r5/profile/ProfileRequest.java +++ b/src/main/java/com/conveyal/r5/profile/ProfileRequest.java @@ -168,13 +168,6 @@ public class ProfileRequest implements Serializable, Cloneable { /** Whether this is a depart-after or arrive-by search */ private SearchType searchType; - /** - * If true current search is reverse search AKA we are looking for a path from destination to origin in reverse - * It differs from searchType because it is used as egress search - */ - @JsonInclude(JsonInclude.Include.NON_DEFAULT) - public boolean reverseSearch = false; - /** * Maximum fare for constraining monetary cost of paths during search in Analysis. * If nonnegative, fares will be used in routing. diff --git a/src/main/java/com/conveyal/r5/streets/EdgeStore.java b/src/main/java/com/conveyal/r5/streets/EdgeStore.java index e6d8139d6..161944447 100644 --- a/src/main/java/com/conveyal/r5/streets/EdgeStore.java +++ b/src/main/java/com/conveyal/r5/streets/EdgeStore.java @@ -552,12 +552,12 @@ public float calculateSpeed(ProfileRequest options, StreetMode traverseStreetMod return options.getSpeedForMode(traverseStreetMode); } - public StreetRouter.State traverse (StreetRouter.State s0, StreetMode streetMode, ProfileRequest req, - TurnCostCalculator turnCostCalculator) { + public StreetRouter.State traverse(StreetRouter.State s0, StreetMode streetMode, + ProfileRequest req, TurnCostCalculator turnCostCalculator, boolean reverseSearch) { // The vertex we'll be at after the traversal int vertex; - if (req.reverseSearch) { + if (reverseSearch) { vertex = getFromVertex(); } else { vertex = getToVertex(); @@ -568,14 +568,14 @@ public StreetRouter.State traverse (StreetRouter.State s0, StreetMode streetMode float time = (float) (getLengthM() / speedms); float weight = 0; - if (!canTurnFrom(s0, s1, req.reverseSearch)) return null; + if (!canTurnFrom(s0, s1, reverseSearch)) return null; // clear out turn restrictions if they're empty if (s1.turnRestrictions != null && s1.turnRestrictions.isEmpty()) s1.turnRestrictions = null; // figure out which turn res - startTurnRestriction(s0.streetMode, req.reverseSearch, s1); + startTurnRestriction(s0.streetMode, reverseSearch, s1); //We allow two links in a row if this is a first state (negative back edge or no backState //Since at least P+R stations are connected to graph with only LINK edges and otherwise search doesn't work @@ -644,7 +644,7 @@ public StreetRouter.State traverse (StreetRouter.State s0, StreetMode streetMode // Negative backEdge means this state is not the result of traversing an edge (it's the start of a search). int turnCost = 0; if (s0.backEdge >= 0) { - if (req.reverseSearch) { + if (reverseSearch) { turnCost = turnCostCalculator.computeTurnCost(getEdgeIndex(), s0.backEdge, streetMode); } else { turnCost = turnCostCalculator.computeTurnCost(s0.backEdge, getEdgeIndex(), streetMode); diff --git a/src/main/java/com/conveyal/r5/streets/StreetRouter.java b/src/main/java/com/conveyal/r5/streets/StreetRouter.java index 6c0c6baac..bfcedafc7 100644 --- a/src/main/java/com/conveyal/r5/streets/StreetRouter.java +++ b/src/main/java/com/conveyal/r5/streets/StreetRouter.java @@ -71,6 +71,11 @@ public class StreetRouter { */ private TurnCostCalculator turnCostCalculator; + /** + * If true current search is reverse search AKA we are looking for a path from destination to origin in reverse + */ + public boolean reverseSearch = false; + // These are used for scaling coordinates in approximate distance calculations. // The lon value must be properly scaled to underestimate distances in the region where we're routing. private static final double MM_PER_UNIT_LAT_FIXED = @@ -313,15 +318,15 @@ public boolean setOrigin (double lat, double lon) { // FIXME we're setting weight but not time and distance on these states above! // FIXME Below is reversing the vertices, but then aren't the weights, times, distances wrong? Why are we even doing this? - if (profileRequest.reverseSearch) { + if (reverseSearch) { startState0.vertex = split.vertex1; startState1.vertex = split.vertex0; } // If there is a turn restriction on this edge, we need to indicate that we are beginning the search in a // turn restriction. - streetLayer.edgeStore.startTurnRestriction(streetMode, profileRequest.reverseSearch, startState0); - streetLayer.edgeStore.startTurnRestriction(streetMode, profileRequest.reverseSearch, startState1); + streetLayer.edgeStore.startTurnRestriction(streetMode, reverseSearch, startState0); + streetLayer.edgeStore.startTurnRestriction(streetMode, reverseSearch, startState1); // These initial states are not recorded as bestStates, they will be added when they come out of the queue. // FIXME but wait - we are putting them in the bestStates for some reason. @@ -550,7 +555,7 @@ public void route () { } TIntList edgeList; - if (profileRequest.reverseSearch) { + if (reverseSearch) { edgeList = streetLayer.incomingEdges.get(s0.vertex); } else { edgeList = streetLayer.outgoingEdges.get(s0.vertex); @@ -558,7 +563,7 @@ public void route () { // explore edges leaving this vertex edgeList.forEach(eidx -> { edge.seek(eidx); - State s1 = edge.traverse(s0, streetMode, profileRequest, turnCostCalculator); + State s1 = edge.traverse(s0, streetMode, profileRequest, turnCostCalculator, reverseSearch); if (s1 != null && s1.distance <= distanceLimitMm && s1.getDurationSeconds() < tmpTimeLimitSeconds) { if (!isDominated(s1)) { // Calculate the heuristic (which involves a square root) only when the state is retained. @@ -676,7 +681,7 @@ public State getStateAtVertex (int vertexIndex) { State ret = null; TIntList edgeList; - if (profileRequest.reverseSearch) { + if (reverseSearch) { edgeList = streetLayer.outgoingEdges.get(vertexIndex); } else { edgeList = streetLayer.incomingEdges.get(vertexIndex); @@ -718,7 +723,7 @@ public State getState(Split split) { EdgeStore.Edge e = streetLayer.edgeStore.getCursor(split.edge); TIntList edgeList; - if (profileRequest.reverseSearch) { + if (reverseSearch) { edgeList = streetLayer.outgoingEdges.get(split.vertex1); } else { edgeList = streetLayer.incomingEdges.get(split.vertex0); @@ -728,7 +733,7 @@ public State getState(Split split) { Collection states = bestStatesAtEdge.get(it.next()); // NB this needs a state to copy turn restrictions into. We then don't use that state, which is fine because // we don't need the turn restrictions any more because we're at the end of the search - states.stream().filter(s -> e.canTurnFrom(s, new State(-1, split.edge, s), profileRequest.reverseSearch)) + states.stream().filter(s -> e.canTurnFrom(s, new State(-1, split.edge, s), reverseSearch)) .map(s -> { State ret = new State(-1, split.edge, s); ret.streetMode = s.streetMode; @@ -750,7 +755,7 @@ public State getState(Split split) { // advance to back edge e.advance(); - if (profileRequest.reverseSearch) { + if (reverseSearch) { edgeList = streetLayer.outgoingEdges.get(split.vertex0); } else { edgeList = streetLayer.incomingEdges.get(split.vertex1); @@ -758,7 +763,7 @@ public State getState(Split split) { for (TIntIterator it = edgeList.iterator(); it.hasNext();) { Collection states = bestStatesAtEdge.get(it.next()); - states.stream().filter(s -> e.canTurnFrom(s, new State(-1, split.edge + 1, s), profileRequest.reverseSearch)) + states.stream().filter(s -> e.canTurnFrom(s, new State(-1, split.edge + 1, s), reverseSearch)) .map(s -> { State ret = new State(-1, split.edge + 1, s); ret.streetMode = s.streetMode; diff --git a/src/test/java/com/conveyal/r5/streets/ReverseRoutingTest.java b/src/test/java/com/conveyal/r5/streets/ReverseRoutingTest.java index c23feb3a3..8e664b7f9 100644 --- a/src/test/java/com/conveyal/r5/streets/ReverseRoutingTest.java +++ b/src/test/java/com/conveyal/r5/streets/ReverseRoutingTest.java @@ -97,7 +97,7 @@ public void testReverseRouting() throws Exception { ProfileRequest profileRequest = new ProfileRequest(); StreetRouter streetRouter = new StreetRouter(streetLayer); streetRouter.profileRequest = profileRequest; - profileRequest.reverseSearch = true; + streetRouter.reverseSearch = true; streetRouter.streetMode = StreetMode.BICYCLE; VertexStore.Vertex AVertex = streetLayer.vertexStore.getCursor(A); VertexStore.Vertex EVertex = streetLayer.vertexStore.getCursor(E); @@ -108,7 +108,7 @@ public void testReverseRouting() throws Exception { StreetRouter.State lastState = streetRouter.getStateAtVertex(A); //streetRouter.getDestinationSplit()); assertNotNull(lastState); - StreetPath streetPath = new StreetPath(lastState, transportNetwork, profileRequest.reverseSearch); + StreetPath streetPath = new StreetPath(lastState, transportNetwork, streetRouter.reverseSearch); List correctEdgeIdx = Arrays.asList( 0, 4, 6, 3 ); List correctDuration = Arrays.asList(3,6,9,13); diff --git a/src/test/java/com/conveyal/r5/streets/TurnRestrictionTest.java b/src/test/java/com/conveyal/r5/streets/TurnRestrictionTest.java index 6276ec413..975a207b3 100644 --- a/src/test/java/com/conveyal/r5/streets/TurnRestrictionTest.java +++ b/src/test/java/com/conveyal/r5/streets/TurnRestrictionTest.java @@ -37,7 +37,7 @@ public void testSimpleNoTurn () { r.route(); StreetRouter.State s1 = r.getStateAtVertex(VW); - LOG.debug("turn rest: {} {}", s1.dump(), s1.compactDump(r.profileRequest.reverseSearch)); + LOG.debug("turn rest: {} {}", s1.dump(), s1.compactDump(r.reverseSearch)); // weight should be greater because path should now include going past the intersection and making a U-turn back at it. assertTrue(s1.weight > state.weight); @@ -51,7 +51,7 @@ public void testSimpleNoTurnReverse () { StreetRouter r = new StreetRouter(streetLayer); // turn restrictions only apply to cars r.streetMode = StreetMode.CAR; - r.profileRequest.reverseSearch = true; + r.reverseSearch = true; r.setOrigin(VW); r.route(); @@ -63,7 +63,7 @@ public void testSimpleNoTurnReverse () { restrictTurn(false, ES + 1, EW); r = new StreetRouter(streetLayer); - r.profileRequest.reverseSearch = true; + r.reverseSearch = true; r.streetMode = StreetMode.CAR; r.setOrigin(VW); r.route(); @@ -98,7 +98,7 @@ public void testReverseTurnCosts() throws Exception { new StreetRouter(streetLayer); // turn restrictions only apply to cars r.streetMode = StreetMode.CAR; - r.profileRequest.reverseSearch = true; + r.reverseSearch = true; r.setOrigin(VW); r.route(); @@ -190,7 +190,7 @@ public void testSimpleOnlyTurnReverse () { StreetRouter r = new StreetRouter(streetLayer); // turn restrictions only apply to cars r.streetMode = StreetMode.CAR; - r.profileRequest.reverseSearch = true; + r.reverseSearch = true; r.setOrigin(VW); r.route(); @@ -201,7 +201,7 @@ public void testSimpleOnlyTurnReverse () { restrictTurn(true, ES + 1, EE); r = new StreetRouter(streetLayer); - r.profileRequest.reverseSearch = true; + r.reverseSearch = true; r.streetMode = StreetMode.CAR; r.setOrigin(VW); r.route(); @@ -244,7 +244,7 @@ public void testNoTurnWithSplitDestination () { StreetRouter.State state = r.getState(split); assertNotNull(state); - LOG.debug("Normat with split:{}", state.compactDump(r.profileRequest.reverseSearch)); + LOG.debug("Normat with split:{}", state.compactDump(r.reverseSearch)); // create a turn restriction restrictTurn(false, ES + 1, EW); @@ -256,7 +256,7 @@ public void testNoTurnWithSplitDestination () { StreetRouter.State restrictedState = r.getState(split); - LOG.debug("Normal restricted with split:{}", restrictedState.compactDump(r.profileRequest.reverseSearch)); + LOG.debug("Normal restricted with split:{}", restrictedState.compactDump(r.reverseSearch)); // weight should be greater because path should now include going past the intersection and making a U-turn back at it. assertTrue(restrictedState.weight > state.weight); @@ -272,14 +272,14 @@ public void testNoTurnWithSplitOriginReverse () { StreetRouter r = new StreetRouter(streetLayer); // turn restrictions only apply to cars r.streetMode = StreetMode.CAR; - r.profileRequest.reverseSearch = true; + r.reverseSearch = true; r.setOrigin(37.363, -122.1235); //location of split r.route(); StreetRouter.State state = r.getStateAtVertex(VS); // getState(splitVS); assertNotNull(state); - LOG.debug("Reverse with split:{}", state.compactDump(r.profileRequest.reverseSearch)); + LOG.debug("Reverse with split:{}", state.compactDump(r.reverseSearch)); // create a turn restriction @@ -287,14 +287,14 @@ public void testNoTurnWithSplitOriginReverse () { r = new StreetRouter(streetLayer); r.streetMode = StreetMode.CAR; - r.profileRequest.reverseSearch = true; + r.reverseSearch = true; r.setOrigin(37.363, -122.1235); //r.setOrigin(VW); r.route(); StreetRouter.State restrictedState = r.getStateAtVertex(VS); // getState(splitVS); - LOG.debug("Reverse restricted with split:{}", restrictedState.compactDump(r.profileRequest.reverseSearch)); + LOG.debug("Reverse restricted with split:{}", restrictedState.compactDump(r.reverseSearch)); // weight should be greater because path should now include going past the intersection and making a U-turn back at it. assertTrue(restrictedState.weight > state.weight); @@ -314,14 +314,14 @@ public void testNoTurnWithSplitReverse2 () { StreetRouter r = new StreetRouter(streetLayer); // turn restrictions only apply to cars r.streetMode = StreetMode.CAR; - r.profileRequest.reverseSearch = true; + r.reverseSearch = true; r.setOrigin(VW); //location of split r.route(); StreetRouter.State state = r.getState(splitVS); assertNotNull(state); - LOG.debug("Reverse with split:{}", state.compactDump(r.profileRequest.reverseSearch)); + LOG.debug("Reverse with split:{}", state.compactDump(r.reverseSearch)); // create a turn restriction @@ -329,14 +329,14 @@ public void testNoTurnWithSplitReverse2 () { r = new StreetRouter(streetLayer); r.streetMode = StreetMode.CAR; - r.profileRequest.reverseSearch = true; + r.reverseSearch = true; r.setOrigin(VW); //r.setOrigin(VW); r.route(); StreetRouter.State restrictedState = r.getState(splitVS); - LOG.debug("Reverse restricted with split:{}", restrictedState.compactDump(r.profileRequest.reverseSearch)); + LOG.debug("Reverse restricted with split:{}", restrictedState.compactDump(r.reverseSearch)); // weight should be greater because path should now include going past the intersection and making a U-turn back at it. assertTrue(restrictedState.weight > state.weight); @@ -356,7 +356,7 @@ public void testNoTurnBothSplit () { StreetRouter.State state = r.getState(dest); - LOG.debug("Normal:{}", state.compactDump(r.profileRequest.reverseSearch)); + LOG.debug("Normal:{}", state.compactDump(r.reverseSearch)); assertNotNull(state); // create a turn restriction @@ -369,7 +369,7 @@ public void testNoTurnBothSplit () { StreetRouter.State restrictedState = r.getState(dest); - LOG.debug("Restricted:{}", restrictedState.compactDump(r.profileRequest.reverseSearch)); + LOG.debug("Restricted:{}", restrictedState.compactDump(r.reverseSearch)); // weight should be greater because path should now include going past the intersection and making a U-turn back at it. assertTrue(restrictedState.weight > state.weight); @@ -387,7 +387,7 @@ public void testNoTurnSplitOriginTurnRestriction () { StreetRouter.State state = r.getStateAtVertex(VW); - LOG.debug("Normal:{}", state.compactDump(r.profileRequest.reverseSearch)); + LOG.debug("Normal:{}", state.compactDump(r.reverseSearch)); assertNotNull(state); // create a turn restriction @@ -400,7 +400,7 @@ public void testNoTurnSplitOriginTurnRestriction () { StreetRouter.State restrictedState = r.getStateAtVertex(VW); - LOG.debug("Restricted:{}", restrictedState.compactDump(r.profileRequest.reverseSearch)); + LOG.debug("Restricted:{}", restrictedState.compactDump(r.reverseSearch)); // weight should be greater because path should now include going past the intersection and making a U-turn back at it. assertTrue(restrictedState.weight > state.weight); @@ -463,7 +463,7 @@ public void testComplexNoTurnRev () { StreetRouter r = new StreetRouter(streetLayer); // turn restrictions only apply to cars r.streetMode = StreetMode.CAR; - r.profileRequest.reverseSearch = true; + r.reverseSearch = true; r.setOrigin(VNW); r.route(); @@ -474,7 +474,7 @@ public void testComplexNoTurnRev () { r = new StreetRouter(streetLayer); // turn restrictions only apply to cars r.streetMode = StreetMode.CAR; - r.profileRequest.reverseSearch = true; + r.reverseSearch = true; r.setOrigin(VNW); r.route(); @@ -485,7 +485,7 @@ public void testComplexNoTurnRev () { r = new StreetRouter(streetLayer); // turn restrictions only apply to cars r.streetMode = StreetMode.CAR; - r.profileRequest.reverseSearch = true; + r.reverseSearch = true; r.setOrigin(VNW); r.route(); @@ -499,7 +499,7 @@ public void testComplexNoTurnRev () { r = new StreetRouter(streetLayer); // turn restrictions only apply to cars r.streetMode = StreetMode.CAR; - r.profileRequest.reverseSearch = true; + r.reverseSearch = true; r.setOrigin(VNW); r.route(); @@ -521,7 +521,7 @@ public void testOnlyTurnWithViaMember () { StreetRouter.State stateFromN = r.getStateAtVertex(VE); - LOG.debug("Only via N: VN to VE {}", stateFromN.compactDump(r.profileRequest.reverseSearch)); + LOG.debug("Only via N: VN to VE {}", stateFromN.compactDump(r.reverseSearch)); assertFalse(stateContainsVertex(stateFromN, VNW)); r = new StreetRouter(streetLayer); @@ -531,7 +531,7 @@ public void testOnlyTurnWithViaMember () { r.route(); StreetRouter.State stateFromCenter = r.getStateAtVertex(VE); - LOG.debug("Only via N: VCENTER to VE {}", stateFromCenter.compactDump(r.profileRequest.reverseSearch)); + LOG.debug("Only via N: VCENTER to VE {}", stateFromCenter.compactDump(r.reverseSearch)); assertFalse(stateContainsVertex(stateFromCenter, VNW)); @@ -544,7 +544,7 @@ public void testOnlyTurnWithViaMember () { r.route(); StreetRouter.State restrictedStateFromN = r.getStateAtVertex(VE); - LOG.debug("Only via Restricted: VN to VE {}", restrictedStateFromN.compactDump(r.profileRequest.reverseSearch)); + LOG.debug("Only via Restricted: VN to VE {}", restrictedStateFromN.compactDump(r.reverseSearch)); // we should be forced to make a U-turn assertTrue(restrictedStateFromN.weight > stateFromN.weight); @@ -557,7 +557,7 @@ public void testOnlyTurnWithViaMember () { // Only U turn should not affect a state starting at the center StreetRouter.State restrictedStateFromCenter = r.getStateAtVertex(VE); - LOG.debug("Only via Restricted: VCENTER to VE {}", restrictedStateFromCenter.compactDump(r.profileRequest.reverseSearch)); + LOG.debug("Only via Restricted: VCENTER to VE {}", restrictedStateFromCenter.compactDump(r.reverseSearch)); assertEquals(stateFromCenter.weight, restrictedStateFromCenter.weight); // make sure the state from the north goes through VNW as there's an only U turn restriction. @@ -572,23 +572,23 @@ public void testOnlyTurnWithViaMemberReverse () { StreetRouter r = new StreetRouter(streetLayer); // turn restrictions only apply to cars r.streetMode = StreetMode.CAR; - r.profileRequest.reverseSearch = true; + r.reverseSearch = true; r.setOrigin(VE); r.route(); StreetRouter.State stateFromN = r.getStateAtVertex(VN); - LOG.debug("Rev: Only via N: VN to VE {}", stateFromN.compactDump(r.profileRequest.reverseSearch)); + LOG.debug("Rev: Only via N: VN to VE {}", stateFromN.compactDump(r.reverseSearch)); assertFalse(stateContainsVertex(stateFromN, VNW)); r = new StreetRouter(streetLayer); // turn restrictions only apply to cars r.streetMode = StreetMode.CAR; - r.profileRequest.reverseSearch = true; + r.reverseSearch = true; r.setOrigin(VE); r.route(); StreetRouter.State stateFromCenter = r.getStateAtVertex(VCENTER); - LOG.debug("Rev: Only via N: VCENTER to VE {}", stateFromCenter.compactDump(r.profileRequest.reverseSearch)); + LOG.debug("Rev: Only via N: VCENTER to VE {}", stateFromCenter.compactDump(r.reverseSearch)); assertFalse(stateContainsVertex(stateFromCenter, VNW)); @@ -597,12 +597,12 @@ public void testOnlyTurnWithViaMemberReverse () { r = new StreetRouter(streetLayer); // turn restrictions only apply to cars r.streetMode = StreetMode.CAR; - r.profileRequest.reverseSearch = true; + r.reverseSearch = true; r.setOrigin(VE); r.route(); StreetRouter.State restrictedStateFromN = r.getStateAtVertex(VN); - LOG.debug("Rev: Only via Restricted: VN to VE {}", restrictedStateFromN.compactDump(r.profileRequest.reverseSearch)); + LOG.debug("Rev: Only via Restricted: VN to VE {}", restrictedStateFromN.compactDump(r.reverseSearch)); // we should be forced to make a U-turn assertTrue(restrictedStateFromN.weight > stateFromN.weight); @@ -610,13 +610,13 @@ public void testOnlyTurnWithViaMemberReverse () { r = new StreetRouter(streetLayer); // turn restrictions only apply to cars r.streetMode = StreetMode.CAR; - r.profileRequest.reverseSearch = true; + r.reverseSearch = true; r.setOrigin(VE); r.route(); // Only U turn should not affect a state starting at the center StreetRouter.State restrictedStateFromCenter = r.getStateAtVertex(VCENTER); - LOG.debug("Rev: Only via Restricted: VCenter to VE {}", restrictedStateFromCenter.compactDump(r.profileRequest.reverseSearch)); + LOG.debug("Rev: Only via Restricted: VCenter to VE {}", restrictedStateFromCenter.compactDump(r.reverseSearch)); assertEquals(stateFromCenter.weight, restrictedStateFromCenter.weight); // make sure the state from the north goes through VNW as there's an only U turn restriction. @@ -672,7 +672,7 @@ public void visitVertex (StreetRouter.State state) { StreetRouter r = new StreetRouter(streetLayer); // turn restrictions only apply to cars r.streetMode = StreetMode.CAR; - r.profileRequest.reverseSearch = true; + r.reverseSearch = true; r.setRoutingVisitor(countingVisitor); r.setOrigin(VCENTER);