← All projects

Vivarium: a multi-agent simulator in Jax

JaxMulti-Agent SystemsALife

With members of the Flowers team, we developed Vivarium, a multi-agent simulator in Jax that serves both research and teaching in Artificial Intelligence and Artificial Life.

Star

Vivarium lets you create simple agents with two motors and two sensors, inspired by Braitenberg vehicles, in a 2D rigid-body physics world (the physics engine is built on Jax-MD). Despite how simple each agent is, their interactions can lead to complex emergent behaviors. Custom or predefined simulations can be launched from config files.

Animated simulation of small agents moving and interacting in a 2D world
Example simulation.

Simulations can run standalone, or be hosted on a server and controlled in real time from a web interface or Jupyter notebooks. The web interface makes it easy to play with a simulation, while the notebooks teach students to program behaviors on these simulated robots in plain Python. For example, you can build an eco-evolutionary simulation with prey, predators, resources and poison, and even evolve the agents' behaviors with a genetic algorithm.

Vivarium was also used in a Master's course at Universitat Pompeu Fabra (Barcelona) to teach multi-agent systems, which I taught with Clément Moulin-Frier.