Author Topic: A little evolution for everyone!  (Read 19444 times)

Offline Carlo

  • Bot Destroyer
  • ***
  • Posts: 122
    • View Profile
A little evolution for everyone!
« Reply #30 on: June 22, 2005, 08:32:21 AM »
Quote
You have to understand what it is you're testing.  It's been a while, but I think you're testing if two supposedly events are NOT related.  When you conclude that they are not NOT related, you can't conclude that they ARE related.  Or something like that.

There are some subtle things you cannot conclude, but it's been too long and I just don't remember it all exactly.  I think this is a case of that.  I think sometimes F1 test give a false positive, but they won't give a false negative, or something like that.
A bit of confusion here, it seems.
We're trying to know the probabilities of two _completely related_ events: that is, A wins or B wins. The events are completely related because if A wins, B loses, and vice versa. Ok? We're just tossing a coin, and counting the times we have head, and the times we have cross.

But the sequence of results (A wins, B wins, B wins, A wins, B wins, etc..) is completely unrelated, since there's no information passing from one simulation to the other, so they cannot be related.

Hence, we can apply the same methods we use to calculate whether a coin is even or uneven (fair or unfair, don't know how you say). We toss it a zillion times, and calculate the ratio of head and cross, then we calculate the probabilities, and the error range inside a probability of, say, 90% (this means: that you have 90% chances that the real ratio is inside the error delta).

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
A little evolution for everyone!
« Reply #31 on: June 22, 2005, 11:09:37 AM »
Quote
I also tested 4 different bots vs. their conspecies-cousins, and all the conspeices always did win 5-0 (and I concluded I didnt needed to making more or longer trails) and if the conspecies is so important, why doesnt it evolve in the first place?
You have to understand that evolution works from the individual's point of view, never from the species point of view.  At least, that's the mainstream opinion in science at the moment.

So, while a species is more fit with a conspec gene, and thus able to win F1 battles, individuals that evolve to eat others of its own kind, especially when there aren't any other species around, have suddenly gained a huge advantage.

Imagine if I lock you in a room with another guy, and give you a bowl of jello every day to eat.  You both will probably be alive, but you have to share your limited resources.  If you kill and eat the other guy, you gain a huge advantage.  You get all his meat, and you get the whole bowl of jello every day.

So why aren't we all going around killing and eating each other?  Well, groups of genetically close humans tended in the past to battle, and manytimes eat (especially the heart, as part of ceremonies), other groups of non-genetically close humans.

Ants likewise often battle each other over territory, but only primitive ant species battle within the colony.

Basically, it is only advantageous to not kill close relatives because they are genetically similar to you, but to utterly decimate fourth and fifth cousins, because they aren't as likely to share your own genes.

So especially in an arena where it's only you and the plants, there's just no reason for a conspec gene.  This isn't a limitation of the simulation, it's a fact of real life.  Cooperative bacteria will evolve cheaters that steal food and eat other members if kept in isolation in a pitri dish.

Read the bot tavern's thread on Comesum, I think we discussed this a bit there.

Offline Sprotiel

  • Bot Destroyer
  • ***
  • Posts: 135
    • View Profile
A little evolution for everyone!
« Reply #32 on: June 22, 2005, 12:25:41 PM »
I'll try to explain a bit more:
Each contest is a Bernoulli trial. If we knew the probability p that bot A wins the contest, then the probability that A wins n contests out of a sequence of N would be given by the Binomial distribution:
P(n) = C(N,n).p^n.(1-p)^{N-n}.
The maximum of this distribution is at n=pN and the variance is Np(1-p).

However, we only know the results and not the underlying probability, so we have to "invert" the binomial distribution and use Bayesian inference. Imagine bot A won more contests than bot B, to know if this is statiscally significant, we have to compare likelihood functions, e.g. the probability of obtaining n wins under the hypothesis p=0.5 and the probability of obtaining n wins under the hypothesis p=n/N. If we have reasons to think that the bots are equivalent, we should probably only revise this assessment if the ratio of the likelihoods exceeds 100. Thus, a 5-0 win could be considered barely significant (ratio: 32) while a 4-1 win isn't (ratio: 2.6).

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
A little evolution for everyone!
« Reply #33 on: June 22, 2005, 12:28:52 PM »
Quote
I'll try to explain a bit more:
Each contest is a Bernoulli trial. If we knew the probability p that bot A wins the contest, then the probability that A wins n contests out of a sequence of N would be given by the Binomial distribution:
P(n) = C(N,n).p^n.(1-p)^{N-n}.
The maximum of this distribution is at n=pN and the variance is Np(1-p).

However, we only know the results and not the underlying probability, so we have to "invert" the binomial distribution and use Bayesian inference. Imagine bot A won more contests than bot B, to know if this is statiscally significant, we have to compare likelihood functions, e.g. the probability of obtaining n wins under the hypothesis p=0.5 and the probability of obtaining n wins under the hypothesis p=n/N. If we have reasons to think that the bots are equivalent, we should probably only revise this assessment if the ratio of the likelihoods exceeds 100. Thus, a 5-0 win could be considered barely significant (ratio: 32) while a 4-1 win isn't (ratio: 2.6).
That sounds familiar.  I think that's what I was trying to say.  It's been 2.5 years since I even touched stats.

Offline Sprotiel

  • Bot Destroyer
  • ***
  • Posts: 135
    • View Profile
A little evolution for everyone!
« Reply #34 on: June 22, 2005, 12:49:48 PM »
Quote
Quote
I also tested 4 different bots vs. their conspecies-cousins, and all the conspeices always did win 5-0 (and I concluded I didnt needed to making more or longer trails) and if the conspecies is so important, why doesnt it evolve in the first place?
You have to understand that evolution works from the individual's point of view, never from the species point of view.  At least, that's the mainstream opinion in science at the moment.

So, while a species is more fit with a conspec gene, and thus able to win F1 battles, individuals that evolve to eat others of its own kind, especially when there aren't any other species around, have suddenly gained a huge advantage.
 
This isn't exactly true. Parthogenesis is a counter-example. Lizards have a tendency to become parthogenetic, however all species that become parthogenetic get extinct in a few tens of thousands of years. What happens is that this mutation is beneficial in the short term, but fatal in the long run since it decreases hugely the adaptability of the species.

OK, it's perhaps not relevant for DB since there's no mechanism to exchange genes between members of a species. Actually, I wonder if the concept of species itself is relevant for DB, for the same reasons.

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
A little evolution for everyone!
« Reply #35 on: June 22, 2005, 01:04:21 PM »
Quote
Quote
Quote
I also tested 4 different bots vs. their conspecies-cousins, and all the conspeices always did win 5-0 (and I concluded I didnt needed to making more or longer trails) and if the conspecies is so important, why doesnt it evolve in the first place?
You have to understand that evolution works from the individual's point of view, never from the species point of view.  At least, that's the mainstream opinion in science at the moment.

So, while a species is more fit with a conspec gene, and thus able to win F1 battles, individuals that evolve to eat others of its own kind, especially when there aren't any other species around, have suddenly gained a huge advantage.
 
This isn't exactly true. Parthogenesis is a counter-example. Lizards have a tendency to become parthogenetic, however all species that become parthogenetic get extinct in a few tens of thousands of years. What happens is that this mutation is beneficial in the short term, but fatal in the long run since it decreases hugely the adaptability of the species.

OK, it's perhaps not relevant for DB since there's no mechanism to exchange genes between members of a species. Actually, I wonder if the concept of species itself is relevant for DB, for the same reasons.
But if you are the only species in existance, you have incentive to become a cannibot because it's an unexploited niche.

Think about it, the very first cells didn't eat each other.  But once some of them figured out how to, they became successful, and gave rise to every living animal on the planet.

Bots evolve cannibalism because it's an open niche.  But in F1 competition, it's not an open niche, which again shows that using F1 as a measure of the increase in fitness of a species is faulty.

The advent of cannibalism does not necessarily make a species less fit when it is alone (it's simply the bots evolving to fill unfilled niches), but it does make it less fit if there is another species it's battling.

Offline Sprotiel

  • Bot Destroyer
  • ***
  • Posts: 135
    • View Profile
A little evolution for everyone!
« Reply #36 on: June 23, 2005, 08:02:04 AM »
Back on topic!

I analyzed Greven's Bot 1 and it should do almost the same as
Code: [Select]
cond  
*.eye3  *.eye8  >
start
  -25  .aimdx  store  
stop

cond  
*.eye7  *.eye5  >
start  
  25  .aimdx  store
stop

cond
start  
  32000  rnd  .up  store  
stop

cond  
*.eye5  41  >
start
  -1  .shoot  store
stop

cond  
*.nrg  5100  >
start  
  50  .repro store
stop

end

I tried to test it and indeed both perform the same: they die so fast that I don't even have time to pause the simulation! Greven, which version did you use? My guess is that it's one from before the MAJOR change to stack behaviour.

Offline Greven

  • Bot Destroyer
  • ***
  • Posts: 345
    • View Profile
A little evolution for everyone!
« Reply #37 on: June 23, 2005, 09:33:54 AM »
I have used the new 2.37.2! If this is what you get when analyzed Sprotiel, this is indeed very interesting, because it actually show that the bot indeed did not evolve very much! As I have stated before this explosion in DNA lenght may be because of the deletious mutations are destructive, as stated by Num, and therefore evolution will work against these by increasing the DNA lenght, because when the DNA is longer it is less likely to get messed up when a delete mutation occures.

And regarding Num: Num I think I understand now, you dont have to cut it entirely down into pieces. But I welcome open discussions on this, we need more EXPERIMENTS to validate DB. I understand we there is low energy, often a species eats its own members, like in real life, but because DB is so simple and the bots behavior is determined by direct DNA encoding, the bots dont have the ability to decide to eat or not to eat its own family members. But dont begin to compare humans with animals. Indeed we are animals, but we can think abstract, the animals only live by insticts (okay very simple but you know what I mean).
10010011000001110111110100111011001101100100000110110111000011101011110010110000
011000011000001100010110010111101001110100110010111100101000001000001111001011101
001101001110011011010011100011110100111000011101100100000100110011010011100110110
010110000011100111101001110110111101011101100110000111101001101001110111111011101
01100100000111010011010001100001110111010000010001001000010100001

Offline Ulciscor

  • Bot Destroyer
  • ***
  • Posts: 401
    • View Profile
A little evolution for everyone!
« Reply #38 on: June 23, 2005, 09:37:25 AM »
Maybe a bit off topic sorry but is there a sort of optimum DNA length so that mutations are not catastrophic yet lots of pointless operations are not carried out? Could it be found by letting lots of bots mutate for a while then averaging the DNA length of each of them?
:D Ulciscor :D

I used to be indecisive, but now I'm not so sure.

Offline PurpleYouko

  • Bot God
  • *****
  • Posts: 2556
    • View Profile
A little evolution for everyone!
« Reply #39 on: June 23, 2005, 10:27:29 AM »
Quote
Maybe a bit off topic sorry but is there a sort of optimum DNA length so that mutations are not catastrophic yet lots of pointless operations are not carried out? Could it be found by letting lots of bots mutate for a while then averaging the DNA length of each of them?
Probably wouldn't work since the longer you run the sim, the longer the DNA length seems to get.
In short there are more additions than subtractions in the DNA mutater.

The way it mutates is by running through the entire DNA one entry at a time and applying a random flagging event for each one.

example:
with mutation level (any one take your pick) set to 1, the random number is from 1 to 1 so it is always 1 so every entry is mutated.
with mutation set to 1000, the random number is from 1 to 1000 but a mutation only occurs when the number is 1 so on average, every 1000th entry will be mutated.

A longer DNA will always result in more overall mutations but the ratio of mutations/DNA length will remain constant
« Last Edit: June 23, 2005, 10:28:33 AM by PurpleYouko »
There are 10 kinds of people in the world
Those who understand binary.
and those who don't

:D PY :D

Offline Ulciscor

  • Bot Destroyer
  • ***
  • Posts: 401
    • View Profile
A little evolution for everyone!
« Reply #40 on: June 23, 2005, 10:30:55 AM »
I was just assuming that a bot with more pointless additions to its genome would be less likely to survive that a bot with a long but more streamlined genome.
:D Ulciscor :D

I used to be indecisive, but now I'm not so sure.

Offline PurpleYouko

  • Bot God
  • *****
  • Posts: 2556
    • View Profile
A little evolution for everyone!
« Reply #41 on: June 23, 2005, 10:47:24 AM »
Possibly but I don't think so.

Right now I am still trying to determine if DNA length has any effect whatsoever on the "fitness" of a robot. I strongly suspect that pointless "junk" DNA has absolutely no effect at all
There are 10 kinds of people in the world
Those who understand binary.
and those who don't

:D PY :D

Offline Greven

  • Bot Destroyer
  • ***
  • Posts: 345
    • View Profile
A little evolution for everyone!
« Reply #42 on: June 23, 2005, 10:52:00 AM »
PY this is a very important one! Whatever junk DNA has an influence on the overall fitness of the bot! Because it shouldnt have, but if it has then it is a bug or it is not junk DNA  :P
10010011000001110111110100111011001101100100000110110111000011101011110010110000
011000011000001100010110010111101001110100110010111100101000001000001111001011101
001101001110011011010011100011110100111000011101100100000100110011010011100110110
010110000011100111101001110110111101011101100110000111101001101001110111111011101
01100100000111010011010001100001110111010000010001001000010100001

Offline Greven

  • Bot Destroyer
  • ***
  • Posts: 345
    • View Profile
A little evolution for everyone!
« Reply #43 on: June 23, 2005, 10:53:37 AM »
But then again, in reallife we do still not understand the concept of junk DNA entirely, it seems to have no function whatsoever, but it actually may have some influence on the execution and translation on the DNA... (or so I think I have read!!??)
10010011000001110111110100111011001101100100000110110111000011101011110010110000
011000011000001100010110010111101001110100110010111100101000001000001111001011101
001101001110011011010011100011110100111000011101100100000100110011010011100110110
010110000011100111101001110110111101011101100110000111101001101001110111111011101
01100100000111010011010001100001110111010000010001001000010100001

Offline Ulciscor

  • Bot Destroyer
  • ***
  • Posts: 401
    • View Profile
A little evolution for everyone!
« Reply #44 on: June 23, 2005, 10:59:30 AM »
I think junk DNA is important because sometimes parts of it copy themselves bang in the middle of a useful sequence, causing really big mutations. I think viruses do something similar. I seem to recall hearing the phrase 'jumping genes'...
:D Ulciscor :D

I used to be indecisive, but now I'm not so sure.