Multi-Agent Workshop - Traffic Game

We created a traffic simulation game for the Socal Cars Multi-Agent Workshop.

Contents [Hide]

The last 3 months were hard work for us, so a very large thank-you to my colleague Malte, Sophie and my student assistant Ehsan for a great job. Our task was:


Preparing a workshop for PhD students which shows a multi-agent simulation. We decided on a traffic game with the following definition:

  • create a street with 50km length
  • there are 4 segments with different speed settings
  • the user should create an agent which drives the vehicle
  • the user gets a penalty on slow or fast driving, so the goal is driving the allowed / optimal speed


Some features are

  • the environment and the street segments are also modelled as an agent
  • the GUI is complete browser-based with a game engine and state-of-the-art technologies (REST & WebSockets)
  • other vehicles are also modelled as agents
  • each vehicle can pull out or pull in

Technical details

  • Our Web-Application is a single bundled jar of programs with all necessary components and a web-based GUI.
  • We use our own LightJason/AgentSpeak and LightJason/REST components (now deprecated) for modelling the agents and realising communication.
  • The runtime executes the agents as concurrent entities to simulate independent vehicles.
  • A visualisation of agents and environment is realised using phaser.
  • For the challenge part of the exercise, we visualise the statistical results, e.g. penalties via web technologies.
  • For the communication between the browser front end and the Java back end, we used Ajax and and WebSockets.
  • Jetty serves as a WebSocket endpoint.
  • For the browser interface we were using Bootstrap.

The traffic movement creates a continuous data flow to the WebSocket, i.e. the backend sends the changes in movement of the vehicle agent to the browser. In the browser session, the visualisation is done by a tile map with the JavaScript game engine phaser. Based on an interactive GUI the user can change how the agent moves during the simulation is executed. This interaction is technically realised with Ajax and WebSocket calls.


You can download the source code and binary jar file

If you run the Jar file you can find a configuration under ~/.lightjason/trafficsimulation. Within the configuration you can enable all agents. Documentation of MAS, LightJason and the scenario are built-in as a slide-show. All parts of the game are open-source and we will publish it later as an online game.

You can also get the source code by cloning the GitHub Repostory.


A video of a short screen recording can be seen below.

Update 2018-02-16: For our AAMAS 2018 Demo video, see