[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [sumo-user] Problem with python code
|
See https://sumo.dlr.de/docs/TraCI.html#sumo_startup
. Do you use the --start option?
Mirko
Am 19.04.2021 um 12:24 schrieb ali
mirzaei:
Hi everyone,
I don't know why I am not able to run my file from python
while it works normally from GUI.
Here is my simple code:
- if 'SUMO_HOME' in os.environ:
- tools =
os.path.join(os.environ['SUMO_HOME'], 'tools')
- sys.path.append(tools)
- else:
- sys.exit("please declare environment
variable 'SUMO_HOME'")from sumolib import
checkBinary
- from sumolib import
checkBinary
- sumoBinary =
checkBinary('sumo-gui')
- sumoCmd =
[sumoBinary, "-c", "ali_trace.sumocfg"]
- import traci
- traci.start(sumoCmd)
- step = 0
- while step < 100:
- traci.simulationstep()
- step += 1
- traci.close()
The GUI is opened but nothing is shown as expected
simulation. Just these messages are added at the bottom of
GUI:
***Starting server on port
6269 ***
Loading net-file from 'D:\ali
mirzaei\app\my_sumo\ali_trace.net.xml' ... done (3ms).
Loading is done.
Simulation started with time:
0.00
I would be thankful if one can help me.
Regards,
Ali
_______________________________________________
sumo-user mailing list
sumo-user@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/sumo-user