Skip to content

DanielDondorp/flocking

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

flocking

simulation of flocking boids in numpy and pygame

gif of simulation

A simple implementation of Craig Reynolds flocking boids in python, with the addition of predatory boids and evasion behaviour. Evasion is implemented by altering the steering rule.

https://en.wikipedia.org/wiki/Boids

dependencies: numpy, pygame.

The flocking.py file runs a full simulation using the Boid and predatory Pboid objects from the boid.py file.

In flocking_opt.py/boid_opt.py the way distances are calculated is optimized and vectorized, making this implementation much more efficient. In this version predators are not implemented.

About

simulation of flocking boids in numpy and pygame

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages