Code center > Suggestions
Genome structure
MacadamiaNuts:
Mmh, trying to think about a more DNA like coding. Sorry if it's too complex / too long. Maybe you can scrap something useful from all the junk.
Mutated condition and command aminoacids could be generated on the fly from patterns, like:
*### ### >
*### ### = or *### ### !=
### ### store
-# # store
These aminoacids use a number as a nexus point. For example:
@10 *.nrg 3000 >
@10 50 .repro store
Would attach one to another and form the gene 10.
Each aminoacid will store across generations the amount of cicles it has survived without mutations, (it's strongness). Small mutations may decrease this amount, based on the aminoacid lenght. New AAs will make weak genes.
Genes would be duplicated if they must activate several AAs at the same time:
@10 *.nrg 3000 > and *.robage 500 >
@10 50 .repro store
@11 *.nrg 3000 > and *.robage 500 >
@11 314 .aimdx store
Code viewer may hide the duplicated condition for readability. Though this isn't so neat, it lets evolution be more creative about complex behaviours. Maybe that bot will split gene @11 from the *.nrg 3000 > 'event' and use it as a veg spotting gene.
When a bot reproduces asexually, it reads its own DNA and copies each AA. A new DNA will build up from the resulting 'soup' of aminoacids. Small mutations of the same type may happen then, like changing 'and' for 'not', 3000 for 2493, '>' for '<', etc. Medium mutations may add or remove a whole condition.
If the nexus of an aminoacid (the gene number) is mutated and it doesn't match any other present AA, at the end of the reproduction it will be either:
1) cut off
2) filled with a new one from pattern
If two AAs 'compete' for the same spot, then their age is applied. A new mutation will have little chances to pass over a strong gene that has guaranteed survival during lots of generations.
Sexual reproduction will mean they will create one single soup of AAs from both DNA's. This means genes from parents will 'compete' to create the child:
Parent 1:
@10 *.nrg 3000 > (100000 cycles)
@10 50 .repro store (25000 cycles)
Parent 2:
@10 *.nrg 1000 > (80000 cycles)
@10 45 .repro store (500 cycles)
Both conditions and both commands will fight for the spot, matching their respective strongness or weakness. There's always a chance that a very weak aminoacid will pass over a strong one.
'stop' and 'start' conditions would isolate parts of the code that shouldn't be executed unless they are called to make RNA. They won't execute any command.
RNA would be made by reproducing only a certain range of genes. It may be stored in a new membrane or used as temporary code. It will block the real genes if it has got the same numbers. This one would create a fat cell that would stay idle most of the time, wasting almost no energy, maybe until a conspec comes and stores or takes some energy from it:
@12 stop
@12 ...
@13 *.nrg 3000 >
@13 10 .strbody store
@14 *.nrg 2000 <
@14 10 .fdbody store
@15 start
@15 ...
@16 ...
@16 13 14 rnacell
Or maybe the RNA can be thrown away. Then as some other bot picks it, it may be executed until it becomes waste. Perhaps it is a virus, or a toxin protein, or a happiness/fear/sexual signal.
Here's a venom/toxin that will be run only when it's loaded as RNA (active RNA will ignore stops and starts):
@14 *.refeye *.myeye !=
@14 16 17 rnashot
@15 null
@15 stop
@16 *.myeyes 5 != and *.body 100 >
@16 100 .fdbody store
@17 *.myeyes 5 !=
@17 -2 .shoot store
@18 null
@18 start
@19 ...
@19 ...
A RNA virus would be a protein that replaces 'legitimate' ones, forcing the code to make copies of it without actually damaging its execution. Or maybe just a self copying protein that forces its own execution without caring about which genes it blocks. And maybe it can get mixed during reproduction...
Also, instead of using magic -1 shots to digest targets, bots maybe should use a digest protein that forces the target to shoot energy.
Endy:
Maybe for conditions in the dna, have the value after the next value multiplied by the condition in front. ie.
35 *.eye5 > -1 .shoot store
If *.eye5 is greater than 35 .shoot is multiplied by 1. If not it's multiplied by zero.
If a condition is followed by another condition then that value is multiplied by it's value (0,1).
Numsgil:
I think, Endy, that what you're proposing is still basically a boolean flag. Just with a less arbitrary way of describing how it works, which I like
I agree that I think using a straight flag instead of a stack is the way to go for conditions. However, I would still like to see the logical operations of "or" and "and" both be allowed at the very least (xor and not: maybe, maybe not. I can live without them).
So as I see it, you would need to have store commands either just take the top value from the boolean tack, or "and" together the stack, which really puts us back to the way things currently work.
I think I would favor either a straight flag, which is ANDed with any new conditions, a flag that is ORed with any new conditions (with some "clear" command to set the flag to false), or something similar to the way things work now, with a full boolean stack.
I would prefer an ORing of conditions over an ANDing if it comes to the two (we could implement it as part of the new DNA system I'm working on, so we wouldn't have to worry about backwards compatibility). However, I just can't get past the point that there are going to be times when you'll want to AND and other times where you'll want to OR, so I'm thinking there isn't really a way to get rid of the boolean stack.
Maybe something like this: have store commands use the top value of the stack, with no automatic ANDing or ORing. This would favor the last condition to be evaluated, which would make it easier for mutations I think. Longer conditional chains could be ANDed and ORed together.
@Macadamia - I think moving away from treating the DNA as a strand of undifferentiated beads is the wrong direction. Aside from issues of DNA structure rigidness, alot of what you're trying to see when you run an evosim is what sort of novel genes can arise from mutations that do not respect or understand gene structure.
For instance, suppose a bot inserted the condition *.nrg 5000 > into a gene's condition. Is that really all that exciting? Compare this to something like:
*.body 23 div * 28 100 mult >
Which probably doesn't do anything (I just made it up) but if it did do something, would be the far more interesting mutation. I think it's far more interesting to have valid genes suddenly appear in the frothy soup of stands of randomly assorted base pairs, than it is for a mutation to luck out and produce a fully functional anything in a single mutation.
That said, it might be interesting if we could figure out a way to build a "metaDNA". Something that would be able to scan through the Bot's DNA, correcting errors or inserting new conditions in places, itself subject to mutations. But I have no idea how something like that would work.
Endy:
I've been taking a look at the Evolve4.0 dna structure, since they seem to have something like this already. I do like how they can have conditions daisy chained to each other ie.
'A
start
Some dna here
50 *60 >
stop
'B
start
More dna here
*74 30 >
stop
'C
start
Even more dna
stop
C is activated if the condition in B is true, yet B is only activated if the condition in A is true.
Still a bit rigid in terms of having to call genes to activate them(if not conditionally activated). Seems like it'd be more evolvable if they were always activate like DB's system.
I'm going to take a look at some of their evolved critters and see how the code is currently evolving.
MacadamiaNuts:
Mmh, maybe if just stores didn't work without a true in the top of the stack bots wouldn't get rid of conditions.
So:
0 0 =
Leaves a 1 in the stack. Then the next store would check that first value and if true, would store the second one on the third memory location, leaving the 1 in the stack for the next store.
Stop would clear the true value.
Bots would be able to use almost anything as a condition:
'*.robage start 1 .deltie store' would be activated when '*.robage = 1'
'*.eye5 not' would be the same than 'cond *.eye5 0 ='
'*.tiepres sgn' would work like 'cond *.tiepres 0 !='
And so on. That's 2 expression conditions instead of 4.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version