• Stars
    star
    242
  • Rank 167,048 (Top 4 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created almost 10 years ago
  • Updated over 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

autonomous agents + genetic algorithms

What is this?

This is a proof of concept to show an implementation of autonomous agents combined with genetic algorithms.

Live Demo

Autonomous Agents

  • Limited ability to perceive the environment: Every fish can only see things (other fish and food) within a restricted range.

  • Process information from environment and compute an action: In this case the actions are computed as forces (vectors). If the environment tells the fish that there's a huge scary fish ahead, the action will be a force in the oposite direction, or if the fish sees food, a force will pull it towards it. There are social behaviors like shoaling/schooling that come from basic separation, alignment and cohesion forces. There are also evolutionary strategies, like the affinity for other fish of a similar color, this promotes the generation of different races. All these forces are added-up at every time-step and result making the fish decide in which direction to swim.

  • No leader: The fish are not commanded by a leader to display complex behaviors like shoaling/schooling; these intelligent and structured dynamics emerge from local interactions from the agents themselves.

Genetic Algorithms

  • Population: The population of fish is randomly generated with random values for their DNA. The genotype of a fish consists basically of 2 genes (mass and hue), which basically then produce the phenotype of the fish (color, size, max speed, range of view, maturity threshold, bite size, etc).

  • Selection: Fish are born with a certain amount of energy that they will spend to move (swim), and when they run out of it they die. They can eat food to gain energy, and also they can eat other fish that are smaller than them (less than half of their mass). The more energy they can collect, the longer they will live.

  • Reproduction: Agents can spawn offsprings, they have to reach a certain age (it varies depending on the mass of the fish), once they do, they are able to mate, therefore perpetuating their genes. When they mate, the fertility threshold is increased again, and if the fish collects enough food to live longer it can mate several times, but the older the fish gets the more energy it consumes to swim, so in the end every fish dies.

  • Crossover and Mutation: The offsprings are a crossover of the genes of their parents (if one parent is big and the other one is small, the child will be medium sized; if one is red and the other one is blue, the child will be purple), but a really small fraction of the offsprings get mutated genes, thus introducing new features to the population.

Inspired by The Nature of Code

More Repositories

1

synaptic

architecture-free neural network library for node.js and the browser
JavaScript
6,914
star
2

coin-hive

CoinHive cryptocurrency miner for node.js
JavaScript
1,982
star
3

coin-hive-stratum

use CoinHive's JavaScript miner on any stratum pool
TypeScript
416
star
4

mnist

mnist digits in javascript
JavaScript
191
star
5

react-coin-hive

Mine cryptocurrency while your users haven't engaged with your content lately
JavaScript
158
star
6

eth-pictures

🎨 Draw your own NFTs
TypeScript
44
star
7

coin-hive-proxy

Deprecated. Use CoinHive Stratum instead.
35
star
8

donger

npm package to generate dongers ヽ༼ຈل͜ຈ༽ノ
JavaScript
29
star
9

minero

a bunch of APIs mashed together
24
star
10

haha

humorous javascript obfuscation tool
JavaScript
16
star
11

nftmarketcap

top non-fungible tokens by (avg) market capitalization
JavaScript
13
star
12

react-redux-perf

Performance Engineering with React + Redux
JavaScript
12
star
13

synaptic-wikipedia

This is the source code for Synaptic's Wikipedia example
JavaScript
11
star
14

cheapbase

like Firebase, but for free (thanks to Heroku).
JavaScript
10
star
15

synaptic-workshop

Synaptic workshop for MuleSoft's MeetUp 2017
JavaScript
8
star
16

decentraland-shoal-scene

Decentraland Shoal Scene
TypeScript
7
star
17

react-storybook-typescript-template

🤸🏻‍♀️Template for a UI library using React + Storybook with TypeScript
JavaScript
7
star
18

earthquakes

just an experiment mixing Firebase open datasets + Google's WebGL Globe
JavaScript
5
star
19

hamster-scene

🐹 A hamster trying to escape from a pipe maze
TypeScript
4
star
20

lysergic

javascript neural network compiler
TypeScript
4
star
21

oliver

⚽️ Bot de Telegram para armar equipos de futbol
JavaScript
3
star
22

cazala.github.io

this is the source of my website
JavaScript
3
star
23

q-cache

simple tool to cache promises
JavaScript
2
star
24

query-to-json

just and endpoint that receives a query and returns a json of it
TypeScript
2
star
25

universal-app

2
star
26

point-e

Text to 3D mesh using OpenAI's Point-E
Python
2
star
27

builder-bot

Twitter bot that tweets every time new content is deployed via Decentraland's Builder
TypeScript
2
star
28

powerhour

tiny app for playing Power Hour (drinking game)
HTML
2
star
29

mana-altar

🔥 Burn MANA collected from Decentraland's Marketplace and light the Altar's flame
TypeScript
1
star
30

screenshots

TypeScript
1
star
31

eth-pictures-bot

✍Twitter bot that tweets new images submitted to https://eth.pictures
JavaScript
1
star
32

react-redux-seed

React + Redux + Router boilterplate
JavaScript
1
star
33

cra-bug-repro

TypeScript
1
star
34

rodo

🐘 HTTP mocking service
JavaScript
1
star
35

log

stdout
CSS
1
star
36

sabe

NodeJS meets ElBananero
JavaScript
1
star
37

universal-gitbook

1
star