How can I use my own scenario to simulate

Hello,when I am trying to use my own scenario to replace the scenario in tutorials,an error appears and the reason is that I don’t have “simulation_config.p” file.

I have net.xml and sumocfg.xml file now,as the picture showed.They are created from sumo.I wonder how I can create “simulation_config.p” from the file I have,so that I can simulate with my own scenario.

Many Thanks~!


I think this is a pickle file storing the SumoConfig. Therefore, you would need to create the corresponding Python object and store it as pickle file.

Thanks a lot for your reply!

I have another question:is .p file the same as .pickle file?

Because when I try to use the pickle file,an error comes out and still said that it couldn’t find simulation_config.p file.

Sorry,Is this the right way to create this pickle file?
I save this py file as pickle file and try to run the tutorial with my scenario,but an error stiil appeas.Could you please give me more advice?
Sincere thanks!


For example:

with open(os.path.join(output_folder, "simulation_config.p"), 'wb') as f:
    pickle.dump(conf, f)

where conf is the configuration object.

However, why do you want to create your own interactive scenario?

I have made an intersection scenario by SUMO.
And I want to use simulate_with_planner() function and replace the planner with a DQN agent,and try to train the agent so that the ego vechicle can pass the intersection safely.

So I am trying to replace the scenario in tutorials with my own scenario and run the tutorials,but the error always appears.

In this case using only the sumo-interface could be easier.

Could you please explain a little more specifically?It means that I don’t need to create simulation_config.p file any more?Because I can’t find any tutorial or usage information in this sumo-interface folder.

I really appreciate that,thanks a lot for your patience!

Similar as described in the sumo-interface docu.