1
DNA - General / Dna reading question
« on: November 04, 2013, 01:32:05 PM »
I am reading the WikiManual but there are things that I am not sure. One of them is the very important understanding of stacks and DNA reading.
It says, somewhere on the Wiki, that the stack is clean after reading all the DNA...So how does that works?
Imagine the following DNA (described in english, not in code):
- Gene 1: If I dont see any organism, I will move forward (something like " 10 .up store").
- Gene 2: If I see an enemy I will eat it. (use shoot function)
- Gene 3 If I see a friend I will do nothing
Now I start a simulation with such organism. The DNA will Run: first it will check Gene 1, then Gene 2, then G3. Then, the memory will be clean and the DNA starts reading again: gene 1, gene 2 and so on. Correct? Is that the way it works?
Second question: if thats the way DNA works, I dont understand how is it possible for a bot to increase speed. Example with DNA reading: Gene 1 is read, then the speed increases 10 units (the speed goes from zero to 10), then gene 2 and 3, memory clean and then, a new cycle begins and Gene 1 is read (and so on). But since the memory was clean, the bot doesnt have the information that the last speed was 10, so it will start again from zero...
I am scracthing my head lol, because I am new to this stuff and I would like to understand some basic stuff before starting. I hope you can understant my questions because my english is not very good.
Thanks!
It says, somewhere on the Wiki, that the stack is clean after reading all the DNA...So how does that works?
Imagine the following DNA (described in english, not in code):
- Gene 1: If I dont see any organism, I will move forward (something like " 10 .up store").
- Gene 2: If I see an enemy I will eat it. (use shoot function)
- Gene 3 If I see a friend I will do nothing
Now I start a simulation with such organism. The DNA will Run: first it will check Gene 1, then Gene 2, then G3. Then, the memory will be clean and the DNA starts reading again: gene 1, gene 2 and so on. Correct? Is that the way it works?
Second question: if thats the way DNA works, I dont understand how is it possible for a bot to increase speed. Example with DNA reading: Gene 1 is read, then the speed increases 10 units (the speed goes from zero to 10), then gene 2 and 3, memory clean and then, a new cycle begins and Gene 1 is read (and so on). But since the memory was clean, the bot doesnt have the information that the last speed was 10, so it will start again from zero...
I am scracthing my head lol, because I am new to this stuff and I would like to understand some basic stuff before starting. I hope you can understant my questions because my english is not very good.
Thanks!