Sep-11-2017, 02:01 PM
Ok, hopefully this is not the wrong forum!
I'm a hatchling to Python, but understand general concepts. I want to try my hand at creating a simple life evolution sim like the 1000000 others, mostly because I want to see it work and learn. Along the way I will try to represent it with graphics so I can watch pixels moving around the screen. :)
So for the 'agents' (creatures), what stats, or attributes do I give them that they will want to use and also be relevant 'genes' to pass on to the next gen?
This is what I have come up with so far in about an hour of A.D.D.'ing and googling (haven't been able to figure out how to search for something specific like this lol).
Nevermind the empty While loop or the Fitness stat (not sure what I would use).
(Python3.6)
The agents need to be able to move around (perhaps varying max speeds would be a gene?)
The agents use food up to move (maybe varying metabolism like X food per Move speed that scales up exponentially the faster they move)?
The "Plants" give their food value to the Agent when eaten (not much to do there)
I want the Plants to have varying color giving varying food dependent on that color (maybe 'bad ones too that reduce food).
I want the Agents to be able to "see" the color and "learn" which plants are best (or even bad)
Thanks!
I'm a hatchling to Python, but understand general concepts. I want to try my hand at creating a simple life evolution sim like the 1000000 others, mostly because I want to see it work and learn. Along the way I will try to represent it with graphics so I can watch pixels moving around the screen. :)
So for the 'agents' (creatures), what stats, or attributes do I give them that they will want to use and also be relevant 'genes' to pass on to the next gen?
This is what I have come up with so far in about an hour of A.D.D.'ing and googling (haven't been able to figure out how to search for something specific like this lol).
Nevermind the empty While loop or the Fitness stat (not sure what I would use).
(Python3.6)
from random import random, randint import time import numpy as np class Agent: def __init__(self): self.x = randint(0,500) self.y = randint(0,500) self.ang = 0 self.dx = 0 self.dy = 0 self.speed = 1 self.food = 100 self.target = {} self.age = 1 class Plant: def __init__(self): self.x = 0 self.y = 0 self.food = 20 self.color = 1 def fitness (self, age): return (np.tanh (age/4)) agent = Agent() i = 1 while i < 1000: i += 1I feel like the self.xxxxx stuff is useless as genes because those would be "realtime" states of the creature, and not necessarily characteristics it would have... so I guess my issue is, just WHAT "evolvable" characteristics/attribs should I be thinking about using?
The agents need to be able to move around (perhaps varying max speeds would be a gene?)
The agents use food up to move (maybe varying metabolism like X food per Move speed that scales up exponentially the faster they move)?
The "Plants" give their food value to the Agent when eaten (not much to do there)
I want the Plants to have varying color giving varying food dependent on that color (maybe 'bad ones too that reduce food).
I want the Agents to be able to "see" the color and "learn" which plants are best (or even bad)
Thanks!