Home▸Articles▸Animals & Their World

Mouse Colony (2D): A Simulation of Boid-Flocking Behavior

Explore the complex behaviors and interactions within a mouse colony through this 2D simulation.

mysimulator teamUpdated June 2026≈ 4 min read▶ Open the simulation

Boid-Flocking Behavior

In the Mouse Colony (2D) simulation, mice exhibit boid-flocking behavior, which is a model of bird flocking or fish schooling. This behavior involves individual mice adjusting their movement based on local interactions with nearby mice to achieve collective motion. Key principles include alignment, cohesion, and separation, where each mouse tries to match the velocity of its neighbors (alignment), stay close to them (cohesion), and avoid overcrowding (separation).

This behavior is crucial for survival as it helps in maintaining group cohesion during foraging and predator avoidance. The simulation demonstrates how these simple rules can lead to complex emergent behaviors, illustrating the power of decentralized systems.

Predator Scare Mechanism

The Mouse Colony (2D) also includes a predator scare mechanism that simulates the sudden departure of mice from foraging activities. When the user clicks on the field, nearby foraging mice are instantly drawn back into their burrows to avoid detection by a virtual predator. This behavior is based on the concept of escape response in animals, where individuals quickly retreat to safety when threatened.

This feature highlights how external threats can disrupt normal behaviors and trigger specific survival responses, providing insights into animal psychology and ecology.

live demo · related simulation● LIVE

Daily Routines

In the simulation, mice follow a day/night cycle that influences their behavior. During the daytime, mice are more active as they forage for food outside their burrows. This is modeled based on the natural circadian rhythms of animals, which regulate their sleep-wake cycles and feeding patterns.

At night, when it's safer to be underground, mice retreat into their burrows. This behavior is a survival strategy that minimizes exposure to predators during times when they are more active above ground.

Control Summary

The simulation offers several controls: the population slider allows users to adjust the number of mice in the colony, the day/night length and daytime-wariness sliders can be used to simulate different environmental conditions. The Space key pauses the simulation, while pressing H toggles the control panel for further customization.

These controls provide a flexible environment for experimenting with various scenarios and observing how changes in parameters affect mouse behavior.

Frequently asked questions

What is boid-flocking?

Boid-flocking is a model of animal movement that describes how individual entities (boids) move together to form cohesive groups, based on simple rules like alignment, cohesion, and separation.

How does the day/night cycle affect mouse behavior in the simulation?

The day/night cycle influences mice to forage during the daytime and retreat into burrows at night, mimicking their natural circadian rhythms and survival strategies.

Why is predator avoidance important in animal behavior?

Predator avoidance is crucial as it helps animals survive by quickly retreating from potential threats, increasing their chances of avoiding predation.

How does the simulation help in understanding boid-flocking and animal behavior?

The simulation provides a visual and interactive way to explore how simple rules can lead to complex behaviors, offering insights into both boid-flocking and predator avoidance strategies used by animals.

Try it live

Everything above runs in your browser — open Mouse Colony (2D) and change the parameters while it is running. Nothing is installed, nothing is uploaded, the whole model lives in one tab.

▶ Open Mouse Colony (2D) simulation

What did you find?

Add reproduction steps (optional)