예제 #1
0
 def test_bus_estimate_accessor(self):
     bus_estimation_accessor.reset()
     bus_estimation_accessor.start()
     bus_estimation_accessor.add_sample('jalan1', 'jalan2', 90)
     real_value = bus_estimation_accessor.predict_eta('jalan1', 'jalan2')
     self.assertEqual(real_value, 90)
     bus_estimation_accessor.add_sample('jalan1', 'jalan2', 10)
     real_value = bus_estimation_accessor.predict_eta('jalan1', 'jalan2')
     self.assertEqual(real_value, 50)
     bus_estimation_accessor.stop()
예제 #2
0
def start():
    # warming up
    __logger.info('System is warming up')
    bus_estimation_accessor.start()
    busway_info_fetcher.start()
    train_info_fetcher.start()
    walk_info_fetcher.start()
    busway_transfer_fetcher.start()
    busway_track_fetcher.start()
    autocomplete_service.start()
    __logger.info('All components have been started')