Skip to content

ya7on/simulation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

simulation

Simple life simulation

description

Creatures spawn randomly on canvas with 0.5% chance. Instead of brain, they have simple neural network that receives as input: id of their generation, remaining energy, direction, and if there is another creature nearby, other id and energy. Initially they have 10 energy points. Each turn, they can do one of following actions: move (spends 2 energy points), reproduct (spends 4 energy points and creates new creature in empty cell), attack (spends 1 energy point and kills chosen creature in cell near them), and rest / healing (spend 1 energy point). When energy runs out, creature dies. If creature is born: it has 10% chance to be born with full energy, otherwise it will have same amount of energy as parent. There is also 1% chance of "mutation", one of neurons in newborn creature will chang.

image

Legend

  • Creature inner background color is generated randomly when mutated
  • Green border color - reproduction
  • Yellow border color - movement
  • Red border color - attack
  • White border color - healing

image image