Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [sumo-user] questions about automatically running sumo multiple times

Dear Sangjeong,
please write to the sumo-user list if possible.
You probably do not want to run sumo with the GUI all the time, just use
the sumo executable instead of sumo-gui. It will start the simulation
automatically. If you really want to do this with the GUI, you should
add the options "-S" (for starting) and "-Q" for quitting after
simulation end to your command line.

Best regards,
Michael

Am 23.11.2017 um 06:33 schrieb 이상정:
>  
> 
>      
> 
>     Dear Sumo 
> 
>      
> 
>     Hi
> 
>      
> 
>     I am Sangjeong.
> 
>      
> 
>     I have coded using Deep-Q-Network for signal control with SUMO.
> 
>      
> 
>     When training DQN, I need to run same SUMO configuration file
>     multiple times.
> 
>      
> 
>     But, it seems that I can not run or close simulation automatically.
>     Instead, I have to click the running button and closing button manually.
> 
>      
> 
>     What I want is to run SUMO file automatically without clicking the
>     running button and after simulation is finished, run the same file
>     again for training.
> 
>      
> 
>     How to solve this problem??
> 
>      
> 
>     Thanks
> 
>      
> 
>     Best regards 
> 
>      
> 
>     Sangjeong
> 
>      
> 
>     P.S  Below there is sample code file that I tried to run same SUMO
>     file multiple time
> 
>     In this way, you have to click the running button. And after
>     finished, you have to close the SUMO manually , and it will open
>     same SUMO file automatically.
> 
>     I attatched the sample file 
> 
>      
> 
>     import traci
> 
>     if __name__ == "__main__":
> 
>         for i_episode in range(100):
>             sumoBinary = "path-to-sumo-gui"
>             traci.start([sumoBinary, "-c", "path-to-2by2.sumocfg"], label="sim1")
> 
>             for i in range(10):
>                 traci.simulationStep()
> 
>             traci.close()
> 
>      
> 
>  
> 


Attachment: signature.asc
Description: OpenPGP digital signature


Back to the top