Virtual simulation to ensure the safety of vehicles