Author Topic: Sexual Reproduction  (Read 11819 times)

Offline Elite

  • Bot Overlord
  • ****
  • Posts: 532
    • View Profile
Sexual Reproduction
« 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?
« Last Edit: April 19, 2006, 04:59:19 PM by Elite »

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Sexual Reproduction
« Reply #1 on: April 19, 2006, 05:08:05 PM »
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.
« Last Edit: April 19, 2006, 06:36:06 PM by Numsgil »

Offline Elite

  • Bot Overlord
  • ****
  • Posts: 532
    • View Profile
Sexual Reproduction
« Reply #2 on: April 19, 2006, 05:40:12 PM »
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

Offline Welwordion

  • Bot Destroyer
  • ***
  • Posts: 325
    • View Profile
Sexual Reproduction
« Reply #3 on: April 19, 2006, 05:47:21 PM »
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

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Sexual Reproduction
« Reply #4 on: April 19, 2006, 05:51:58 PM »
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...

Offline Welwordion

  • Bot Destroyer
  • ***
  • Posts: 325
    • View Profile
Sexual Reproduction
« Reply #5 on: April 19, 2006, 05:54:28 PM »
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.

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Sexual Reproduction
« Reply #6 on: April 19, 2006, 06:11:53 PM »
Clicky

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.  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.
« Last Edit: April 19, 2006, 06:16:37 PM by Numsgil »

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Sexual Reproduction
« Reply #7 on: April 19, 2006, 06:34:30 PM »
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 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.

Offline Greven

  • Bot Destroyer
  • ***
  • Posts: 345
    • View Profile
Sexual Reproduction
« Reply #8 on: April 19, 2006, 06:43:52 PM »
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.
10010011000001110111110100111011001101100100000110110111000011101011110010110000
011000011000001100010110010111101001110100110010111100101000001000001111001011101
001101001110011011010011100011110100111000011101100100000100110011010011100110110
010110000011100111101001110110111101011101100110000111101001101001110111111011101
01100100000111010011010001100001110111010000010001001000010100001

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Sexual Reproduction
« Reply #9 on: April 19, 2006, 06:46:29 PM »
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.

Offline Greven

  • Bot Destroyer
  • ***
  • Posts: 345
    • View Profile
Sexual Reproduction
« Reply #10 on: April 19, 2006, 06:50:27 PM »
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?

Quote
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.
10010011000001110111110100111011001101100100000110110111000011101011110010110000
011000011000001100010110010111101001110100110010111100101000001000001111001011101
001101001110011011010011100011110100111000011101100100000100110011010011100110110
010110000011100111101001110110111101011101100110000111101001101001110111111011101
01100100000111010011010001100001110111010000010001001000010100001

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Sexual Reproduction
« Reply #11 on: April 19, 2006, 06:54:54 PM »
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.)
« Last Edit: April 19, 2006, 06:55:37 PM by Numsgil »

Offline Greven

  • Bot Destroyer
  • ***
  • Posts: 345
    • View Profile
Sexual Reproduction
« Reply #12 on: April 19, 2006, 06:58:45 PM »
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.
10010011000001110111110100111011001101100100000110110111000011101011110010110000
011000011000001100010110010111101001110100110010111100101000001000001111001011101
001101001110011011010011100011110100111000011101100100000100110011010011100110110
010110000011100111101001110110111101011101100110000111101001101001110111111011101
01100100000111010011010001100001110111010000010001001000010100001

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Sexual Reproduction
« Reply #13 on: April 19, 2006, 07:00:22 PM »
We'll probably need to come up with a default function anyway since old bots obviously aren't comming with their own hash function

Offline Welwordion

  • Bot Destroyer
  • ***
  • Posts: 325
    • View Profile
Sexual Reproduction
« Reply #14 on: April 20, 2006, 02:40:30 AM »
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?)
« Last Edit: April 20, 2006, 02:43:39 AM by Welwordion »