PJLab-ADG / LimSim

LimSim & LimSim++: Integrated traffic and autonomous driving simulators with (M)LLM support
https://pjlab-adg.github.io/LimSim/
GNU General Public License v3.0
344 stars 27 forks source link

How to perform a reset operation #11

Closed AntaiXie closed 6 months ago

AntaiXie commented 7 months ago

Hello, I would like to enable the simulation to return to its original position and iterate repeatedly after the ego vehicle reaches its destination or meets certain conditions. How should I modify the code?

Fdarco commented 6 months ago

Hi, I understand you want to restart the simulation once the vehicle reaches the end? You can write a layer of loop function outside of run_model() and just start the next iteration after model.close(). But remember to change the database parameter of the model during initialization, so that the data of the next simulation won't overwrite the data of the previous simulation.

AntaiXie commented 6 months ago

Thank you for your answer. I solved this problem by moving to the starting point through traci's movetoXY

Fdarco commented 6 months ago

It's great to know that the problem is being solved

AntaiXie commented 6 months ago

Also, could you answer another question I raised? Thank you very much.

Message ID: @.***>