Autonomous and collaborative trajectory planning for traffic complexity management