1
Suggestions / Gene structure - cond start stop
« on: November 01, 2007, 10:57:43 PM »
I've been thinking about the structure of genes.
The cond-start-stop structure is very fragile, practically any mutation in the wrong place will break it completely. It is also prohibitively difficult to evolve naturally - what's the chance a cond instruction will appear before a condition to evaluate, then a start will appear, then an appropriate action will evolve with a stop at the end? Vanishingly small.
So why not simplify it?
Remove cond and start.
Change the way genes are handled so that only stop is used.
Make the stop command define the end of a gene. So from the start of the genome to the first stop is the first gene. From the first stop to the second stop is the second gene. From the last stop to the end of the genome is the last gene. Make no stop at all mean the entire genome is one gene.
But that would not allow us to have conditional genes. So I got to thinking - if the gene is defined by the stop command at the end, why not make the condition the last part of the gene?
The way I envision this working is like this: Fire the gene speculatively, calculating the changes to the memory locations, but don't commit them to the simulation. If the value on top of the stack when stop is reached is greater than zero, commit the results to the sim. If not, discard them.
The cond-start-stop structure is very fragile, practically any mutation in the wrong place will break it completely. It is also prohibitively difficult to evolve naturally - what's the chance a cond instruction will appear before a condition to evaluate, then a start will appear, then an appropriate action will evolve with a stop at the end? Vanishingly small.
So why not simplify it?
Remove cond and start.
Change the way genes are handled so that only stop is used.
Make the stop command define the end of a gene. So from the start of the genome to the first stop is the first gene. From the first stop to the second stop is the second gene. From the last stop to the end of the genome is the last gene. Make no stop at all mean the entire genome is one gene.
But that would not allow us to have conditional genes. So I got to thinking - if the gene is defined by the stop command at the end, why not make the condition the last part of the gene?
The way I envision this working is like this: Fire the gene speculatively, calculating the changes to the memory locations, but don't commit them to the simulation. If the value on top of the stack when stop is reached is greater than zero, commit the results to the sim. If not, discard them.