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/email/immense.jpg]<https://immense.ai>

[https://immense.ai/email/spacer.gif]

[Twitter]<https://twitter.com/immense_ai>  [Facebook] 
<https://www.facebook.com/ImmenseSimulations/>   [LinkedIn] 
<https://www.linkedin.com/company/immense-simulations-ltd/>

[https://immense.ai/email/spacer.gif]

[https://immense.ai/email/spacer.gif]   [https://immense.ai/email/spacer.gif]
Didac Busquets, PhD | Chief Scientist and co-founder
[email protected]<mailto:[email protected]>

[https://immense.ai/email/spacer.gif]

Sign up to our newsletter 
here<https://immense.us16.list-manage.com/subscribe?u=bd57eabb3c96301a8f113cbbd&id=c92fc09b7a>
www.immense.ai<https://www.immense.ai>

[https://immense.ai/email/spacer.gif]

[https://immense.ai/email/spacer.gif]

[https://immense.ai/email/spacer.gif]

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..
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()
<routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/routes_file.xsd";>
   <flow id="type1" color="1,1,0"  begin="0" end= "7200" vehsPerHour="1000" departLane="random">
    <route edges="E0"/>
</flow>
</routes>
<?xml version="1.0" encoding="UTF-8"?>

<!-- generated on 2023-09-08 19:40:47 by Eclipse SUMO netedit Version 1.18.0
<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/neteditConfiguration.xsd";>

    <input>
        <sumo-net-file value="/home/didac/development/SUMO/networks/single_highway.net.xml"/>
    </input>

    <output>
        <output-file value="/home/didac/development/SUMO/networks/single_highway.net.xml"/>
    </output>

    <processing>
        <offset.disable-normalization value="true"/>
    </processing>

    <junctions>
        <no-turnarounds value="true"/>
    </junctions>

    <netedit>
        <new-network value="false"/>
    </netedit>

</configuration>
-->

<net version="1.16" junctionCornerDetail="5" limitTurnSpeed="5.50" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/net_file.xsd";>

    <location netOffset="0.00,0.00" convBoundary="0.00,100.00,2000.00,100.00" origBoundary="10000000000.00,10000000000.00,-10000000000.00,-10000000000.00" projParameter="!"/>

    <edge id="E0" from="J0" to="J1" priority="-1">
        <lane id="E0_0" index="0" speed="13.89" length="2000.00" shape="0.00,92.00 2000.00,92.00"/>
        <lane id="E0_1" index="1" speed="13.89" length="2000.00" shape="0.00,95.20 2000.00,95.20"/>
        <lane id="E0_2" index="2" speed="13.89" length="2000.00" shape="0.00,98.40 2000.00,98.40"/>
    </edge>

    <junction id="J0" type="dead_end" x="0.00" y="100.00" incLanes="" intLanes="" shape="0.00,100.00 0.00,90.40"/>
    <junction id="J1" type="dead_end" x="2000.00" y="100.00" incLanes="E0_0 E0_1 E0_2" intLanes="" shape="2000.00,90.40 2000.00,100.00"/>

</net>

Attachment: single_highway.sumocfg
Description: single_highway.sumocfg

_______________________________________________
sumo-user mailing list
[email protected]
To unsubscribe from this list, visit 
https://www.eclipse.org/mailman/listinfo/sumo-user

Reply via email to