Darwinbots Forum
Code center => Suggestions => Topic started by: Elite on April 19, 2006, 04:58:55 PM
-
OK, here's my idea
Uses the .sexrepro sysvar (albeit very overhauled)
The process:
Phase 1) A bot stores a number in sexrepro. If there is another bot (bot 2) in front of bot 1 then continue. If not then do nothing
Phase 2) The program brings up bot 1 and bot 2's DNA and compares them, looking for areas of DNA that are common to both bots. If the bots share 70% (or some other threshold) of their DNA in common then procede to stage 3, otherwise stop the process
Phase 3) A special tie (sex tie) appears between bot 1 and 2
Phase 4) The program 'shuffles' the DNA of the two bots. Where the DNA of the two bots differs the program mixes the two bots together:
bot 1
10 .up store
bot 2
20 .tie store
baby:
20 .up store
... or another combination of the parent bots
Phase 5) When the program has the DNA of the progeny, it creates a baby bot between the two parent bots, in the middle of the sex tie, which becomes two birth ties, tying both parents to the offspring. Another option is that only one bot has to 'carry' the baby (mabe the one that fired the sex tie in the first place?)
Thw whole process may take many cycles
Problem is this method does not allow for different sexes or chromasomes, although the ideas of chromasomes and sexual reproduction fit well with codules.
Comments?
Anyone got any other ideas?
-
The only issue is that it depends what scale you're imaging the bots are on.
Microscopic sexual reproducers actually fuse two haploid individuals into one single cell.
Macroscopic critters do this too, but since each parent has billions of other cells it's basically like a new individual is formed independant of the two parents.
I have a thread somewhere on here where I talked about this, let me see if I can find it.
-
OK, how about, rather than having a new bot formed by sexual reproduction just fuse the two bots connected by the sex tie (but slowly), this also removes the hassle with the forming of the new bot
Is it possible make a routine that checks through the DNA for common patches and can give a % difference of DNA?
How about merging chromosomes, codules and sexual reproduction together
I have the beginings of an idea
How about having special 'sex codules'. There are various different types (ie. a female sex codule and a male sex codule), but you can use these to differentiate between male + female bots. They are then used like the X and Y chromasomes, and for coding mating routines.
You neen't be limited to two sexes, but it will be more impractical.
Then you use some kind of tags for DNA that link the two DNAs together so the program can shuffle them
-
Hm checking the whole Dna might be to much work for the programm, although it might be preferable.
Alternatively it might just check for the number of genes and if they are equal it chooses between genes with the same number.
another posibility would be, mixing only the genes that are over 80% identical
-
I think the user should get to decide what sort of scale he's imagining his bots are. Macroscopic Sexual Reproduction / Microscopic Sexual Reproduction.
If it's macro, do like what you first suggested. If it's micro, fuse the two bots.
I agree that codules and chromosomes should be able to be merged. If we could design some system that decide which of two nearly identical codules is "dominant", we could rig up something that would make diploidity possible, which is something of a personal desire I'm not sure others share (though I don't think others are against it either).
As to matching, I think shvarz and I were discussing it a while ago, let me see if I can dig up threads.
Okay, I'm a dismal failure, I can't seem to find it.
I think we were basically thinking we could simulate how real organisms perform cross-overs. You find small chucks of similar DNA and "zip" them up. Whenever there's a problem, you just stop zipping, or something like that.
Let me look again...
-
Diploidity is useful, but not necessary as a bot does not need a backup Dna that is never used.
Also we should avoind making observation more difficult by introducing geno- and phenotype.
Shuffling the code which is quite similar is still the best solution.
-
Clicky (http://www.darwinbots.com/Forum/index.php?showtopic=557&b=1&st=&p=entry)
That talks about the crossing-over technique.
------
Don't you find it interesting that generally speaking sexual creatures have a lifestage where they're diploid, whereas asexual bacteria generally do not?
Diploidity and Sexual Reproduction happen, if I remember right, at the same time in history: the invention of Eukaryotic cells.
If we seperate the two are we sure we're not elimating the advantages of sex? I think we can't be sure. It's better to model it as closely as reasonably possible on real sex and hope we get everything that real organisms find useful.
Here's an article on Diploidy in Alife and GA (http://home.earthlink.net/~paulcarr/cool_tech/multiploidy.html). It proposes that Diploidness is a way to remember past useful solutions in the population without necessarily expressing them.
I'm not sure if I believe that or not, but the fact remains that in nature Multi-Ploidness and sex are inextricably linked. It would be naive to simulate one and not the other in some manner.
A side note, the paper also explores "non-stationary fitness functions". I think that's why organisms become cannis even though canni species are less able to fight off other species.
The fitness landscape is always changing as you allow a species to mutate.
-
Here's what I'm thinking to decide Dominance:
Each codule is passed through some sort of hash function, which assigns to each codule a weight. Codules at the same location (ie: two or more codules at location 46 can be thought of as being polyploid at 46) each have a chance of being called when an organism calls that location with their goto command.
The chance is determined by the difference in the weights of the two codules such that:
chance is 50/50 if weights are equal
chance of executing codule A approaches 0 as codule A's weight << codule B's weight.
Probably a non linear function of the difference in weights. An "s" curve probably Like this picture (http://www.midorimedia.com/images/_fig_1.jpg) where the x axis is weight and the y axis is probability of being selected to be expressed per call.
The result is a system that allows for recessive, dominant, and co-dominant codules.
-
Okay I just thought about something regarding "dominate" codules.
Instead of making new commands to like these, we could work it out similiar to nature (or nearly ):
Making the codule with most commands the dominate. Why?
Becuase in the real world, a genes expressiveness (word? now it is )
is determined by the amount of proteins or polypeptides or whatever it produces. If a genes produces more than another it is expressed, like brown eyes and blue eyes. Were brown eyes are dominate.
If a tie, the program could chose randomly each round, OR it could randomly choose one and use it all life, OR something else.
What do you think?
By the way micro & macro should both be available, in the end it will be much more exciting.
-
Picking the patch of DNA that's longest isn't exactly biologically equivelant. In biology, it's the gene that's pushing harder: ie: copying more proteins than the other recessive gene, that's produced.
I don't think it's a bad idea necessarily, but I'm not sure I want to be selecting for genome length. Problems with viruses comes to mind.
-
Okay Num posted just as I wrote my post. But commeting Nums idea, I like it much more than my own. The only problem I (think I) see is it will be a bit arbitary hash function. Maybe we could incoporate somekind for parser that parses the codules and translate it into a hash function and then let the codules go through the hash function, so the hash function is basical evolving alone the samelines as the codules them selves?
Picking the patch of DNA that's longest isn't exactly biologically equivelant. In biology, it's the gene that's pushing harder: ie: copying more proteins than the other recessive gene, that's produced.
I don't think it's a bad idea necessarily, but I'm not sure I want to be selecting for genome length. Problems with viruses comes to mind.
I can see it my self, it is arbitary.
-
I'm not against letting the hash evolve with the bots. We could define the hash function as a codule itself. Say, location -1 or something like that, and we could have polyploid hash functions (though that sounds like an awful mess to me, I might suggest we stick strictly to haploid for hash functions)
It would have to follow some specific rules that are a little different from the rest of the DNA. Maybe put the genome its hashing on the stack (first type, first value, second type, second value, etc.)
-
It could be nice. Then an arbitary design decision is moved back to the program and evolution. Hm... we could also have an option to bypass this so we could have a hardcoded hash function, if people dont what to use these, or for debugging etc.
-
We'll probably need to come up with a default function anyway since old bots obviously aren't comming with their own hash function
-
Ok I have to speak a word of power, introducing randomness into the bots Dna execution is a really bad bad BAD idea.
As it is, we often are not even able to understand what evolved code does because of all the junk that does nothing making the whole thing unpredictable is a serious desgn question that should not be made so lightly.
Also, do not try to mimick the physical mechansim of real life so closely , darwin bots is a world of its own and its needs its own solution.
Regarding diploidity, of course it has many functions (exspecially securing the diversity of the genepoool to some degree)but basically its the easiest way to mix genes without changing the total number of genes. You can not split and remix a haploid Dna set with another that easily in real life right?
Also diploid chromosomes are running parallel I think , this can be done because it just changes the amount of proteins etc that are made, but if we execute a gene twice and inc a memory location twice instead of one time, this can totally screw up something, which is why we have the problem of deciding externally which genes would be dominant ,executed etc.(Well its not that great aproblem, but still to point out the differences)
Well, I have tought a little bit of the general idea of sexual reproduction and the whole concept is I think to pass on genes that have useful mutations independant from the other genes, which then are tested by evolution for their usefullness.
That said we look for solution that do not produce a large number of "bad gene" childs so I think we should either stick on a scale of complete genes being shuffled or try not to exchange Dna, but rather to exchange
Mutations which are different.( this might still need some checkup of "compatibility" before reproduction, but maybe the bots would just decide that themselves?)
-
As to DNA complexity: we have a hard time deciphering DNA now because we have to do it by hand. I'm working (off and on) on an in program step by stem DNA debugger that should make such issues moot. If we limit the DNA to be easily understood by people we're really just limiting the complexity of the primary source of, well, complexity.
As to randomness: Initially I was like you and found the idea of non-deterministic DNA flow repugnant. However, as I play more and more with the program and the bots I realize that a little bit of randomness isn't going to hurt anything. If it's really terrible, bots will evolve to avoid cases of co-dominance.
If 90% of genes are clearly seperated into "recessive" and "dominant", while something like 5% or 10% are co-dominant, (that is, we make the s curve really steep) I think that's a fair balance.
-
I don't like the idea of random dominance. A gene should be dominant because of what it does not beceuse of some random chance. Let's consider the example of eye color: you get blue eyes if you make a small amount of pigment, you get dark eyes if you make a lot of pigment. So if you are a heterozygote carrying both variants of this gene, then "blue" copy makes a bit of pigment and "dark" copy makes a lot and final amount is "a lot". The "dark eyes" variant wins not because it just happened to win, but because it is functionally dominant.
To truly reproduce dominance we need a very simple thing: when a DNA program stores values into memlocs it does not replace the value that's already there but sums the two up.
-
Oh yeah, I get what you're saying
So that's having two (or more if you want to be triploid and awkward, or less if you want to be haploid - simple and loose out on sexual reproduction) seperate sections of DNA, executing both at once and summing up the stores into sysvars of each section.
I like that idea
Just seperate each 'chromosome' (split the 'root codule' into 'chromasomes') into two (or other number) sections
You could also use some like X and Y to decide the sex of the bot and control mating
-
As I understand it, there is no correlation between phenotype fitness and dominant/recessive.
Assuming that evolution works primarily on phenotypes, I don't think it matters if a phenotype is dominant or recessive so long as there is a possibility of either.
Taking eye colour as an example, it could, from our human perspective, be the other way around. Blue could be alot of pigment. The phenotypes aren't well tied into the genotype's dominance.
Hence I don't think it matters if the ability to determine dominance/recession is arbitrary, because to phenotypes in nature it already is.
-
Just some entirely related thoughts, but ones I am really pleased with
How about swapping codules around as a form of horizontal gene transfer, keeping the root DNA but using viruses/gene-pumping ties (or the method below) to swap around codules like bacteria swap plasmids. You could use this either to:- Gain an entirely new piece of code from another bot (ie. a new antivirus code or a new trick that some other bots have evolved)
- Use a different piece of code for a task one of your codules was already doing, temporarily 'deactivating' or discarding your codule that the new one replaces
Maybe we need a new way of swapping DNA. Like in/out except putting whole codules in there 'on display'.
.ingene1
.outgene1
That allows bots to read codules of DNA of other bots in line of sight. This also gives them more choice about who they accept genes off, whereas viruses don't (if you don't want it then tough - it's in your genome anyway). Maybe you could have a bot that accepts genes off conspecs with more kills/energy/age than them - survival of the fittest.
Ah, a moment of genius
What do you think?
-
Actually Elite, that's what I had in mind too
So I obviously like it.
-
Actually Elite, that's what I had in mind too
So I obviously like it.
Great minds think alike huh?
And I am also thinking that if we chop bots up into many codules it will make it much easier to shuffle the DNA of two bots. Species could be determined by the root DNA compatability with the codules and root DNA (and DNA shuffling routines) of the next bot. This will also make it pretty hard for non-conspecs to have a child
Hey, should we let bots shuffle their own DNA using a special codule that controls sexual reproduction? Maybe this codule could be the X/Y sex-determining one too?
-
I was thinking that codules that are paired together that aren't equivelant will fail at their cross-over events.
The result would be if you were to have two chromosomes not at all equal they could act as effective sex genes, since they would never cross over and would be essentially haploid.
Not quite analogous to real biology since real sex chromosomes are more two seperate chromosomes that are haploid instead of a single mismatched diploid chromosome, but the effect is similar.
-
As I understand it, there is no correlation between phenotype fitness and dominant/recessive.
Assuming that evolution works primarily on phenotypes, I don't think it matters if a phenotype is dominant or recessive so long as there is a possibility of either.
Taking eye colour as an example, it could, from our human perspective, be the other way around. Blue could be alot of pigment. The phenotypes aren't well tied into the genotype's dominance.
Hence I don't think it matters if the ability to determine dominance/recession is arbitrary, because to phenotypes in nature it already is.
Well, but in nature it is the combined effect of both alleles that is being tested. In your scenario the color of the eye switches randomly from "blue" to "dark".
Also, I don't really like that it works on whole codules. Single genes would be better.
-
Yes, I agree that the all or nothing dominance of whole "chromosomes" seems something of a failing.
That said, it's not without precedance. Specifically a similar appraoch was used by "Kim, Kim, Lee, Cho and Lee-Kwang" in a paper called "Winner take all strategy for a Diploid Genetic Algorithm.”
I can't find a link to the paper, but the site I gave a while ago above says [They] employ a winner-take-all approach to diploid dominance. In their research, each chromosome is evaluated independently, and the fittest chromosome is expressed in the phenotype. Once two parents are selected, they perform crossover first on the two dominant chromosomes to generate one offspring, and then on the recessive chromosomes to generate the second offspring. In addition, they allow for some small probability of “dominance mutation”, I.e. the dominant and recessive chromosome switch places before crossover.
While not exactly similar, it does show someone else trying to use a all or nothing dominance/recessive method for a whole chromosome.
The problem is that the DNA for Darwinbots is about as far from biology as you can be and still call it "DNA". As such, biological solutions are difficult to shoe horn onto the problem. Bio DNA has several abstraction levels between code and effect that DB does not. DB's DNA is more like the net effect of all the proteins in an organism instead of the DNA coding for the RNA that gets spliced together to form the proteins.
---------------------
I was thinking about what you suggested, having store simply add instead of replace. While I think it's an interesting idea, I'm not sure if it addresses the problems of dominance/recessive for three reasons:
1. Values in Darwinbots for memory locations aren't normalized. For instance, *.eyeX returns values up to about 100. *.aim gives values in the range [0, 1256], tielen could potentially go up to 1000, etc, repro takes values in the range [1, 99], delgene takes potentially values from 0 to infinity, though realistically it's probably in the range [1,100]. refxpos and refypos range the whole gamut from [0, 32000].
As a result, it's difficult to assume that bots with larger values are trying "harder". It becomes somewhat difficult to provide a strictly downard force. This is sort of a weak reason I'll admit.
2. It works on stores instead of "genes". Whereas my idea suffers from applying the dominance/recessive to too high above the gene level, you're idea works below the abstract gene level. It's just trading one potential problem for another in this regard.
3. If two genes both say to turn 10 degrees, I think most of us would expect the bot to turn 10 degrees instead of 20. Several genes that all agree with each other should provide a reinforcement for the behavior instead of amplification.
-
Hmm, until now I had a problem with the usefullness of codules in natural evolution, as a evolving bot can not decide which genes are important enough to be basic code.
However now I have an idea: How about codules are just differentiated from normal genes trough trough a tag saying "codule" then these tags sometimes could be added or deleted by a certain form of mutation.
Oh and please stop speaking of gender as long it does not serve a practical purpose, I mean if the reproduction
takes the equal resources from each bot gender only makes it harder to find a partner, if you introduce gender
then only if you plan to make a unsymetrical reproduction. (the female gives birth to an unfertilized egg(bot)providing it with energy and another bot inserts only its share of the dna for example)
-
Gender: I'd like to have a system where gender is not enforced by anything except the bots. ie: if your bots have gender, so much the better. If they don't, then they don't. There's nothing biologically that prevents us all from being hermaphroditic, so while gender is important I don't see it as something that should be added on the system level.
"Support, do not enforce"
Codules: I'm not certain if you're understanding what the premise of codules is. Codules are not analogous to genes, they contain genes.
-
"Support, do not enforce"
Good strategy
If you really want eight sexes ...
Codules: I'm not certain if you're understanding what the premise of codules is. Codules are not analogous to genes, they contain genes.
I understand that. Yeah, on reflection maybe it is better to have genes paired up rather than codules
However, I like my 'sex codule' idea too. That also gives more freedom to code for males/females (and any other sexes that you might want) rather than cramming it in to one gene. Rather than mimicing real life you could have an X codule or a Y codule: Mommy sends an X codule, daddy sends a Y codule and the bot deletes one at random to decide the bot's sex.
I like my/Num's codule swapping idea though, and the in/out for DNA idea. I think I'll start a new thread for those.
-
If I understand codules are something like hause numbers in whcih a gene can reside, these numbers can be addressed by other genes and you also added some complicated system of codules calling other coduls if empty.
However what I am saying is, that there is not necessary reason to differentiate between the numbers currently used for genes and numbers for codules.
Instead of having two totally independant Dnas that work differantly, see it as two folders where it can happen that one gene stored in the one folder can instead be switched by mutation in the other folder.
-
However what I am saying is, that there is not necessary reason to differentiate between the numbers currently used for genes and numbers for codules.
Instead of having two totally independant Dnas that work differantly, see it as two folders where it can happen that one gene stored in the one folder can instead be switched by mutation in the other folder.
I'm not sure exactly what you mean, but let me clarify this and see if it matters:
Part of my recent work on the program is to take the idea of a "gene" away from how the system handles DNA. The flow commands turn on/off other commands, they are not in some way special. They only demarcate the DNA into genes to human readers. The DNA strand itself, as far as the program should be concerned, is just a collection of random BPs.
So as many things as I can I'd like to move from the gene level onto some other abstraction, and codules seems a good target.
I'm talking about things like viruses, delgene, thisgene, etc.
I say this only because I think you reference gene numbers in your post, and I want to clarify. Beyond that I'm not sure what it is you're suggesting.
edit: I think I understand now. You want the genes to be assigned to codules, so that genes next to each other are not necessarily under the same control mechanism.
My above point is relavent then
-
3. If two genes both say to turn 10 degrees, I think most of us would expect the bot to turn 10 degrees instead of 20. Several genes that all agree with each other should provide a reinforcement for the behavior instead of amplification.
This can be easily avoided using existing DNA rules. The second gene can check what is already stored in the location it wants to modify and adjust for that. So in your example the second gene would subtract the value stored in .aimsx from the value it thinks needs to be stored and store that.
Say gene 1 stored 10 in .aimsx and gene 2 thinks that the value should be 30. It goes
30 *.aimsx sub .aimsx store
this will subtract 10 from 30 and write 20 into aimsx bringing the value to the necessary 30.
-
Just add the values and half them, that would be easier fo numbers that relate to quantity only the reading of memory locations stays problematic. (up +aimdx= sx <--- rather strange)
-
What if there are then three values being stored there. Or eight? Or a million?
shvarz - My point #2 still holds then even if 1 and 3 can be worked around within the DNA.
-
Thought about it in terms of implementation and see another issue:
If you are just having store be additive, I'm assuming you're executing both codules in a diploid pair, right?
How do you decide which one gets to go first and which one gets to go last. The one that goes last has the potential to overwrite any that come before (*.up - 10 add .up store), effectively making it somewhat "dominant". We run into the same problem as before.
Again, I think additive store is an interesting idea, I just don't think it solves the problem of dominant/recessive.
-
I can't say I understand the #2 completely. I just re-read it and I still don't get it. Are you saying that ideally you would want "dominancy" to apply specifically to a gene? As in "to a certain string of DNA commands"? That does not make much sense. Dominancy is a term applied to the phenotipic outcome of gene expression. The term relates to phenotype, not to genotype.
And it does not have to relate to two copies of the same gene located on two paired chromosomes. In fact you can have several genes on the same chromosome and one of them would be dominant. Or you can have two completely different genes and one of them would have a dominant effect over the other.
Say you have a chain of reactions A->B->C with enzymes AB and BC performing the two reactions and expressed from two different genes. Deletion or mutation in the gene AB (stopping the reaction A->B) will have dominant effect on this process over anything that might happen in gene BC. S
So dominancy should work on stores, which is the analog of phenotype in DB.
There is one example where things go the way you envision them. Human females have two X chromosomes, but only one of them is active. The other one is completely inhibited. I'm not sure how it is decided which one is inhibited. I think they "duke it out" early in development and then it stays that way for the rest of the person's life. There the dominancy indeed works on "above the gene" level. But it is more of an exception than the rule.
-
Bots' DNA is somewhat phenotype in nature, which is what I'm getting at. There isn't as strong a segregation between phenotype and genotype in Darwinbots as there is in real life.
-
Only as far as senses go. The reaction to stimuli is storing values into memory location and there the phenotype is clearly separated from genotype. Or am I missing something?
-
Bot DNA is inherantly linear, with memory locations directly effecting the bot's behavior.
Real DNA is inherantly parallel, with all sorts of processes going on at once. Proteins made in the DNA also stick around even after the transcription of that protein has stopped.
Real phenotypes are a result of all those proteins and their dosages interacting.
Bot phenotypes are the result of the values in memory at the end of a cycle. There are no long term effects and the last store has far more power than the first store in deciding the action of the bot (even with additive stores).
I'm just not sure you can parallel the Bots' DNA and real DNA and use a solution that relies on parallelity that developed on a parallel DNA strand (real life).
Also, I'm not sure if you saw this post, I think I wrote it while you were replying. Clicky (http://www.darwinbots.com/Forum/index.php?s=&showtopic=1264&view=findpost&p=1366176).
-
There are no long term effects and the last store has far more power than the first store in deciding the action of the bot
That's a good point, but I don't think this blurs the line between phenotype and genotype. It only makes the phenotype to change so much faster.
Bot DNA is inherantly linear, with memory locations directly effecting the bot's behavior.
Yes, and right now any gene that goes last is by definition dominant. The additive store would be a step in the right direction then, because by default the genes are going to cooperate, not compete. Only with the trickery they will become dominant and only those that go last. I don't see it as a big problem, after all if bots choose to do this, then there is a need for the gene to grab all the power and that's OK. Because of that we don't have "decide which one gets to go first and which one gets to go last." By default it would not matter.
I want to point out that the additive store is already available through the same trickery. So you could argue that if bots need it, then they can evolve it. Yet I think that making the additive store to be default is the step in the right direction.
I'm just not sure you can parallel the Bots' DNA and real DNA and use a solution that relies on parallelity that developed on a parallel DNA strand (real life).
With this I agree completely. We need to make a list of what we think the goals of introducing a more detailed rules for "dominance" are and then go from there and pick the most sensible solution for those goals.
-
That's probably a good idea. My goal with introducing dominance and multi-ploidy is to allow large stretches of potentially functional DNA to remain in the population without being expressed.
A major drawback to most ALife sexual reproduction, in my eyes, is the use of haploid genomes only. Creatures 3 is a good example of this. It serves its purpose, but reverses the order of several actions.
In real life DNA during meiosis crosses over with itself inside the parent. In ALife haploid sexual reproduction, the two parents' DNA crosses over against each other.
Assuming that it doesn't matter (which is obviously the decision made by many alife designers, and while I don't agree it's obviously good enough for most purposes) I think in DB the answer would be to use the current haploid DNA strand, perform the cross overs, and give each sex partner one of the two new DNA strand to decide what to do with it (should I make this into a baby or not).
Of course, doing this means that you can only simulate macroscopic sex. Fusing two cells becomes a little more difficult, since you must pick one of the two new strands to use for the genome. I guess you could just choose randomly.
The main advantage of diploidness I see is that it makes sexual reproduction in DB closely analogous to real life. We wouldn't be throwing the baby out with the bathwater, so to speak.
-
I was thinking maybe allow the bots to select which genes from amongst the two dnas to express. It'd have to be limited to the birthing cycle to limit continual use.
We could also have it where the dnas are mixed but limited in size to the size of largest genome of the two bots. This way we wouldn't have the continual gene addition that plagues bots using viruses to spread genes.
-
But how do the bots know which of the two to express? What sort of differentiation can we give the DNAs from the bots' perspective.