Foragax: An Agent-Based Modelling Framework Based on JAX
Chaturvedi, El-Gazzar, van Gerven
Foraging for resources is a ubiquitous activity conducted by living organisms in a shared environment to maintain their homeostasis. Modelling multi-agent foraging in-silico allows us to study both individual and collective emergent behaviour in a tractable manner. Agent-based modelling has proven to be effective in simulating such tasks, though scaling the simulations to accommodate large numbers of agents with complex dynamics remains challenging. In this work, we present Foragax, a general-purpose, scalable, hardware-accelerated, multi-agent foraging toolkit. Leveraging the JAX library, our toolkit can simulate thousands of agents foraging in a common environment, in an end-to-end vectorized and differentiable manner. The toolkit provides agent-based modelling tools to model various foraging tasks, including options to design custom spatial and temporal agent dynamics, control policies, sensor models, and boundary conditions. Further, the number of agents during such simulations can be increased or decreased based on custom rules. While applied to foraging, the toolkit can also be used to model and simulate a wide range of other multi-agent scenarios.
academic
Foragax: An Agent-Based Modelling Framework Based on JAX
Foraging is a universal activity performed by organisms in shared environments to maintain homeostasis. By computationally modeling multi-agent foraging behavior, individual and collective emergent behaviors can be studied in a tractable manner. Agent-based modeling has proven effective in simulating such tasks, but extending simulations to accommodate large numbers of agents with complex dynamics remains challenging. This paper presents Foragax, a general-purpose, scalable, hardware-accelerated multi-agent foraging toolkit. Leveraging the JAX library, the toolkit can simulate thousands of agents foraging in a shared environment in an end-to-end vectorized and differentiable manner. The toolkit provides agent modeling tools to simulate various foraging tasks, including options for designing custom spatial and temporal agent dynamics, control policies, sensor models, and boundary conditions. Furthermore, agent populations can be dynamically increased or decreased during simulation according to custom rules. While applied to foraging, the toolkit can also be used for modeling and simulating a wide range of other multi-agent scenarios.
Foraging is one of the oldest and most critical behavioral optimization problems that all organisms must solve for survival. From the simplest bacteria to highly socialized primates, the instinct for efficient foraging is ubiquitous across all stages of evolution. Foraging in nature is inherently a multi-agent activity, as adjacent organisms share the same foraging environment.
Scalability Issues: Traditional agent-based modeling methods face computational bottlenecks when handling large numbers of agents
Insufficient Biological Realism: Limitations on agent numbers in existing simulations lead to inconsistencies with foraging behaviors observed in nature
Computational Complexity: Each agent's state depends on the behavior of all other agents, making simulation extremely difficult as agent numbers increase
The authors aim to provide foraging task modelers with the capability to simultaneously simulate large numbers (thousands) of agents in a single environment. This large-scale simulation capability is crucial for understanding complex emergent collective behaviors and bridging the gap between theoretical research and natural observations.
The paper provides visualizations of 600 agents (blue dots) dispersed foraging among 600 resources (red dots), with arrows indicating agent direction, demonstrating the system's spatial organization properties.
Recent advances in neuroevolution and reinforcement learning
Overall Assessment: This is a high-quality systems paper that addresses an important technical bottleneck in the field by combining modern high-performance computing techniques with multi-agent modeling. While relatively limited in theoretical innovation, its engineering value and practical utility make it an important contribution to multi-agent systems research.