Its my mistake that I did not read the following statement in the
documentation:
"When using SUMO-GUI <https://sumo.dlr.de/docs/SUMO-GUI.html> as a server,
the simulation must either be started by using the *play* button
<https://sumo.dlr.de/docs/SUMO-GUI.html#usage_description> or by setting
the option --start before TraCI commands will be processed. "

So it seems there was no issue, just my lack of reading the document.

On Sat, Sep 28, 2019 at 7:28 PM Ritu Pande <[email protected]> wrote:

> Hello,
>
> I am attempting to start a SUMO simulation using a python script.
>
> 1. I have successfully started the simulation manually using the
> configuration, network and trip files.
>
> 2. When I attempt to start the simulation programmatically, the sumo-gui
> is successfully started, the configuration files too are
> successfully loaded, but traci.start API  in my python script does not
> return ( as print statement after traci.start are not printed )
>
> Loading configuration... done.
> ***Starting server on port 58474 ***
> Loading net-file from
> 'C:/Users/XZ01M2/Desktop/Work/AI/github/Deep-Qlearning-TSC/intersection/intersection.4L.net.xml'...
> done (9ms).
> Loading done.
>
>
> 3. When I close the launched sumo-gui.exe manually, the connection is
> closed and  I see that the API is stuck somewhere within getVersion
> function trying to communicate with sumo-gui over the established
> connection.
>
> runfile('C:/Users/XZ01M2/Desktop/Work/AI/github/Deep-Qlearning-TSC/runner.py',
> wdir='C:/Users/XZ01M2/Desktop/Work/AI/github/Deep-Qlearning-TSC')
> Reloaded modules: sumolib.output.dump, sumolib.miscutils, traci.constants,
> sumolib.output.inductionloop, traci._person, sumolib.xml,
> sumolib.output.convert.poi, sumolib.output.convert,
> sumolib.sensors.inductive_loop, traci._junction, traci.storage,
> traci.connection, traci.domain, sumolib.output.convert.fcdfilter, sumolib,
> sumolib.output.convert.shawn, traci.main, sumolib.net.node,
> traci._lanearea, sumolib.output.convert.phem, sumolib.net.roundabout,
> sumolib.net.connection, sumolib.output, sumolib.net.edge,
> sumolib.files.additional, sumolib.visualization.helpers,
> sumolib.files.selection, sumolib.output.convert.gpsdat, sumolib.geomhelper,
> traci._multientryexit, traci._poi, traci._polygon, sumolib.visualization,
> sumolib.shapes.polygon, sumolib.shapes.poi, traci._trafficlight,
> traci._lane, sumolib.net, traci, sumolib.sensors, sumolib.files,
> sumolib.shapes, sumolib.output.convert.omnet, sumolib.output.convert.ns2,
> traci._gui, sumolib.route, traci._edge, traci.exceptions, traci._vehicle,
> sumolib.color, traci._route, traci._simulation, sumolib.output.convert.gpx,
> sumolib.options, sumolib.net.lane, sumolib.output.convert.kml,
> traci._inductionloop, traci._vehicletype
> Traceback (most recent call last):
>
>   File "<ipython-input-7-bcfcf462cc09>", line 1, in <module>
>
> runfile('C:/Users/XZ01M2/Desktop/Work/AI/github/Deep-Qlearning-TSC/runner.py',
> wdir='C:/Users/XZ01M2/Desktop/Work/AI/github/Deep-Qlearning-TSC')
>
>   File
> "C:\Users\XZ01M2\AppData\Local\Continuum\Anaconda3New\lib\site-packages\spyder\utils\site\sitecustomize.py",
> line 866, in runfile
>     execfile(filename, namespace)
>
>   File
> "C:\Users\XZ01M2\AppData\Local\Continuum\Anaconda3New\lib\site-packages\spyder\utils\site\sitecustomize.py",
> line 102, in execfile
>     exec(compile(f.read(), filename, 'exec'), namespace)
>
>   File
> "C:/Users/XZ01M2/Desktop/Work/AI/github/Deep-Qlearning-TSC/runner.py", line
> 18, in <module>
>     traci.start(sumoCmd)
>
>   File "C:\Users\XZ01M2\Desktop\Work\Sumo\tools\traci\main.py", line 124,
> in start
>     return init(sumoPort, numRetries, "localhost", label, sumoProcess)
>
>   File "C:\Users\XZ01M2\Desktop\Work\Sumo\tools\traci\main.py", line 110,
> in init
>     return getVersion()
>
>   File "C:\Users\XZ01M2\Desktop\Work\Sumo\tools\traci\main.py", line 194,
> in getVersion
>     return _connections[""].getVersion()
>
>   File "C:\Users\XZ01M2\Desktop\Work\Sumo\tools\traci\connection.py", line
> 375, in getVersion
>     result = self._sendExact()
>
>   File "C:\Users\XZ01M2\Desktop\Work\Sumo\tools\traci\connection.py", line
> 98, in _sendExact
>     raise FatalTraCIError("connection closed by SUMO")
>
> FatalTraCIError: connection closed by SUMO
>
>  4. Following are the version details
>
> sumo version 1.3.1
> Windows 7 64 bit OS
> Python 3.5.6 :: Anaconda 4.2.0 (64-bit)
>
> 5. I am attaching all the files I am using as a zip.
>
> Any help will be appreciated
>
> Thanks,
> Ritu
>
_______________________________________________
sumo-user mailing list
[email protected]
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://www.eclipse.org/mailman/listinfo/sumo-user

Reply via email to