@Override public LeastCostPathCalculator createPathCalculator(Network network, TravelDisutility travelCosts, TravelTime travelTimes) { return new FastDijkstraFactory().createPathCalculator(network, travelCosts, travelTime); } };
@Override public LeastCostPathCalculatorFactory getFactory(final Network network, final TravelDisutility costCalc, final TravelTime timeCalc) { return new FastDijkstraFactory(); } });
@Override public LeastCostPathCalculatorFactory getFactory(final Network network, final TravelDisutility costCalc, final TravelTime timeCalc) { return new FastDijkstraFactory(); } });
@Test public void testPersonAvailableForDisutility_FastDijkstra() { Fixture f = new Fixture(); LeastCostPathCalculatorFactory routerFactory = new FastDijkstraFactory(); LeastCostPathCalculator router = routerFactory.createPathCalculator(f.network, f.costFunction, new FreeSpeedTravelTime()); router.calcLeastCostPath( f.network.getNodes().get(Id.create("2", Node.class)), f.network.getNodes().get(Id.create("1", Node.class)), 07*3600, f.person, f.vehicle); // hopefully there was no Exception until here... Assert.assertEquals(22, f.costFunction.cnt); // make sure the costFunction was actually used }