https://github.com/ademakdogan/swarm_behaviour
Several swarm behavior approaches have been coded
https://github.com/ademakdogan/swarm_behaviour
pygame steering-behaviors swarm-algorithm
Last synced: 12 days ago
JSON representation
Several swarm behavior approaches have been coded
- Host: GitHub
- URL: https://github.com/ademakdogan/swarm_behaviour
- Owner: ademakdogan
- Created: 2022-07-26T20:01:01.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-07-26T21:15:33.000Z (over 3 years ago)
- Last Synced: 2025-05-12T14:11:16.591Z (9 months ago)
- Topics: pygame, steering-behaviors, swarm-algorithm
- Language: Python
- Homepage:
- Size: 11.8 MB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# SwarmBehaviour
Several swarm behavior approaches have been coded. The coding of this project was inspired by [here](https://vergenet.net/~conrad/boids/pseudocode.html). The basic swarm model consists of three simple steering behaviors which describe how an individual member maneuvers based on the positions and velocities its nearby member
* __Separation__: steer to avoid crowding local members
* __Alignment__: steer towards the average heading of local members
* __Cohesion__: steer to move toward the average position of local members
Each member in the swarm has position, velocity and acceleration vectors. Apart from these, there are also a few forces applied to the members. By changing the effects of these forces or removing them completely, the effects of other forces can be seen more clearly. The swarm can be observed below under the influence of different forces.
____
* Alignment
____
* Separation + Alignment
____
* Cohesion
____
* Cohesion + Alignment
____
* Separation + Alignment + Cohesion
____
How to run code ?
```
make install
```
and then;
```
python main.py
```
## References
* Computer Graphics, Principles and Practice by Foley, van Dam, Feiner and Hughes, Addison Wesley 1990
* http://www.red3d.com/cwr/papers/1987/SIGGRAPH87.pdf
* http://www.red3d.com/cwr/nobump/nobump.html