this.setExtensionRadius(trConfig.getExtensionRadius()); this.setBeelineWalkConnectionDistance(trConfig.getMaxBeelineWalkConnectionDistance()); this.setAdditionalTransferTime(trConfig.getAdditionalTransferTime());
/** * Tests that if only a single transfer-/walk-link is found, the router correctly only returns * on walk leg from start to end. */ @Test public void testSingleWalkOnly() { WalkFixture f = new WalkFixture(); f.routerConfig.setSearchRadius(0.8 * CoordUtils.calcEuclideanDistance(f.coord2, f.coord4)); f.routerConfig.setExtensionRadius(0.0); TransitRouter router = createTransitRouter(f.schedule, f.routerConfig, routerType); List<Leg> legs = router.calcRoute(new FakeFacility(f.coord2), new FakeFacility(f.coord4), 990, null); assertEquals(1, legs.size()); assertEquals(TransportMode.transit_walk, legs.get(0).getMode()); }
/** * Tests that if only exactly two transfer-/walk-link are found, the router correctly only returns * on walk leg from start to end. Differs from {@link #testSingleWalkOnly()} in that it tests for * the correct internal working when more than one walk links are returned. */ @Test public void testDoubleWalkOnly() { WalkFixture f = new WalkFixture(); f.routerConfig.setSearchRadius(0.8 * CoordUtils.calcEuclideanDistance(f.coord2, f.coord4)); f.routerConfig.setExtensionRadius(0.0); TransitRouter router = createTransitRouter(f.schedule, f.routerConfig, routerType); List<Leg> legs = router.calcRoute(new FakeFacility(f.coord2), new FakeFacility(f.coord6), 990, null); assertEquals(1, legs.size()); assertEquals(TransportMode.transit_walk, legs.get(0).getMode()); }