import libsalt 

def test(salt_scenario):
    libsalt.start(salt_scenario)
    libsalt.setCurrentStep(25200)
    step = libsalt.getCurrentStep()
    while step <= 36000:
        if (step % 100 == 0):
            print("Simulation Step: ", step)
            test_funcs()
        libsalt.simulationStep()
        step = libsalt.getCurrentStep()

    libsalt.close()
    print("Python: Simulation End!!!")

def test_funcs():
    standbys = libsalt.vehicle.getStandbyVehicles()
    runnings = libsalt.vehicle.getRunningVehicles()
    print("#Running Vehicles: ", len(runnings))
    #for vehicle in runnings:
    #    print("\t", vehicle.toString())

    #for vehicle in standbys:
    #    print("\t", vehicle.toString())

#    for vehicle in runnings:
        # print("Running Vehicle)", vehicle.id, ":", libsalt.vehicle.getRoute(vehicle.id).toString())
#        print("Running Vehicle)", vehicle.id, ":", vehicle.toString())

    #print("#Standby Vehicles: ", len(standbys))

    #for vehicle in standbys:
        # print("Standby Vehicle)", vehicle.id, ":", libsalt.vehicle.getRouteString(vehicle.id))
        #print("Standby Vehicle)", vehicle.id, ":", vehicle.toString())

if __name__ == "__main__":
    salt_scenario = r"/home/mclee/project/traffic-simulator/data/dj_sample_data/2020-dj_sample.json"
    test(salt_scenario)

[((46, 74), 'libsalt.start', 'libsalt.start', (['salt_scenario'], {}), '(salt_scenario)\n', (59, 74), False, 'import libsalt\n'), ((79, 108), 'libsalt.setCurrentStep', 'libsalt.setCurrentStep', (['(25200)'], {}), '(25200)\n', (101, 108), False, 'import libsalt\n'), ((120, 144), 'libsalt.getCurrentStep', 'libsalt.getCurrentStep', ([], {}), '()\n', (142, 144), False, 'import libsalt\n'), ((348, 363), 'libsalt.close', 'libsalt.close', ([], {}), '()\n', (361, 363), False, 'import libsalt\n'), ((437, 473), 'libsalt.vehicle.getStandbyVehicles', 'libsalt.vehicle.getStandbyVehicles', ([], {}), '()\n', (471, 473), False, 'import libsalt\n'), ((489, 525), 'libsalt.vehicle.getRunningVehicles', 'libsalt.vehicle.getRunningVehicles', ([], {}), '()\n', (523, 525), False, 'import libsalt\n'), ((278, 302), 'libsalt.simulationStep', 'libsalt.simulationStep', ([], {}), '()\n', (300, 302), False, 'import libsalt\n'), ((318, 342), 'libsalt.getCurrentStep', 'libsalt.getCurrentStep', ([], {}), '()\n', (340, 342), False, 'import libsalt\n')]