Abstract
Predator-prey dynamics serve as a fundamental paradigm for studying competition and cooperation in Multi-Agent Reinforcement Learning (MARL). However, the field often relies on fragmented, custom-built simulations that lack physical realism and reproducibility. We present Aquarium, an open-source, highly customizable framework designed to bridge this gap. Built on a continuous 2D toroidal plane with physics-based steering and realistic vision constraints, Aquarium integrates seamlessly with the PettingZoo library. Our evaluation using Proximal Policy Optimization (PPO) demonstrates the advantages of Parameter Sharing over Individual Learning and identifies emergent swarming behaviors, while also highlighting the performance gap between current RL agents and hand-coded heuristics.
1. Introduction
The study of predator-prey interactions is a cornerstone of MARL research, providing a rich context for observing emergent behaviors such as group hunting, swarming, and strategic evasion. Despite its importance, researchers frequently encounter significant hurdles when developing these simulations. Most existing environments are either overly simplistic grid-worlds that ignore physical constraints or are bespoke implementations that are difficult to reproduce or compare across studies. This "reinvention of the wheel" leads to time inefficiency and a lack of standardized benchmarks.
Aquarium addresses these challenges by providing a unified, yet highly customizable, environment. It balances simulation precision—incorporating realistic physics and perception—with the computational efficiency required for large-scale RL training.
2. Framework Design
Aquarium is engineered to provide a realistic simulation of aquatic-like interactions. The environment is situated on a continuous, two-dimensional toroidal plane, where agents that exit one boundary reappear on the opposite side, ensuring a consistent agent density without artificial wall constraints.
2.1 Physics and Collision Dynamics
Unlike traditional grid-based models, Aquarium utilizes a steering mechanism based on Reynolds’ algorithms. Agents do not simply move between cells; they apply forces to adjust their velocity, accounting for mass, momentum, and maximum speed limits.
Collision dynamics are handled through circular hitboxes. When a predator's hitbox overlaps with a prey's, a "capture" is registered. Interactions between agents of the same type are governed by elastic collision logic, causing them to bounce off one another, which adds a layer of spatial complexity to group movement.
2.2 Realistic Perception
To mimic biological constraints, Aquarium implements a customizable Field of View (FOV). Researchers can switch between global visibility and restricted perception defined by distance and angular range. For instance, an agent might only perceive entities within a 120-degree arc in front of it, forcing the RL policy to account for blind spots and partial observability.
2.3 Ecosystem Integration
A key feature of Aquarium is its native integration with the PettingZoo library. This compatibility ensures that the environment works out-of-the-box with popular RL frameworks, including Stable-Baselines3, Ray RLlib, and CleanRL, significantly lowering the barrier to entry for researchers.
3. Experimental Methodology
To validate the framework, the authors conducted experiments using Proximal Policy Optimization (PPO). Two distinct learning paradigms were evaluated:
- Individual Learning (IL): Each agent maintains and updates its own unique policy.
- Parameter Sharing (PS): All agents of a specific type (e.g., all prey) share a single set of policy parameters, allowing them to learn from the collective experience of the group.
These RL agents were compared against two heuristic baselines:
- Random: Agents move without direction or strategy.
- Static Heuristics: Hand-coded rules where prey ("TurnAway") always move 180° away from the nearest predator, and predators ("NaivChase") move directly toward the closest prey.
4. Results and Discussion
The experiments yielded several key insights into the learning dynamics of multi-agent systems within the Aquarium environment.
4.1 Learning Efficiency and Parameter Sharing
Parameter Sharing (PS) proved significantly more effective than Individual Learning. Agents using PS reached higher reward plateaus faster and exhibited more stable population dynamics. In contrast, Individual Learning showed high variance, with average rewards remaining near random levels for the first 500 episodes before stabilizing around episode 2000.
4.2 Emergent Behaviors
One of the most notable findings was the emergence of alignment. Agents trained via Parameter Sharing spontaneously began to swim in the same direction. This behavior, which mirrors the alignment rule in natural swarming, emerged as a local optimum for predator evasion despite not being explicitly programmed into the reward function.
4.3 The Performance Gap
Despite the success of the RL agents relative to random movement, they were consistently outperformed by the "TurnAway" heuristic. While RL-trained prey were captured approximately five times per episode, the hand-coded heuristic prey were captured less than once per episode on average. This "heuristic gap" highlights that while RL agents can learn sophisticated strategies, mastering optimal evasion in continuous, physics-based environments remains a significant challenge for current algorithms.
5. Conclusion and Future Work
Aquarium provides a robust, standardized platform for MARL research, offering a level of physical realism often missing from existing benchmarks. While the current version establishes a strong foundation, the authors identify several avenues for future development:
- 3D Environments: Expanding the simulation to three dimensions to better model UAV swarms or deep-sea dynamics.
- Advanced Metrics: Implementing automated metrics to quantify flocking, cohesion, and other social behaviors.
- Computational Optimization: Utilizing more efficient vector operations to support simulations involving thousands of agents.
- Environmental Complexity: Introducing external forces like water currents or wind through vector flow fields.
By open-sourcing Aquarium, the authors aim to foster a more collaborative and reproducible research environment for the study of complex multi-agent interactions.
Summary updated