Author Topic: Bringing back .sexrepro  (Read 9402 times)

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
Bringing back .sexrepro
« on: November 08, 2007, 02:31:06 PM »
You can make .sexrerpo possible by grouping simular commands under cromozones.  Robots need to see each other to reproduce (I might add restrictions later like the robots must share 50% dna to reproduce)

I ran into some problems; I will wait after gene structure gets done.
« Last Edit: November 15, 2007, 01:39:21 PM by Botsareus »

Offline Peter

  • Bot God
  • *****
  • Posts: 1177
    • View Profile
Bringing back .sexrepro
« Reply #1 on: November 15, 2007, 04:49:53 PM »
Okay, *warning* I have a feeling I am going to say something stupid.

Bot1 and bot2 together create bot3.

So you get the even genes from bot1 and the uneven from bot2

If bot1 has 10 and bot2 10

Then bot3 gets

from bot1

2
4
6
8
10
from bot2

1
3
5
7
9

The genes get then sorted like 1,2,3,4,5,6,7,8,9,10, it is simple.

if bot1 has 4 and bot2 has 7

from bot1
2
4

from bot7
1
3
5
7

The sorting goes like 1,2,3,4,5,7

In this case you probably get from different species, some non really living ones aka non funtioning 100% there could happen some interesting things. Different species can't sexrepro in real live eather. Have ever seen a cat-sheep, well have you.

With the same specie you get probably good children, becouse the genes are mostly in the right order.


My idea is pretty simple and there has been some talking about this(in times I wasn't around here), that I think something is completely wrong with my idea.

But okay what is wrong with my idea, I want to know.
Oh my god, who the hell cares.

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
Bringing back .sexrepro
« Reply #2 on: November 29, 2007, 02:20:19 PM »
 corrected (I realized you can revice the system, by running the same dna for multi outputs. I know you people still don't have a clue what I am talking about, but I promise to post examples as soon as I write them out. The general idea is currently in my head...)

"some non really living ones aka non funtioning 100% " I know how to fix that little part. It means the dna will run * 2 or * 3 times slower but I think its worth it... I have yet to write my thoughts out on paper before I type them... stay tooned , thats all I want to say. , thanks...

* 2 or *3 slower I mean (don't ask yet)

a robot with 20 commands will run 40 to 60 commands. Stay tooned.

Quote
(I might add restrictions later like the robots must share 50% dna to reproduce)
I leave this up to the bots. But, onless its e-grid mode the bots cannot reproduce with the plants. And the simularity limit does not go above 90%
« Last Edit: November 30, 2007, 10:21:18 AM by Botsareus »

Offline Testlund

  • Bot God
  • *****
  • Posts: 1574
    • View Profile
Bringing back .sexrepro
« Reply #3 on: November 29, 2007, 08:05:24 PM »
Quote from: Botsareus
(I might add restrictions later like the robots must share 50% dna to reproduce)

Why not at least 99%? All mammals share 99% of the genes but can't reproduce with other mammal species. With only 50% it would be like a human trying to mate with a mushroom!
The internet is corrupt and controlled by criminally minded people.

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
Bringing back .sexrepro
« Reply #4 on: November 30, 2007, 12:36:06 AM »
Quote from: Testlund
All mammals share 99% of the genes but can't reproduce with other mammal species. With only 50% it would be like a human trying to mate with a mushroom!
This is not strictly correct.  All mammals do not have 99% of their genes in common.  In general, the percentage is quite a bit lower.

If you just compare DNA without looking at genes or considerring what is under selective constraint, the difference is large.  Chimps and human DNA differ by about 2% accross the entire genome.   Gorillas and humans by about 3% and so on until you get to the most distance mammals from humans (where the common ancestor is more than 100 million years ago) such as the platapus where it's like 50% I think.  Humans for example have "lost" 100's of olfactory genes which dogs and many other mammels still posses.  In our genomes, they have become pusedogenes - fossil genes - and have mutated greatly since they are no longer under selective constraint tho you can still trace their ancestory.

If you just look at working genes which can largely be assumed to be under conserving selecton pressure, it is true that a large percentage of genes in mammals are shared tho it is still quite a bit lower than 99% and there are many polymorphisms along the diffent evolutionary braches even for shared genes.  That is, the genes may be homologous and perfrom the same function, but they may differ greatly in their actual coding and fucntion.

Regarding .sexrepro, as I have stated elsewhere in depth, I am very strongly opposed to hard coding into the simulator any concept of sexual reproduction including any concept of assumed genetric structure, chromozones, recombination strategies, mate selection, etc.  So, while others are of course welcome to implement whatever they like, I will not be making .sexrepro work.  Period.

What I am totally willing to do is to enhance the base mechanisms for sharing DNA between willing bots so that sexual reproduction can be better hand coded or evolved in the bot DNA itself.  If someone would like to propose enhancements to this end, I would be very willing to entertain and potentially implement them.   Such suggestions could be in the form of better DNA range selection mechanisms beyond .thisgene, enhancements to viruses, asexual reproduction with a specified subset of DNA, sperm shots, etc.  I view these are low level mechanisms which can be used for sexual reproduction but also potentially for other purposes and in particular, do not put constraints upon DNA structure, recombination method or mate selection.

Let me say it again so I am clear.   Any proposal which requires a specific DNA structure, recombination algorithm or mate selection method (such as simple proximinty) for sexual reproduction is a nonstarter in my book and will not be implemented by me.
« Last Edit: November 30, 2007, 09:50:21 AM by EricL »
Many beers....

Offline Welwordion

  • Bot Destroyer
  • ***
  • Posts: 325
    • View Profile
Bringing back .sexrepro
« Reply #5 on: November 30, 2007, 04:49:04 AM »
Due to my current main project, a gene based template robot (stores numbers and commands in different genes) I have experimented quite a bit with a scheme that mixes two bots genome(A mutated  offspring for the numbers and a non mutated for the commands) and I must say the main problem in current gene transfer is that genes have to be in a certain order to work, thus you need to delete the complete/ a large part of the genome and build it from scratch which is time consuming and costly.
However as the fact that virus can only be inserted at the end of the genome is to allow antivirus genes to work,
I came up with an alternative that keeps that property of viruses.
Basically allow either a variant of .delgene or  .sexrepro to replace genes with interfaces, placeholders that  in turn are replaced by viruses.(filled up from bottom to top)

That way certain genes can be exchanged without disturbing the order of genes and without allowing viruses to do freely as they want.

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
Bringing back .sexrepro
« Reply #6 on: November 30, 2007, 10:23:57 AM »
Quote from: Welwordion
Basically allow either a variant of .delgene or  .sexrepro to replace genes with interfaces, placeholders that  in turn are replaced by viruses.(filled up from bottom to top)

I'd be interested in understanding more details on what you propose and how it relates to the discussion on this topic here and the sequence based poposal I make there for virus insertion.
Many beers....

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
Bringing back .sexrepro
« Reply #7 on: November 30, 2007, 10:28:46 AM »
(see correction to the above post.)

Quote
enhancements to viruses

Here is what I will program, and propose:

As soon as the robot evolves a virus shot. In the dna the following happens:

Quote
virus_start virus_end

after words Independently of the rest of  the dna the virus part of the dna filles with commands every time the robot mutates ex:


Quote
virus_start
A 'condition
B 'action
C 'etc.
virus_end
« Last Edit: December 06, 2007, 02:21:45 PM by Botsareus »

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Bringing back .sexrepro
« Reply #8 on: November 30, 2007, 04:20:02 PM »
Quote from: Welwordion
However as the fact that virus can only be inserted at the end of the genome...

It's been a long time since I looked in to it, but I believe that viruses get inserted anywhere in the genome between two other genes.  I think there was (is?) a bug that prevented viruses from being inserted in either the very first or very last position, that made anti-virus especially useful.

Either way, viruses just aren't a good way to totally mix two different genomes.  It takes time to copy DNA in to a virus (I think it's 2 cycles per bp or 2 bps per cycle), viruses take a lot of energy to produce, relatively speaking, and there's too huge a chance of something going wrong to make it a viable reproductive strategy.

Also, while I appreciate Eric's position on not implementing recombinant strategies explicitly, the process of properly lining up two DNA strands and performing cross-over events is just way outside the domain of DNA, and doesn't match the relatively high level tools involved in other places (want to reproduce?  Store a positive number to .repro).  At the very least, I think that process needs to be implemented and made available to bots in some way.  The number of cross over events can be controlled through DNA, and when and how to find two DNA strands and what to do with the new one can be controlled by the bots in some way, but the core process of mixing to DNAs is just way too complex and basic a task.

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
Bringing back .sexrepro
« Reply #9 on: November 30, 2007, 08:20:33 PM »
Quote from: Numsgil
It's been a long time since I looked in to it, but I believe that viruses get inserted anywhere in the genome between two other genes.  I think there was (is?) a bug that prevented viruses from being inserted in either the very first or very last position, that made anti-virus especially useful.
This is correct.  A quick inspection of the code shows that the intent at least is to insert the virus after a random selected stop statement.  I have not walked through it lookign for bugs or to test the boundary conditions, but this is clearly the intent.

 
Quote from: Numsgil
Either way, viruses just aren't a good way to totally mix two different genomes.  It takes time to copy DNA in to a virus (I think it's 2 cycles per bp or 2 bps per cycle), viruses take a lot of energy to produce, relatively speaking, and there's too huge a chance of something going wrong to make it a viable reproductive strategy.
I agree.  Viruses are a cumbersome way to sexually reproduce today.  While I think it can be done today, it is fragile and time consuming as you say and I agree we need something better.  This is why I am soliciting suggestions as to better methods for willign bots to share DNA, one's which perhaps do not have the same cost w.r.t cycles.  And it's  2 cycles per bp.

Quote from: Numsgil
Also, while I appreciate Eric's position on not implementing recombinant strategies explicitly, the process of properly lining up two DNA strands and performing cross-over events is just way outside the domain of DNA, and doesn't match the relatively high level tools involved in other places (want to reproduce?  Store a positive number to .repro).

So here I disagree.  Asexual reproduction through .repro is essentailly cell division.  It can be simple because it is simple.   You divide, the new cell gets the same DNA as the old.  Simple.  There's no real reason not have the simulator handle all the underlying mechanics for this because there isn't a lot of variation possible in how to do it other than what poercentage of your resources to give the offspring, which we allow the DNA to specify.  There's no possiblity of time shifting cell division for example, no possibility of not being in physical proximity when it happens, no need for specieis recognition or mate selection, etc.

But there is a vast multitude of possibles ways to sexually reproduce, for two bots to coordinate in how, when and where to to produce an offspring that has DNA from both.  One bot lays eggs, another comes along hundreds of cycles latter and fertilizes them.  Another scatters pollen shots to the wind and reproduction only happens when a female gets polinated.  A male and a female have sex through ties and the female carries the sperm DNA from the male around for awhile before giving birth.  A female "kills" the male by injecting it with her DNA which casues it to recusively reproduce offsprign with DNA from both, etc.  

We want evolution to be able to produce all of these ways of combining DNA, all these behaviours and all that goes with them, from species recognition to courtship and sexual selection to male-male competition for mates.  In particular, we do not want to hard code only one way into the simulator.    

I think there are some simple ways for bots to do crossover themselves if we gave them some low level basic primitives to enable it.  It needs some fleshing out, but I might propose a model like the following:

We create a crossover point base pair that does nothing other than decorate the DNA and define places to cut it for the purposes of crossover and recombination.   There can be as many crossover points in the DNA as a bot likes, they can be anywhere in the genome, inside of genes or out.   Then, we provide a .mkgamate sysvar which causes reproduction but with only half the bot's DNA.  The "offspring" would contain every other alternating section of DNA between crossover points.  Think of it as an egg.  We could even just reuse .repro and use negative numbers.  We could make an even value take the even sections and an odd value take the odd....

Then we could define a shot type that did the same thing I.e shot a "sperm" shot with the gamate DNA.  The act of a gamate shot hitting an egg or vice versa would combine the two gamate DNA strands.  Note how simple this is.  If an odd sperm shot hits an even egg or vice versa, you get perfect alignment if the species are the same or close to it and you can expect the offspring to be largly functional.  What we do in odd-odd cases is up to us.  I assume we do nothing and you end up with a disfunctional mutant bot.  

We could implement a .shareDNA that does the same thing using ties for syncronous sexual reproduction and so on.

We put no restrictions on sex between disimilar species - we do not want to get into the game of the simulator definign what is and is nto a species - but crossing over radically different DNA will likely naturally result in a disfunctional mutant, creating selection pressure towards better species recognition.

The point is that now everything is in the DNA, not the simulator.    The number of cross over points, qwhere they are in the genome, species recognition mechnisims, the method of sex itself, whether it is time displaced involving eggs and sperm shots or syncronous with ties or some other means, etce. and it is all subject to mutation and evolution.   All we did was provide a simple mechanism to facilitate it.

Quote from: Numsgil
At the very least, I think that process needs to be implemented and made available to bots in some way.  The number of cross over events can be controlled through DNA, and when and how to find two DNA strands and what to do with the new one can be controlled by the bots in some way, but the core process of mixing to DNAs is just way too complex and basic a task.

So maybe we are closer than we think.  I agree with the above execpt for the last 17 words.
« Last Edit: November 30, 2007, 08:25:14 PM by EricL »
Many beers....

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Bringing back .sexrepro
« Reply #10 on: November 30, 2007, 09:35:49 PM »
Yeah, I think we're pretty close too, we're just using vocab a little differently.  When I say mixing DNA, I'm referring to the process that goes on inside a cell undergoing meiosis.  This is the part of the process that's too complex for our DNA.  And to boot, it's pretty boring since the process developed before the Cambrian and has been well conserved for billions of years across all eukaryotic life.  Where to get two strands of DNA and what to do with the new strand is the interesting part.  Combining the two strands in to one can only be done well in one way.

The natural process is very robust to mutations, especially insertions and deletions.  This is essential.  I'll provide a quick overview, but you'll want to find some independent sources (like wikipedia).  The two strands are unwound from their chromosomes into two loose, long strands.  Special proteins all over the strands act like the sliders in a zipper (I know you know what a zipper is, but this has a good animation), "zipping" up the two strands as long as they're the same.  DNA sections that aren't similar aren't zipped.  Crossover events then happen on these zipped up sections an arbitrary number of times at arbitrary locations (the process isn't important (Holiday junctions), but the results are).

A quick example, consider the two strands:

ABCDEabcdeFCGHIfcghiXYZ and
ABCDEFCGHIXYZ

the capital letters get zipped to like capital letters, and the lower case letters would form passive loops.  After cross over events, the result could look like this:

ABCDEabcdeFCGHIXYZ and
ABCDEFCGHIfcghiXYZ

Those differences in the first DNA strand go along for the ride as the strands swap.  The benefit here is that the DNA is a passive passenger along for the ride.  Meaning you don't have to add tags like CROSSOVER_POINT in to the DNA-- every point is a potential cross over point, whether inside a gene or not, as long as it has a mirror in the other DNA strand.

The number of cross over events should probably be determined by DNA.  The location of the cross over points in nature is (mostly) random, but we could add control in if we really needed to.

An important distinction here: in nature, organisms perform cross over during meiosis.  In Darwinbots, where diploidness isn't supported, even for a second (primitive sexual reproduction involved haploid organisms fusing for a short time, performing crossing over, then splitting using meoisis), we need to perform crossing over events when the two DNA strands meet, not when they part.

Another interesting point here is that crossing over usually produces two new strands.  I'm not sure if this would be useful or if we should just toss one of the resulting threads.

I'm for all sorts of interesting methods for a bot finding another strand of DNA to cross over with, but I don't have any ideas at the moment.
« Last Edit: November 30, 2007, 09:38:55 PM by Numsgil »

Offline Welwordion

  • Bot Destroyer
  • ***
  • Posts: 325
    • View Profile
Bringing back .sexrepro
« Reply #11 on: December 01, 2007, 06:07:27 AM »
Quote from: Numsgil
It's been a long time since I looked in to it, but I believe that viruses get inserted anywhere in the genome between two other genes. I think there was (is?) a bug that prevented viruses from being inserted in either the very first or very last position, that made anti-virus especially useful.

Quote
This is correct. A quick inspection of the code shows that the intent at least is to insert the virus after a random selected stop statement. I have not walked through it lookign for bugs or to test the boundary conditions, but this is clearly the intent.

I think you should look into it again my bot I attached creates (in most cases) a perfectly alternating patterns of genes, which should not be possible if genes would be inserted randomly (and I would like to keep it not random)  

Test the bot in 2.43t with 30k energy and no brownian motion(you might also consider reducing the costs vor viruses)


As for crossover points thumbs up, a good idea.

Quote
Either way, viruses just aren't a good way to totally mix two different genomes. It takes time to copy DNA in to a virus (I think it's 2 cycles per bp or 2 bps per cycle), viruses take a lot of energy to produce, relatively speaking, and there's too huge a chance of something going wrong to make it a viable reproductive strategy.

Viruses are bad in transfering large, amounts of Dna but the would have their value in transfering certain genes, if they would insert into the right position or the transferred gene is pretty much isolated from the effect of other genes.
So I vote to implement placeholders for viruses nevertheless although the asynchronous crossover system described by Ericl is already a more powerful, larger version of this.
« Last Edit: December 02, 2007, 06:20:42 AM by Welwordion »

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
Bringing back .sexrepro
« Reply #12 on: December 01, 2007, 12:46:03 PM »
Quote from: Welwordion
I think you should look into it again my bot I attached creates (in most cases) a perfectly alternating patterns of genes, which should not be possible if genes would be inserted randomly (and I would like to keep it not random)
Found it.  There was a line of code overriding the virus insertion position so that it always got inserted at the end.  In 2.43u, the insertion point of a virus is now a random choice selected from the set of positions which include the very beginning of the genome, the very end and right after all stop statements.
Many beers....

Offline Welwordion

  • Bot Destroyer
  • ***
  • Posts: 325
    • View Profile
Bringing back .sexrepro
« Reply #13 on: December 02, 2007, 06:23:40 AM »
First sorry that I had forget to attach my bot, I corrected that.
Second I should have shut my mouth if you have changed that, cause its just makes thinks harder and my template bot impossible. What in hell makes you think that inserting viruses at random points is an improvement?

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
Bringing back .sexrepro
« Reply #14 on: December 02, 2007, 01:05:37 PM »
Quote from: Welwordion
Second I should have shut my mouth if you have changed that, cause its just makes thinks harder and my template bot impossible. What in hell makes you think that inserting viruses at random points is an improvement?
Whoops.  Sorry, I thought you wanted this change.  I should read things closer I guess.  It's not that I fiuxed this becuase I necessarily thought virus insertion should be random, I just fixed it cause it was easy to make the code work the way it looked like it was intendend.

So, what should we do?  Hmmm.  I want to change the virus paradym to use matching DNA sequences for insertion points instead of gene boundaries, but that is probably post 2.44 work, so lets think about what can be done for 2.44 to address sexual reproduction using viruses.  

On the one hand, when I think of a viruses as a self-propagating, autonomous agent or as a weapon, I like the idea of random insertion.  I think it's the right thing.  So, I think that virus shooters should be able to shoot a virus that gets randomly inserted and the victim has no control over that.

But this perhaps the shooter should have some options.  If you are using viruses to construct an offspring's DNA gene by gene, there perhaps there should be a way for the virus shooter to control the insertion point.

We could use .shootval.  The value of .vshoot specifies the virus shot lifespan today and .shootval doesn't do anything for viruses currently, so it is open to use.  A value of 0 would mean random insertion.  A non-zero value would be moded by the number of genes in the target bot and used for the insertion point.
Many beers....