This repository has two main code folders:
-
viz contains the visualization logic for the simulation and exposes 3 APIs that can be used to handle the screen:
void sim_init(VizState *state)is used to initialize the simulation statevoid sim_update(VizState *state)is the main simulation function that handles the actual update of the state at every stepvoid sim_cleanup(VizState *state)is used to correctly clear the simulation when it ends
-
sim contains the actual simulation logic, every file that ends with .c gets compiled so you can create a new simulation by just creating the file and changing the name of an old sim to something like .c.bck
The structure is very flexible and can handle every simulation, as long as it calls the viz apis so feel free to create new things as you like
N.B. the visualization logic is made using epoxy so make sure that it is correctly installed in you device (installatela da solo Tommà figlio di puttana)
To compile the simulation just write make on the terminal
To run the simulation write ./build/sim_tool