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.
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
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.
Or host it on a server :
python3 run_server.py
Visualize it on distant clients :
python3 run_client.py
Modify the state of the simulation in real time : use this notebook client
You can test your code locally by running :
pytest
And add your own features to the tests directory
- Stop the popping up of matplotlib interactive figures
- Replace the mechanism to send the first example state to the client (currently using pickle)