import time import requests from devices.traffic_light import TrafficLight, SWITCHING_TIME from devices.vehicle import Vehicle """ USED AS ENTRYPOINT FOR DOCKERFILE Start all vehicles / traffic lights here """ if __name__ == '__main__': ENTITY_IDENT_URL = 'http://entityident:5002/api/v1/resources/' response = requests.get(ENTITY_IDENT_URL + 'cars') cars = response.json() response = requests.get(ENTITY_IDENT_URL + 'traffic_lights') traffic_lights = response.json() for traffic_light in traffic_lights['cursor']: print(traffic_light) TrafficLight(tlid=traffic_light['id'], switching_time=traffic_light['switchingTime']).start() time.sleep(1) for car in cars['cursor']: print(car) Vehicle(vin=car['vin']).start_driving() time.sleep(0.5)