Author Topic: Small Viral Evolution Simulation  (Read 812 times)

Offline PhiNotPi

  • Bot Builder
  • **
  • Posts: 64
    • View Profile
Small Viral Evolution Simulation
« on: February 12, 2014, 11:48:32 AM »
I decided to make a simulation in which I studied the evolution of viruses only. 

There are a few important things to note regarding the simulation
  • I ran this in version 2.45.03.  It works best without chloroplasts so we don't have to deal with making sure that the veggies are being fed.  I didn't want a focus on energy management, but rather the infectiousness of the virus.
  • For similar reasons, I set all costs to 0 except for the DNA length cost, which I changed so that veggies would die after having 1000 BP (speeds up the sim)
  • If the population fell too low, then it would be repopulated with the original virus.
  • I kept the population very small and in close quarters, to maximize infection rates and simulation speed.
  • It is currently at slightly over 3 million cycles.

I created a short "starter" virus, which contained a few functions I thought would be essential, as well as a few random numbers.

Code: [Select]
cond
403 204 257 185 723 65 181 802 595 468 108 874 390 215 973 605 403 5
start
*.thisgene .mkvirus store
1 .vshoot store
*.thisgene 1 sub .delgene store
403 204 257 185 723 65 181 802 595 468 108 874 390 215 973 605 403 5
*.nrg 6000 > 50 .repro store
stop

This includes functionality to reproduce (since the robot would have no other DNA), to replicate the virus, and to delete all previous viruses (since only the last virus in the genome would be able to replicate anyways).

Almost immediately, the viruses lost the functionality to delete previous viruses in the genome.  Why did this happen?  My idea is that the more viruses are in the genome, the lesser the chance that new viruses would be randomly inserted as the last gene.  Since viruses are only active as the last gene, this  increases the "active lifespan" of the current infection.

Next, major deletions occurred.  This shortened the virus and made replication faster.

Code: [Select]
cond
403 204 257 185 723 65 181 802 595 542 dec
215 973 605 403 rnd start
*.thisgene .mkvirus store
1 .vshoot store
*.thisgene 1 sub 351 store
403 204 257 185 723 65 181 802 595 468 108 store

The above virus is the most current version.

I made several key observations:
  • There would be mass extinctions once the current generation of robot grew too large (genome-wise) and died out.  Then, the remaining robots had to infect the new robots with the current version of the virus.
  • The viruses didn't mutate very fast, at all.  Most mutations occurred in the inactive viruses buried in the genome, only mutation in the active infection would matter.  I couldn't decide on the mutation rate.  I think it was 1/32x most of the time, but I recently changed it to 32x.
  • Reproduction made no difference. Most of the time, the number of veggies maxed out.  Also, only one of the many infections needed to be able to reproduce in order for the robot to reproduce.
  • I probably should have made an empty host, rather than having the starter virus and the host robots being the same.  That way, we would not have to deal with the original virus being reintroduced, although that might increase competition.

Do you have any advice for future viral sims?  This first one was mostly an experiment to see if it were possible.  I think that the starter virus makes a huge difference as to what the final product will be, since DNA is deleted much easier than it is modified/added.  It is thus important to write an "easily evolvable" virus, which contains all potential functionality, and I don't know if I did a very good job this time.
I am biased neither towards nor against any single mathematical constant.

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
    • DJ Paul Kononov
Re: Small Viral Evolution Simulation
« Reply #1 on: February 12, 2014, 11:58:04 AM »
Interesting, sounds to me like the only thing that is mutating the virus is the point mutations logic from v 2.45 as viruses do not mutate on transfer. Still, the results look impressive. I do not remember at what point I fixed the mutation oscillator. If it is fixed try turning that feature on and set point mutations reasonably low edit: High (The fact that the effect is inverse of the values still confuses even me).
« Last Edit: February 12, 2014, 12:00:50 PM by Botsareus »

Offline PhiNotPi

  • Bot Builder
  • **
  • Posts: 64
    • View Profile
Re: Small Viral Evolution Simulation
« Reply #2 on: February 12, 2014, 02:30:20 PM »
I've decided to start a new simulation, as I decided to create an empty host species, so that repopulated robots would not re-introduce viral DNA and endanger previous progress.  I also considerably tweaked the costs for DNA length and the repopulation settings, which helped to prevent any "mass extinctions."

Here are several virus samples taken across time, which demonstrates how the virus has evolved:

Code: [Select]
cond
403 204 257 185 723 65 181 802 595 468 108 874 390 215 973 605 403 5
start
*.thisgene .mkvirus store
1 .vshoot store
1 .shootval store
*.thisgene 1 sub .delgene store
403 204 257 185 723 65 181 802 595 468 108 874 390 215 973 605 403 5
*.nrg 6000 > 50 .repro store
stop

 cond
 185 723 65 181 802 595 468 108 874 390 215 973 605 403 5 start
 *.thisgene .mkvirus store
 .vshoot store
 1 .shootval store
 *358 1 sub .delgene store
 403 204 257 185 723 65 181 802 595 468 108 874 390 215 973 605 403 5 *.nrg 6000 >
 50 .repro store
 stop

cond
 185 723 65 181 802 595 468 108 874 390 215 973 605 403 5 start
 *.thisgene .mkvirus store
 .vshoot store
 1 *358 1 sub .delgene store
 403 204 257 185 723 65 181 802 595 468 108 874 390 215 973 605 403 5 *.nrg 6000 >
 50 .repro store
 stop

 cond
 185 723 65 181 802 595 468 108 874 390 215 973 605 403 5 67 start
 *.thisgene .mkvirus store
 .vshoot store
 1 *358 1 sub .delgene store
 403 204 257 185 723 65 181 802 595 468 108 874 390 215 973 605 403 5 *.nrg 6000 >
 50 .repro store
 stop

cond
 185 723 65 181 802 595 468 108 874 390 215 973 605 403 5 67 start
 *.thisgene .mkvirus store
 .vshoot store
 1 *358 1 sub .delgene store
 403 204 257 185 723 65 181 802 595 468 108 874 390 973 605 403 5 *.nrg 6000 >
 50 300

Here, you can see the considerable change in only 360 thousand cycles, as opposed to the 3 million of my previous simulation.

One interesting mutation was "5 start" to "5 67 start" in the later versions.  Basically, this mutation changed the value of .vshoot from 5 to 67, since it appears to remain on the stack.  Does this increase the power of the virus shot?
I am biased neither towards nor against any single mathematical constant.