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)

[((4, 4, 4, 32), 'libsalt.start', 'libsalt.start', ({(4, 18, 4, 31): 'salt_scenario'}, {}), '(salt_scenario)', False, 'import libsalt\n'), ((5, 4, 5, 33), 'libsalt.setCurrentStep', 'libsalt.setCurrentStep', ({(5, 27, 5, 32): '(25200)'}, {}), '(25200)', False, 'import libsalt\n'), ((6, 11, 6, 35), 'libsalt.getCurrentStep', 'libsalt.getCurrentStep', ({}, {}), '()', False, 'import libsalt\n'), ((14, 4, 14, 19), 'libsalt.close', 'libsalt.close', ({}, {}), '()', False, 'import libsalt\n'), ((18, 15, 18, 51), 'libsalt.vehicle.getStandbyVehicles', 'libsalt.vehicle.getStandbyVehicles', ({}, {}), '()', False, 'import libsalt\n'), ((19, 15, 19, 51), 'libsalt.vehicle.getRunningVehicles', 'libsalt.vehicle.getRunningVehicles', ({}, {}), '()', False, 'import libsalt\n'), ((11, 8, 11, 32), 'libsalt.simulationStep', 'libsalt.simulationStep', ({}, {}), '()', False, 'import libsalt\n'), ((12, 15, 12, 39), 'libsalt.getCurrentStep', 'libsalt.getCurrentStep', ({}, {}), '()', False, 'import libsalt\n')]