graphoflife / GraphOfLife

An Attempt at Engineering Artificial Life with Spatial Evolutionary Game Theory, Graph Theory and Neural Networks

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Graph of Life

Games of Evolution and Spatial Dynamics

An Attempt at Engineering Artificial Life with Spatial Evolutionary Game Theory, Graph Theory and Neural Networks

In this work, I try to engineer artificial life in a graph-based system called graph of life with the help of spatial evolutionary game theory where the fundamental mechanism of the algorithm has properties of life. The core idea of this work is to connect agents in a graph/network structure and delegate all kinds of possible decisions to the agents, whose behaviors are modeled with individual neural networks, and let them compete and evolve. This leads to a self-organizing system of agents. The agents have control over the topology of the graph/network such that they can decide with whom they want to interact or not. Through an exploratory approach, many different kinds of optional and obligatory decisions that could be made by the agents are formulated and integrated into the algorithm. The agents only interact with their neighboring agents and compete for scarce fungible tokens to survive and reproduce. The manually defined total token amount is a crucial numerical constant, as it limits the potential network's size because an agent needs at least one token to survive. This flexibility allows for running smaller simulations on personal computers while also enabling significant scaling on supercomputers in theory. Over many iterations, natural selection sorts out fragile behaviors while promoting the growth of adapted behaviors that have learned to survive and reproduce successfully. The competition between the Agents is inspired by a game known from game theory which deals with resources called the blotto game. Other competitive games could be implemented as well. Unlike other evolutionary game theory algorithms, reproduction is not handled globally, instead, it happens locally and depends on the decisions the agents make, such that it is part of the strategies of the agents. Also, newly reproduced agents are embedded into the existing network according to decisions made by the agents themselves. The algorithm allows for a wide range of settings that alter the way the agents can decide, what they can decide, and what games they play. This leads to diverse incentive structures and macroscopic emerging structures of the network. Through testing various combinations of settings, many different kinds of emerging networks and agent behaviors can be observed. Sometimes the networks are completely centralized, sometimes they are decentralized, and sometimes they are even beautiful. The question of whether open-ended evolution can happen in this algorithm remains unanswered. Although this has not been a central focus of this work, it should be noted that some comparisons can be made to physics. Note that there is a maximum speed of information inside of the network because each agent can only interact with their direct neighbors during one iteration which can be compared to the speed of light. Also, the conservation of scarce tokens can be compared to energy conservation. In certain configurations, the emerging network is even approximately three-dimensional.

How to run:

Download the file GraphOfLife.py and the two folders "graph life v012e best 0.0" and "graph life v012e best 1.0" and keep them in the same folder as in this repository. Then run the GraphOfLife.py file and change the lines until line 130 if the simulation should be run differently (how to load simulation options? How many images should be generated per iteration? How many tokens should the algorithm have?).

GoE

https://www.youtube.com/watch?v=mht3h-DAFWo

About

An Attempt at Engineering Artificial Life with Spatial Evolutionary Game Theory, Graph Theory and Neural Networks

License:MIT License


Languages

Language:Python 100.0%