Game of life like program to simulate pops
with neural networks
occupying habitats
- Generates
habitat
squares and their inhabitingpops
- Generates a
neural network
brain for eachpop
with:- Sensory input
neurons
- Hidden middle layer
neurons
- Output action
neurons
Synapses
between theneurons
with random weight values
- Sensory input
- Visualizes the selected
pops
brain as a layered graph- Select a
pop
by left clicking on it after the simulation has begun
- Select a
- Runs the simulation of an
epoch
where on each tickpops
:- Fire
synapses
through inputneurons
- Execute an action corresponding to the output
neuron
with the highest value
- Fire
- After the limit of ticks reached:
- Simulation of
epoch
is done - All of the
pop
remaining in the kill zone (red area) are culled
- Simulation of
- Current input
neurons
:- Oscilloscope
- Is up free
- Is down free
- Is left free
- Is right free
- Latitude
- Longitude
- Age
- Random
- Current action
neurons
:- Wait
- Move up
- Move down
- Move left
- Move right
- Configurable initial simulation parameters:
- World parameters:
- World size
- Initial population
- Epoch length (number of ticks to simulate)
- Number of epochs to be run
- Pop parameters:
- Number of middle
neurons
in hiddenneuron
layer - Number of
synapses
(connections) betweenneurons
- Number of middle
- World parameters:
- Configurable settings:
- Time interval between ticks (0 will update the simulation on each frame)
- Reports simulation status:
- Actual rendered FPS (Updates interval 1 second)
- Current epoch tick (Updates interval each tick)
- Written in
TypeScript
- Uses
React
andsass
for the UI elements - Renders the simulation in
<canvas />
component - Experimented writing the simulation and rendering engine with functional programming
- Renders the
neural network
with G6 graph visualization library
- clone this repo
- install npm packages -
yarn
- run locally -
yarn dev
- MIT