Boids
In this project, you'll create a 3D boids simulation that visualizes flocking behavior inspired by the natural movement of birds and fish. The simulation will calculate boid movements in 3D space, but display them in a 2D view, where the third dimension is represented by the size of each boid. This project will give you insights into simulating complex group behavior using simple rules applied to individual agents.
Implementation Guidelines
Implement the boids' behavior using three primary rules:
- Cohesion: Boids are attracted to the average position of their neighbors, helping them move together.
- Separation: Boids avoid crowding by keeping a minimum distance from their neighbors.
- Alignment: Boids adjust their velocity to align with the average heading of nearby boids.
Calculating these rules should account for a 3D environment, but the display may only show a 2D projection (using the third dimension as the boid's displayed size). Use simple shapes (e.g., circles or triangles) to represent boids.
- Running the Program:
- Allow the user to specify the number of boids in the simulation, the viewing window dimensions, and initial boid speed.
- Include parameters for adjusting rule influence (e.g., sliders for cohesion, separation, and alignment strengths).
- Apply boundary conditions to keep boids within the screen bounds in 2D or wrap around.
Testing
The report must include extensive testing and explanation of results (numeric and graphical). All three versions (sequential, parallel, and distributed) must be tested.
Parameter Variation:
- Experiment with different numbers of boids (e.g., 10, 50, 100, 500,...) and document how the simulation performance and behavior change. Observe how long it takes the program to complete a set amount of simulation iterations.
- Adjust cohesion, separation, and alignment weights to observe how they influence flocking patterns and behaviors.