{"id":16236462,"url":"https://github.com/anuraghazra/evolutionaquerium","last_synced_at":"2025-07-17T03:07:53.151Z","repository":{"id":65980153,"uuid":"138686891","full_name":"anuraghazra/EvolutionAquerium","owner":"anuraghazra","description":":fish: :bug: Small Inteli Creatures Based On Steering Behaviours","archived":false,"fork":false,"pushed_at":"2022-02-12T20:33:10.000Z","size":373,"stargazers_count":185,"open_issues_count":0,"forks_count":21,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-10-11T13:31:06.919Z","etag":null,"topics":["agent-based-simulation","anuraghazra","boids","canvas2d","flocking","flocking-agents","flocking-algorithm","flocking-simulation","genetic-algorithm","simulation","steering-behaviours"],"latest_commit_sha":null,"homepage":"https://anuraghazra.github.io/EvolutionAquerium","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/anuraghazra.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}},"created_at":"2018-06-26T05:00:15.000Z","updated_at":"2024-10-05T13:23:02.000Z","dependencies_parsed_at":"2023-02-19T19:30:46.156Z","dependency_job_id":null,"html_url":"https://github.com/anuraghazra/EvolutionAquerium","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/anuraghazra/EvolutionAquerium","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anuraghazra%2FEvolutionAquerium","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anuraghazra%2FEvolutionAquerium/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anuraghazra%2FEvolutionAquerium/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anuraghazra%2FEvolutionAquerium/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anuraghazra","download_url":"https://codeload.github.com/anuraghazra/EvolutionAquerium/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anuraghazra%2FEvolutionAquerium/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265562232,"owners_count":23788491,"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","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":["agent-based-simulation","anuraghazra","boids","canvas2d","flocking","flocking-agents","flocking-algorithm","flocking-simulation","genetic-algorithm","simulation","steering-behaviours"],"created_at":"2024-10-10T13:31:04.518Z","updated_at":"2025-07-17T03:07:53.135Z","avatar_url":"https://github.com/anuraghazra.png","language":"JavaScript","readme":"# Evolution Aquerium\n\nCheck out [Evolution Aquerium case study](https://anuraghazra.github.io/case-studies/evolution-aquerium).\n\n[![](https://img.shields.io/github/license/anuraghazra/EvolutionAquerium.svg)](https://github.com/anuraghazra/EvolutionAquerium/blob/master/LICENSE)\n[![](https://img.shields.io/github/stars/anuraghazra/EvolutionAquerium.svg)](https://github.com/anuraghazra/EvolutionAquerium)\n\n![](https://img.shields.io/badge/flocking-behavior-orange.svg)\n![](https://img.shields.io/badge/Creative-Coding-ff69b4.svg)\n\n\n\u003ca href=\"https://anuraghazra.github.io/EvolutionAquerium\"\u003eTry Out The demo\u003c/a\u003e\n\n![Craig Reynold's](/src/screenshot.png)\n\nCheck-out [DevEnv](https://github.com/anuraghazra/EvolutionAquerium/tree/devEnv) Branch for Beta Optimization and Development which includes Refactored Code and EcoSystem.js Class to manage Creatures and Easy-to-use API for making new Agents.\n\n# How It Works?\n\nWell that's an obvious question.\n\nThese Creatures are based on  [Craig Reynold's](https://www.red3d.com/cwr/index.html) Steering Behaviors and [Flocking System](https://www.red3d.com/cwr/boids/)\n\nIt's also implements Genetic Algorithm and mutations.\n\nYou can learn more about them on Daniel Shiffman's YouTube Channel [The Coding Train](https://www.youtube.com/user/shiffman) \n\n* [Coding Challenge #69.1: Evolutionary Steering Behaviors](https://www.youtube.com/watch?v=flxOkx0yLrY\u0026t=1223s) \n\n* [Coding Challenge #124: Flocking Simulation](https://www.youtube.com/watch?v=mhjuuHl6qHM\u0026t=1978s)\n\n* [9. Genetic Algorithm playlist The Nature of Code](https://www.youtube.com/playlist?list=PLRqwX-V7Uu6bJM3VgzjNV5YxVxUwzALHV)\n\n# How My Code Works?\nMy code is actually pretty simple.\n\n## Agent Class\nI made a `Agent` class which handles all the Basic behavior like \n* `flock()`\n* `align()`\n* `separate()`\n* `cohesion()`\n\nAnd added some basic parameters like \n```javascript\nthis.radius = radius; //size of the agent\n\nthis.health = 1; // health \n\nthis.healthDecrease = 0.003; // how much health will decrease over time\n\nthis.goodFoodDie = 0.5; // food increase the health by that amount \n\nthis.badFoodDie = -0.4; // poison decrease the health by that amount\n```\nI also added a `sex` variable for the agents and all of them also has unique names\n\n```javascript\nthis.sex = (Math.random() \u003c 0.5) ? 'male' : 'female';\n```\n\n## Fear Behavior\nAnd for the most important part, i added a **`defineFear()`** method which handles Fear behavior.\n\nIt's a robust function to define fear which can be also used inversly with negative values.\n\n**`defineFear()`** function allows Agents to add Steering Forces simultaneously on each other\n\n\n```javascript\n// list, weight, perception, ?callback\ncreature.defineFear(predators, -4, 50);\n```\n\n## Reproduction System\nReproduction System checks for `male` and `female` agents and if their `radius` is greater than 8 and they are close enough to each other, then they can reproduce with their specific `DNA` and creates a small Agent based on their DNA data and with some mutation. \n\n\n# Predator class \nPredators are simple but deadly \nthey just has a `sex` property set to 'predator'\n\nand i used **`defineFear()`** function inversely to attack the Creatures\n\nAnd bigger they get slower they became.\n\n# Avoider Class\n\nAvoiders are very very very fast but they are very agile too.\nthey just has a `sex` property set to 'avoider'\n\n\nand i used **`defineFear()`** function to avoid every poison and Predator.\n\n-----------\n\n\u003c!-- ## Small, Little, Slow, Fast, Big Creatures With Simple Flocking System and Steering Behaviours\n --\u003e\n### Have Fun Watching Them All Day\n\n### Try To Contact Me\nI AM A PROUD INDIAN.\n* hazru.anurag@gmail.com\nMade with :heart: and JavaScript\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanuraghazra%2Fevolutionaquerium","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanuraghazra%2Fevolutionaquerium","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanuraghazra%2Fevolutionaquerium/lists"}