metadriverse / metadrive

MetaDrive: Open-source driving simulator
https://metadriverse.github.io/metadrive/
Apache License 2.0
671 stars 100 forks source link

Question for fix traffic spawn #695

Open Yuxin916 opened 3 months ago

Yuxin916 commented 3 months ago

Hi! Thank you for the work!

I am new to this simulator and would like to create a multi agent intersection scenario with fix traffic flow settings for each agent, for example, starting point and ending point for each agent, each vehicle type corresponds to its vehicle ID, scheduling for each of vehicles at each time step. Will there be a way similar to SUMO i could self design the traffic flow config?

Thank you!

QuanyiLi commented 2 months ago

Hi,

Welcome and sorry for the late reply.

It can be achieved but would be a bit difficult for a beginner as we don't have such an interface like SUMO. If you check the Multi-agent environment and set the allow_respawn=False, you will find that actually all vehicles are assigned a destination and spawn point when they are created, which is pretty similar to what you want. To adapt it to your need, you have to set the spawn point and destination on your own rather than randomly picking from some candidate positions, which requires some effort.

Quanyi