Skip to content

Minimalistic multi-agents simulations in Jax with real-time server-clients interaction

Notifications You must be signed in to change notification settings

corentinlger/SimulationSandbox

Repository files navigation

SimulationSandbox

SimulationSandbox is a simple framework built with Jax and Socket that allows for real-time interaction between a simulation hosted on a server and multiple clients. It provides a simple interface for modifying or plotting the state of a hosted simulation from remote clients, such as jupyter notebooks.

Install

Get the repo :

git clone [email protected]:corentinlger/SimulationSandbox.git
cd SimulationSandox/

Setup a virtual environment and install the dependencies :

python3 -m venv myvenv
source myvenv/bin/activate
pip install -r requirements.txt

Usage

Run a simulation locally

You can run a simulation on your machine (using either the 2D or 3D example envs provided):

python3 run_simulation.py  

You can also easiely implement your own environment and add it to the environments directory.

Run a simulation on a server

Or host it on a server :

python3 run_server.py

Visualize it on a distant client

Visualize it on distant clients :

python3 run_client.py

Interact with it in real time with a notebook

Modify the state of the simulation in real time : use this notebook client

Tests

You can test your code locally by running :

pytest

And add your own features to the tests directory

TODO :

  • Stop the popping up of matplotlib interactive figures
  • Replace the mechanism to send the first example state to the client (currently using pickle)

About

Minimalistic multi-agents simulations in Jax with real-time server-clients interaction

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published