Dear SUMO Community,
I tried  generate a new trip and a new vehicle using the example written in the 
following page:
http://sumo.dlr.de/wiki/TraCI/Interfacing_TraCI_from_Python
At the beginning, to understand how it works I decided to keep things simple 
and used a minimal map (attached).
The line of codes I wrote are:

def run():
    step = 0
    while step < 1000:
        #traci.simulationStep()
        traci.route.add("route1", ["gneE2", "gneE5"])
        traci.vehicle.add("car", "route1", typeID="newCar")
        step +=1
    traci.close()
    sys.stdout.flush()

where the two edges are contiguous because if I select two edges that are far 
one from the other it tells me that no connection is available (why?). Starting 
the program it opens the GUI but playing the simulation it stops immediately 
saying:

----------------------------------------------------------------------------------------
Loading configuration... done.
***Starting server on port 56264 ***
Loading net-file from 'bus.net.xml'... done (2ms).
Loading additional-files from 'bus.add.xml'... done (0ms).
Loading done.
Simulation started with time: 0.00
Error: Answered with error to command 0xc6: Could not add route.
Error: tcpip::Socket::recvAndCheck @ recv: Socket reset by peer
Quitting (on error).
-------------------------
On SUMO-GUI, while PyCharm log gives me:

Loading configuration... done.
Traceback (most recent call last):
  File "C:/Stefano/For school/Tesi/TraCI/Simulation/runner.py", line 100, in 
<module>
    run()
  File "C:/Stefano/For school/Tesi/TraCI/Simulation/runner.py", line 67, in run
    traci.route.add("route1", ["gneE2", "gneE5"])
  File "C:\Program Files (x86)\DLR\Sumo\tools\traci\_route.py", line 46, in add
    self._connection._sendExact()
  File "C:\Program Files (x86)\DLR\Sumo\tools\traci\connection.py", line 104, 
in _sendExact
    raise TraCIException(prefix[1], _RESULTS[prefix[2]], err)
traci.exceptions.TraCIException: Could not add route.

Process finished with exit code 1

Can you tell me what I did wrong?
Thank you very much
Stefano Niero

Attachment: bus.net.xml
Description: bus.net.xml

Attachment: bus.add.xml
Description: bus.add.xml

Attachment: runner.py
Description: runner.py

_______________________________________________
sumo-user mailing list
sumo-user@eclipse.org
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://dev.eclipse.org/mailman/listinfo/sumo-user

Reply via email to