Birds behavior

From Simulace.info
Revision as of 21:27, 10 January 2025 by Misd01 (talk | contribs) (UI)
Jump to: navigation, search

Title: Simulation of Birds Behavior

Author: Denis Mišura (misd01)

Method: Agent-based model

Tool: NetLogo

Introduction and problem definition

This simulation explores the behavior of flocking agents (e.g., birds, drones, or other entities) based on simple interaction rules such as separation, alignment, and cohesion. Flocking is a common phenomenon in nature, where individual agents organize into groups or clusters without centralized control. The problem to solve is understanding how such groups (flocks) form, the factors influencing their size and dynamics, and how the number of agents in a flock changes over time. By modeling this process, we can gain insights into emergent behaviors and potentially apply these findings to robotics, crowd simulations, or ecological studies.

Model and Method

The model is based on Craig Reynolds' Boids algorithm, which uses three fundamental rules:

  • Alignment: Birds align their heading to match nearby individuals.
  • Separation: Birds maintain a safe distance to avoid collisions.
  • Cohesion: Birds move towards the center of nearby individuals to stay within the group.

Each bird operates independently, processing local information without global knowledge of the flock. The simulation is implemented in NetLogo, a platform designed for multi-agent simulations, which enables dynamic interactions and visualization of emergent patterns.

Environment

The environment is a two-dimensional world in NetLogo with the following characteristics:

  • World size: Defined by fixed boundaries.
  • Visibility: Each bird can perceive its surroundings within a specified radius.

Birds are initially distributed randomly within the environment, and their movements are governed by local rules and deterministic updates.

Agents

Bird

The agents in the simulation represent individual entities, such as birds or drones. Each agent has the following characteristics:

  • Attributes:
    • Position (x, y)
    • heading (direction of movement)
    • vision range (distance to detect neighbors)
    • current group membership (groups).
  • Behaviors:
    • Detect nearby agents within their vision range.
    • Calculate the average heading of neighbors (alignment).
    • Adjust movement to avoid collisions (separation).
    • Move toward the group center (cohesion).

Variables

  • User-Defined Variables:
    • number_of_birds: Specifies the total number of agents (birds) in the simulation, determined by the user before the simulation starts.
    • vision: Defines the distance within which an agent can detect its neighbors, set by the user to control the agents' perception range.
  • Global Variables:
    • num_flocks: Tracks the number of distinct flocks at each time step.
    • avg_flock_size: Calculates the average number of agents in a flock.
    • ticks: Keeps track of the simulation's time steps.
  • Agent-Specific Variables:
    • groups: A set of neighboring agents detected by an individual agent.
    • neighbor: The nearest agent within the vision range.
    • x, y: Position of the agent.
    • heading: Direction of the agent's movement.


UI

Misd01 simulation UI.jpg

Simulation steps

Results

Conclusion

The simulation successfully simulates multiple scenarios and results. The result are depending purely on the setup of variables and therefore it is up to the user to change the outcome. As for the review of this simulation, I implemented everything that was approved in simulation concept, so I hope there should not be a problem with a bad evaluation.


NetLogo File

[[]]

Sources