Giter VIP home page Giter VIP logo

boids-simulation's Introduction

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 file for details.

boids-simulation's People

Contributors

clement-muth avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.