{"id":19403820,"url":"https://github.com/jwt2706/boids","last_synced_at":"2025-09-21T22:07:51.187Z","repository":{"id":229733643,"uuid":"777508515","full_name":"jwt2706/Boids","owner":"jwt2706","description":"Simulates the flocking behavior of birds using the Boids algorithm [!website]","archived":false,"fork":false,"pushed_at":"2024-03-30T00:06:38.000Z","size":1233,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-25T00:35:01.435Z","etag":null,"topics":["boids-algorithm","boids-simulation","p5"],"latest_commit_sha":null,"homepage":"https://jwt2706.ca/Boids","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jwt2706.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-26T01:21:55.000Z","updated_at":"2024-11-02T21:29:33.000Z","dependencies_parsed_at":"2024-11-10T11:31:45.434Z","dependency_job_id":"4448d5da-0fd4-4000-a451-6a08791d29e0","html_url":"https://github.com/jwt2706/Boids","commit_stats":null,"previous_names":["jwt2706/boids"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jwt2706/Boids","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwt2706%2FBoids","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwt2706%2FBoids/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwt2706%2FBoids/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwt2706%2FBoids/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jwt2706","download_url":"https://codeload.github.com/jwt2706/Boids/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwt2706%2FBoids/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268192592,"owners_count":24210541,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-01T02:00:08.611Z","response_time":67,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["boids-algorithm","boids-simulation","p5"],"created_at":"2024-11-10T11:30:50.184Z","updated_at":"2025-09-21T22:07:46.138Z","avatar_url":"https://github.com/jwt2706.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Boids Simulation\n\nThis project simulates the flocking behavior of birds using an implementation of the [Boids algorithm](https://en.wikipedia.org/wiki/Boids).\n\nSee the simulation for yourself [here](https://jwt2706.github.io/Boids)!\n\n\u003cimg src=\"recording.gif\" alt=\"Recording\" width=\"500\"/\u003e\n\n## Overview\n\nThe Boids algorithm models the behavior of an individual bird within a flock through three simple rules:\n\n1. **Separation**: Avoid crowding neighbors (short range repulsion)\n2. **Alignment**: Steer towards the average heading of neighbors\n3. **Cohesion**: Steer towards the average position of neighbors (long range attraction)\n\nEach boid in the simulation follows these rules, resulting in complex but really cool looking behaviors.\n\n## Implementation\n\nThe simulation is implemented in JavaScript using the p5.js library for rendering. The main logic is contained in the `Boid` class, which represents an individual boid in the simulation. The `Boid` class has methods for calculating the separation, alignment, and cohesion forces, updating the boid's position and velocity, and rendering the boid.\n\nThe simulation is initialized and run in the `sim` function, which uses the p5.js `setup` and `draw` functions to create the boids and update the simulation each frame.\n\n## Configuration\n\nThe number of boids in the simulation can be configured by changing the `NUMBER_OF_BOIDS` constant at the top of `boids.js`.\n\nThe behavior of the boids can be tweaked by adjusting the `maxForce` and `maxSpeed` properties of the `Boid` class, and the `perceptionRadius` variable in the `align`, `cohesion`, and `separation` methods. Although, the current values seemed to be the ones that work the best for me.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjwt2706%2Fboids","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjwt2706%2Fboids","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjwt2706%2Fboids/lists"}