Demo of agent based model on GPU with CUDA and OpenGL (Windows/Linux)
Agent instances on GPU memory
Uses SSBO for instanced objects (with GLSL 450 shaders)
CUDA OpenGL interops
Renders with GLFW3 window manager
Dynamic camera views in OpenGL (pan,zoom with mouse)
Libraries installed using vcpkg
Hi, thank you for your interest. Agent based model is a term refers to an interaction between multiple object (called agent) with its own property.
The triangle is one agent in this case and in this example it moves along a random trajectory (just like people in a crowd). Each triangle also has its own color of its population so agents in the same population will have the same color.
Are the agents independent or are they affected by neighbors? It would be nice to see some classic ABM examples like wolf-sheep population, flocking, and wildfire spread to demonstrate the utility of this.
Super cool, curious to see where you take this! I did some work on GPGPU for agent simulations for an RTS years ago ( https://www.youtube.com/watch?v=P4fKJIrv0J8 ). Doing things like pathfinding on the GPU gets tricky, especially taking into account how agents affect paths of other agents. Happy to jam anytime if you're brainstorming applications.
If you want to create some pretty effects, add the concept of a velocity-texture which is added to agents velocity as they pass over it. Then let the user draw on the texture. Very cheap way to get interactivity. My own version from before compute shades were a thing (https://moritonal.github.io/force-particles/)
Are the entities interacting in any way here? That's pretty critical for agent based models as they enable complicated/unexpected emergent behavior from simplified rules due to the interactions of the entities.