Author Topic: Newb question about mutation  (Read 4729 times)

Offline Gambrinus

  • Bot Neophyte
  • *
  • Posts: 4
    • View Profile
Newb question about mutation
« on: January 19, 2008, 12:23:38 AM »
Hello,

I've just started with DB and I'm really intrigued by it.  But I'm confused by the concept behind these mutations.  I'm a biochemist with a specialization in bioinformatics so I understand the concept of mutation and evolutionary modeling, but I'm interested in exactly what is taking place.  When I see a point mutation is that referring to the change of one character in the code that defines the organism's DNA?  If so, how does this avoid making the code invalid?  I guess the simplest way to ask my question is this:

If I allow an organism to continue for a period of time and it mutates and I save its DNA code and open it in a text editor next to the original non-mutated DNA code, what difference would I see?  Would single integers be changed?  Or would entire genes be rearranged?

Offline googlyeyesultra

  • Bot Destroyer
  • ***
  • Posts: 109
    • View Profile
Newb question about mutation
« Reply #1 on: January 19, 2008, 01:09:56 AM »
A point mutation will generally change a number to another number, change a sysvar (or, in essence, command (which is the same as a number, sort of)), or change the type of thing (say, a number to a *number or a number to a store or inc). All mutations produce syntatically valid DNA, but there's no assurance that said DNA will do anything useful.

Generally speaking, you'll see numbers and words changed around, some gene structure changes, etc. Genes shouldn't be rearranged without viral propagation or somesuch.
« Last Edit: January 19, 2008, 01:11:23 AM by googlyeyesultra »

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
Newb question about mutation
« Reply #2 on: January 19, 2008, 01:20:14 AM »
Hi and welcome.

Well, let me take a shot at this.  Bot DNA is actually a little more complex than a sequence of integers.  It's actually made up of a sequence of typed values.   Think of it as a string of pairs of numbers where one number is the type and one is the value.   The textual DNA that humans author or the program displays or saves is a tokenized version of this underlying sequence of type-value pairs.  So, when a human writes something like:

cond
*.nrg 100 >
start
10 .up store
stop

it gets represented inside the program as:

9 1
1 310
0 100
5 2
9 2
0 10
1 1
7 1
9 4
10 1

That is the actual underlying type-value representation of the gene above.  That last pair (10 1) is the "end" base pair.  (For historical reasons, we use the term "base pair" to refer to a type-value pair but the term "codon" might actually be a better analogy.)

Anyway, the mutation code knows to only mutate to type-value pairs in the defined genome space.    For example, there are only four values in the space of the "flow control" type (type 9):  cond, start, else and stop.  These are represented interally as:

9 1
9 2
9 3
9 4

Thus, the mutation code will never mutate to a 9 5 for example.  The simulator code prevents this.  But it might mutate to a 0 31987 since the "0" type is the space of all integers -32000 -> 32000 inclusive.

Given this and the way the DNA "language" works, there is no such thing as an invalid genome.   A mutation may break or radically change some functionality, but every genome in the space of all posible genomes are "valid" in the sense that the simulator will handle them just fine.  A particular sequence may not do anything interesting - indeed most probalby do not as the morphospace is vast - but they will exectue and certainly won't cause problems for the simulator.

What the different mutation types actaully do to the genome depends (not surprisingly) on the type of the mutation.  Point mutations change a single base pair for example.  A sequence copy mutation duplicates a sequence of base pairs.  FYI, no mutation type respects gene boundaries.

So, to answer your question, if you compared two homologous genomes in a txt editor, you would see a different sequence of base pairs - the tokenized representations of the underlying type-value base pair sequences - and not a rearrangement of genes.  Since no mutation type respects gene structure, preservation of gene structure is a strong sign of conserving selection pressure or perhaps an indication of horizontal gene flow via viral infection.

If you want more detail, ask away.

Quote from: googlyeyesultra
Generally speaking, you'll see numbers and words changed around, some gene structure changes, etc. Genes shouldn't be rearranged without viral propagation or somesuch.
Man, I got to get me some brevity...
« Last Edit: January 19, 2008, 01:19:26 AM by EricL »
Many beers....

Offline Gambrinus

  • Bot Neophyte
  • *
  • Posts: 4
    • View Profile
Newb question about mutation
« Reply #3 on: January 19, 2008, 11:32:30 AM »
Thats pretty ingenious then.  I've been running a sim with Alga_minimalis and Animal_minimalis for a while and trying to find mutated individuals to inspect, but I haven't been very successful.  But this explanation helps a lot.

One more question though.  When the total number of bots begins to get really high, the cycles/sec dramatically decreases for obvious reasons.  I've tried turning off the video display to help it run faster but I'm still getting somewhere around 0.1 cycles/sec.  It's an old machine but its the only one I can really afford to have dedicated.  So is there anything else I can be doing to speed it up?

Offline googlyeyesultra

  • Bot Destroyer
  • ***
  • Posts: 109
    • View Profile
Newb question about mutation
« Reply #4 on: January 19, 2008, 11:54:51 AM »
If you don't care about certain things for certain bots, you can disable them in the new sim menu (say, for instance, disable vision for your vegetables.) That tends to speed things up a bit. You can also just lower the amount of energy going into the sim so that there will be less bots, but that tends to degrade evolution a bit.

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
Newb question about mutation
« Reply #5 on: January 19, 2008, 12:45:01 PM »
Another very common thing to do is to use the auto-costs capability to keep the total sim population near a specific target value.  The program will increase costs when the population grows and decrease them when it shrinks to try to keep things in a specific range.  There are certain ramifications to be aware of when doing this w.r.t. the kind of selection pressure it represents, but it can be very useful for keeping the population of an evo-sim under control.

See: Top Ten Ways to speed up your Evo Sim.
« Last Edit: January 19, 2008, 12:45:30 PM by EricL »
Many beers....

Offline shvarz

  • Bot God
  • *****
  • Posts: 1341
    • View Profile
Newb question about mutation
« Reply #6 on: January 19, 2008, 01:53:06 PM »
Quote
I'm a biochemist with a specialization in bioinformatics

Good to see another trained biologist here! This program is great if you want to play with evolution. I've been hooked up on it for 4.5 years and saw some amazing progress in its ability to model biological systems. Right now I'm fascinated by evolution of viruses, both in my day job and in DBs.

Welcome to the community!
"Never underestimate the power of stupid things in big numbers" - Serious Sam

Offline Gambrinus

  • Bot Neophyte
  • *
  • Posts: 4
    • View Profile
Newb question about mutation
« Reply #7 on: January 19, 2008, 02:12:27 PM »
Wow, its amazing the difference some of those settings makes.  I'm also very impressed with how helpful this community is.  But I'm curious.  Is there a way to pause the simulation and find the most mutated surviving individual?  I doubt there is because there is little use for such a feature but I'm just finding it difficult to isolate mutated individuals just to observe the changes.

Offline MacadamiaNuts

  • Bot Destroyer
  • ***
  • Posts: 273
    • View Profile
Newb question about mutation
« Reply #8 on: January 19, 2008, 02:34:25 PM »
You can speed mutations a lot if at the start of a sim, in the Species tab, click on Mutation Rates and, for example, drop Copy Error from 5000 to 500 or lower.

Run the smallest sim with 10 max vegetables, 30 energy per cycle (this stuff is in General Settings), and repopulating 1 vegetable each 100 cycles. Optionally you may want to put dynamic costs thru the Custom costs button at the Costs tab. Put the low left bar full right so the costs respond faster. Also, at the ageing costs text fields, put an high value and Begin at cycle 4000 or so. That kills elders (and bots with reproduction disabled), and makes generations turn faster.

When you get used to the Species menu, start a sim with T_Preservans instead of Animal_minimalis. If T_Preservans still works, it used to be better for evolution simulations. Eventually mutations disable their recognition of bots of their same species, they turn carnivore and control better their population. Anyway, it's common for small sims with high mutation rates to stagnate and die.
« Last Edit: January 19, 2008, 03:11:45 PM by MacadamiaNuts »
Sometimes you win, and sometimes you lose...

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
Newb question about mutation
« Reply #9 on: January 19, 2008, 02:41:30 PM »
There isn't really a good way to find the "most mutated" extant organism.  It's not clear (to me at least) that there even is such a thing.  Let me explain.

The default mutation rates in DB are probably an order of magnitude or more higher than they should be.  Given this and the limited size of the sims and asexual reproduxction and what you get is that all the extant bots in a single evo sim will all usually have roughly about the same number of accumulated mutations down their line from the base organism.  Even well adapted bots mutate given the high mutation rate.  It's just that their mutations are not deleterious.   Generally, all the bots in a sim will all share a common ancestor within N generations (N typically less than 100).  This is just observation on my part of isolated single evo sims and is a function of our small worlds and limited CPU cycles..  Larger inter-connected sims such as Internet Mode (which you should try) change this dynamic considerably adn there I think we may be starting to see long term coexistance of mutiple evolved species from common ancestors.

Try out the graphs if you havn't already.  I assume you are already looking at the mutation history of individual bots via their properties dialogs...
Many beers....

Offline Gambrinus

  • Bot Neophyte
  • *
  • Posts: 4
    • View Profile
Newb question about mutation
« Reply #10 on: January 19, 2008, 03:18:35 PM »
Yes I've looked at individual bots' mutations via their properties.  It just seems that very few of the bots I look at have any mutations at all.  This is probably because I'm impatient and haven't run the sim long enough to generate many mutations.  I'm afraid of turning up the mutations too high, however, because it seems to me that that would generate too many mutations and either kill off too many bots or destroy the selection.  Anyway, DB has capture my interests so I'll most likely become a consistant poster once I get myself figured through it.

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
Newb question about mutation
« Reply #11 on: January 19, 2008, 04:05:14 PM »
Quote from: Gambrinus
It just seems that very few of the bots I look at have any mutations at all.  This is probably because I'm impatient and haven't run the sim long enough to generate many mutations.

One thing to be aware of is that as MacaNuts points out, most of the interesting mutation types only happen at reproduction time when DNA is copied.  Thus, if the dynamics of your sim are such that generation times are long, you will see fewer mutations per unit time.  If bots are reproducing like crazy because they must due to aging costs or prediation or similar, then generation times will be shorter and the mutation rate per total elasped sim cycles will be much higher.

Glad you're hooked.
Many beers....