https://github.com/clement-muth/boids-simulation
https://github.com/clement-muth/boids-simulation
boids boids-algorithm boids-behaviour boids-simulation craig-renyolds flock
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/clement-muth/boids-simulation
- Owner: Clement-Muth
- License: mit
- Created: 2024-05-11T00:44:35.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2024-05-11T20:35:54.000Z (about 1 year ago)
- Last Synced: 2024-12-27T17:35:22.246Z (5 months ago)
- Topics: boids, boids-algorithm, boids-behaviour, boids-simulation, craig-renyolds, flock
- Language: TypeScript
- Homepage:
- Size: 118 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
**Boids Simulation**
---
### Introduction
Boids is an artificial life program that simulates the flocking behavior of birds. Developed by Craig Reynolds in 1986, the term "boids" is derived from "bird-oid objects." This simulation demonstrates how simple rules can create complex emergent behavior, such as flocking, schooling, or herding, observed in nature.
### Description
This repository contains a Typescript implementation of the Boids simulation using HTML cavnas. Boids are represented as simple agents that follow three basic rules:
1. **Separation**: Boids avoid collisions by steering away from nearby flockmates.
2. **Alignment**: Boids align their direction with nearby flockmates.
3. **Cohesion**: Boids move towards the average position of nearby flockmates.
4. **Attraction**: Boids are attracted to nearby flockmates within a certain radius.### Features
- Adjustable simulation parameters such as cohesion radius, alignment radius, attraction radius, and separation radius.
- Interactive canvas rendering of boids' movements.
- Simple and intuitive code structure for easy understanding and modification.### Installation
To run the simulation locally, follow these steps:
1. Clone the repository:
```
git clone [email protected]:Clement-Muth/boids-simulation.git
```2. Navigate to the project directory:
```
cd boids-simulation
```3. Start with `yarn dev` and go to `http://localhost:8008`
### Usage
- **Simulation Controls**:
- Adjust the simulation parameters by modifying the `FlockOptions` object in the `index.ts` file.### Contributing
Contributions to this project are welcome! If you have any ideas for improvements or new features, feel free to submit a pull request.
### License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.