I have a simple TraCI scripts that add a vehicle to a network composed of a single long link.
The vehicle is added correctly, but when that vehicle reaches the end of the link, SUMO crashes.
The script is as follows (also attached, with the rest of the required network and config files).
import traci
sumo_binary = "sumo"
sumo_cmd = [sumo_binary, "-c", "single_highway.sumocfg"]
traci.start(sumo_cmd)
step = 0
route_id = "!type1"
while step < 300:
traci.simulationStep()
if step == 50:
print(f"Adding vehicle at {step} route {route_id}")
traci.vehicle.add(vehID="added_vehicle",
routeID=route_id)
traci.vehicle.setColor(vehID="added_vehicle", color=(255,0,0))
step += 1
traci.close()
Traceback (most recent call last):
File "/home/didac/development/SUMO/networks/single_highway/run.py", line 12, in <module>
traci.simulationStep()
File "/home/didac/development/sumo-1.2.0/tools/traci/__init__.py", line 126, in simulationStep
responses = _connections[""].simulationStep(step)
File "/home/didac/development/sumo-1.2.0/tools/traci/connection.py", line 329, in simulationStep
result = self._sendExact()
File "/home/didac/development/sumo-1.2.0/tools/traci/connection.py", line 105, in _sendExact
raise FatalTraCIError("connection closed by SUMO")
traci.exceptions.FatalTraCIError: connection closed by SUMO