This is related to your route definition. If you want to reuse a route
outside a flow, better define it outside the flow, assign it an ID and
refer to that ID in the flow or when adding a vehicle by TraCI. You can
find an example of such a route definition here
<https://sumo.dlr.de/docs/Definition_of_Vehicles%2C_Vehicle_Types%2C_and_Routes.html#repeated_vehicles_flows>
.
Best regards
Mirko
-----Original-Nachricht-----
Betreff: [sumo-user] SUMO crashing when an added vehicle exits
Datum: 2023-09-09T12:17:26+0200
Von: "Didac Busquets via sumo-user" <[email protected]>
An: "[email protected]" <[email protected]>
Hi,
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).
Why is it crashing?
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()
The error when crashing is:
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
(notebooks-env) didac@didac-Precision-5530:~/development/SUM
Regards,
Didac
<https://immense.ai>
[Twitter] <https://twitter.com/immense_ai> [Facebook]
<https://www.facebook.com/ImmenseSimulations/> [LinkedIn]
<https://www.linkedin.com/company/immense-simulations-ltd/>
Didac Busquets, PhD | Chief Scientist and co-founder
[email protected] <mailto:[email protected]>
Sign up to our newsletter here
<https://immense.us16.list-manage.com/subscribe?u=bd57eabb3c96301a8f113cbbd&id=c92fc09b7a>
www.immense.ai <https://www.immense.ai>
Personal data: emails, by default, contain basic personal data and are not
necessarily secure. If, in answering this email, you provide additional
personal information, we will process that information for the purposes for
which you have supplied it and as set out in our Privacy Policy
<https://immense.ai/privacy-policy/> , which also contains information
about your rights.
This communication, and the information it contains, is (a) intended for
the person(s) and/or organisation(s) to whom it is addressed and is for no
other person(s) or organisation(s) and (b) may be confidential, legally
privileged and protected by law, including law of copyright. Unauthorised
use, copying, forwarding or disclosure of any of it may be unlawful. If you
have received this communication in error, please contact us immediately at
[email protected] <mailto:[email protected]> .
Immense Simulations Barcelona SL, ES B67427807, C/Corsega, 299, 6e, 08008
Barcelona, Spain is a subsidiary of Immense Simulations Limited, a limited
company registered in England and Wales with registered number 09782647,
and registered address at International House, 36-38 Cornhill, London,
England, EC3V 3NG..
_______________________________________________
sumo-user mailing list
[email protected]
To unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/sumo-user