  Agent-based modeling and simulation (ABMS) has been a popular approach to
modeling autonomous and interacting agents in a multi-agent system.
Specifically, ABMS can be applied to connected and automated vehicles (CAVs),
since CAVs can be driven autonomously with the help of on-board sensors, and
cooperate with each other through vehicle-to-everything (V2X) communications.
In this work, we apply ABMS to CAVs using the game engine Unity3D, taking
advantage of its visualization capability and other capabilities. Agent-based
models of CAVs are built in the Unity3D environment, where vehicles are enabled
with connectivity and autonomy by C#-based scripting API. We also build a
simulation network in Unity3D based on the city of Mountain View, California. A
case study of cooperative on-ramp merging has been carried out with the
proposed distributed consensus-based protocol, and then compared with the
human-in-the-loop simulation where the on-ramp vehicle is driven by four
different human drivers on a driving simulator. The benefits of introducing the
proposed protocol are evaluated in terms of travel time, energy consumption,
and pollutant emissions. It is shown from the results that the proposed
cooperative on-ramp merging protocol can reduce average travel time by 7%,
reduce energy consumption and pollutant emissions by 8% and 58%, respectively,
and guarantee the driving safety when compared to the human-in-the-loop
scenario.
