Boids
his project involves creating a 3D boids simulation that visualizes flocking behavior inspired by the natural movements of birds and fish. The simulation will calculate boid movements in 3D space but display them in a 2D view, with the third dimension represented by the size of each boid. This project provides insights into simulating complex group behavior using simple rules applied to individual agents.
Implementation Guidelines
The boids’ behavior will be based on three primary rules:
- Cohesion: Boids are attracted to the average position of their neighbors, encouraging them to 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.
The calculation of these rules will account for a 3D environment, though the display will show a 2D projection (with the third dimension affecting the displayed size of each boid). Simple shapes (e.g., circles or triangles) will represent boids.
Running the Program
- Allow the user to specify the number of boids, the viewing window dimensions, and the initial speed of each boid.
- Include parameters to adjust the influence of each rule (e.g., sliders for cohesion, separation, and alignment strengths).
- Apply boundary conditions to keep boids within the screen bounds in 2D or implement a wrap-around effect.
Testing
The report should include detailed testing and explanation of results, both numeric and graphical. All three versions (sequential, parallel, and distributed) must be tested.
-
Boid Count Variation: Experiment with different numbers of boids (e.g., 10, 50, 100, 500) and document changes in simulation performance and behavior. Record the time required to complete a set amount of simulation iterations.
-
Rule Weight Adjustment: Modify the weights of cohesion, separation, and alignment to observe their influence on flocking patterns and behaviors.
Present the results with informative charts/figures and include explanations for both numeric and graphical representations.