@@ -0,0 +1,832 @@
+#!/usr/bin/env python2%0Aimport rrrr%0Aimport sys%0Aimport os.path%0Aimport time%0A%0Aif len(sys.argv) %3C 2 or not os.path.isfile(sys.argv%5B1%5D): %0A    print (%22Create a timetable from GTFS using rrtimetable.%22)%0A    sys.exit(-1)%0A%0Arouter = rrrr.Raptor(timetable = sys.argv%5B1%5D)%0A%0Anow = int(time.time())%0A%0A# print router.stops()%5B0:10%5D%0Abest_times_a = router.meet(from_idx = 1, to_idx = 100, depart = now)%0Abest_times_b = router.meet(from_idx = 10, to_idx = 100, depart = now)%0A%0Acalc = %5B%5D%0A%0Afor sp_index in range(0, len(best_times_a%5B'best_time'%5D)):%0A   a = best_times_a%5B'best_time'%5D%5Bsp_index%5D%0A   b = best_times_b%5B'best_time'%5D%5Bsp_index%5D%0A%0A   if a == 65535 or b == 65535:%0A       continue%0A%0A   d = abs(a - b)%0A   calc.append((sp_index, (a - d) + (b - d),))%0A%0As = sorted(calc, key=lambda x: x%5B1%5D)%0Aprint s%5B0:10%5D%0A%0Afor x in s%5B0:10%5D:%0A%09print best_times_a%5B'stop_name'%5D%5Bx%5B0%5D%5D%0A

Optimisation with weight as a - abs(a - b) + b - abs(a - b)