Darwinbots Forum

Bots and Simulations => Evolution and Internet Sharing Sims => Topic started by: shvarz on January 15, 2008, 05:45:45 PM

Title: Battle of viruses
Post by: shvarz on January 15, 2008, 05:45:45 PM
Here is a mutation log from a bot in my sim:

Quote
Infected with virus of length  22 during cycle  2426878 at pos  1
Infected with virus of length  91 during cycle  2368 at pos  1
Infected with virus of length  91 during cycle  2280 at pos  92
Infected with virus of length  91 during cycle  2239 at pos  92
Infected with virus of length  91 during cycle  2105 at pos  92
Infected with virus of length  91 during cycle  1699 at pos  1
Infected with virus of length  91 during cycle  1466 at pos  92
Infected with virus of length  91 during cycle  1352 at pos  1
Infected with virus of length  91 during cycle  1274 at pos  92
Infected with virus of length  91 during cycle  1083 at pos  92
Infected with virus of length  91 during cycle  979 at pos  1
Infected with virus of length  91 during cycle  728 at pos  1
Infected with virus of length  91 during cycle  645 at pos  1
Infected with virus of length  91 during cycle  579 at pos  1
Infected with virus of length  91 during cycle  428 at pos  13

Each incoming virus deleted the previous one or got deleted itself. The last virus (length 22) kicked out the 91bp virus.

Current genotype is:
Quote
''''''''''''''''''''''''  Gene:  1 Begins at position  1  '''''''''''''''''''''''
 cond
 65 *999 !=
 start
 *.thisgene .mkvirus store
 *.myeye *.myshoot add *.myup add 31999 mult 50 floor .vtimer store
 .delgene dec
 stop
''''''''''''''''''''''''  Gene:  1 Ends at position  22  '''''''''''''''''''''''

Pretty cool, eh?
Title: Battle of viruses
Post by: googlyeyesultra on January 15, 2008, 05:54:26 PM
Hey, that's my virus! Neat. The only mutation I see is .vshoot -> .vtimer (although the cond might be mutated as well, I don't know off hand.) That should make it both non-lethal and non-spreading, so I'm not sure how it got there (maybe a parent had it and mutated there?)
Title: Battle of viruses
Post by: shvarz on January 15, 2008, 06:28:01 PM
well, this virus obviously works, because I see it a lot. here is a copy from a completely different bot:

Quote
cond
 65 *999 !=
 start
 *.thisgene .mkvirus store
 *.myeye *.myshoot add *.myup add 31999 mult 50 floor .vtimer store
 .delgene dec
 stop
Title: Battle of viruses
Post by: EricL on January 15, 2008, 11:19:44 PM
Perhaps the short virus is dependent upon the longer one to set .vshoot.  In this bot, it got inserted first and so it's a dead end but in others, it exist in the genome after the longer virus in which case it would override .mkvirus but leverage the vshoot code and thus propagate.  Very interesting.  It's requires a host infected with another virus before it can propagate.  

Note that the .delgene dec means it lives for 32000 cycles then deletes the entire genome.
Title: Battle of viruses
Post by: shvarz on January 16, 2008, 12:26:08 PM
Yes, I'm sure that's exactly what happens. I have tons of viruses in my bots and this would inevitably lead to complementation and viruses that depend on other viruses. This is a very common phenomena in virology and these guys are sometimes called "defective interfering particles". DB's implementation of viruses is awesome!
Title: Battle of viruses
Post by: MacadamiaNuts on January 16, 2008, 04:41:46 PM
I introduced the Green Hacker veggie with a pair of hijacking style virus that attempt to fuse themselves with some of the host's original DNA.

Watch for genes with appended code including a .mrepro instruction.
Title: Battle of viruses
Post by: shvarz on January 16, 2008, 05:11:54 PM
Yes, I see them!  Let's see what happens... I think what my bots have been doing is increasing their mutation rate on their own. High mutation rates kill viruses as efficiently as bots, so including mrepro may not be the best approach
Title: Battle of viruses
Post by: shvarz on January 16, 2008, 09:26:55 PM
Well, your virus did not take.  Or at least it's not any worse than other viruses. I now have ~25 of your veggies in my sim. There was an initial burst of this virus, but then things quited down and now I rarely see it.
Title: Battle of viruses
Post by: Shasta on January 16, 2008, 10:24:12 PM
I released a virus/bot called cloner a few days ago that would overwrite all of the host genes. It didn't do very well, as it was too long and the virus took forever to make , and shrinking violet promptly came in and took them all out. Back to the drawing board I guess.
Title: Battle of viruses
Post by: googlyeyesultra on January 17, 2008, 05:36:38 PM
Quote from: EricL
Note that the .delgene dec means it lives for 32000 cycles then deletes the entire genome.

Isn't .delgene reset  every cycle? I actually just intended that as a defense against someone trying to delgene the virus (it would then delgene whatever gene was behind it instead).
Title: Battle of viruses
Post by: EricL on January 17, 2008, 07:40:36 PM
Quote from: googlyeyesultra
Isn't .delgene reset  every cycle? I actually just intended that as a defense against someone trying to delgene the virus (it would then delgene whatever gene was behind it instead).

Okay, I'm half wrong.  First, the right part.   .delgene does not reset for negative values.  The way the currently code works, delgene is only reset for postive values.  If positive, it is reset whether or not it's value is the in the range of valid gene numbers.

So .delgene counts down to -32000.   I had done a little testing and thought I saw the gene delete itself so I thouhgt maybe the code wrapped -32000 to 32000 or similar, but I must have seen a mutation or something.  The code MODs the dec back to 0 again and the countdown continues anew.  So, I am mistaken.  .delgene isn't reset but it never goes positive either so the virus DOES NOT delete the genome.
Title: Battle of viruses
Post by: shvarz on January 18, 2008, 12:05:19 PM
Ok, update on the green hacker - it's gone almost extinct in my sim. I'm not sure why. There are only two bots of this species left in my sim. I managed to find one of them and it's genome is:
Quote
''''''''''''''''''''''''  Gene:  1 Begins at position  1  '''''''''''''''''''''''
 start
 *.myshoot add *.myup add 31999 mult 50 4 .vtimer store
 .delgene dec
 stop
''''''''''''''''''''''''  Gene:  1 Ends at position  14  '''''''''''''''''''''''

''''''''''''''''''''''''  Gene:  2 Begins at position  15  '''''''''''''''''''''''
 cond
 65 *999 !=
 start
 *.thisgene .mkvirus store
 *.myeye *.myshoot add *.myup add 31999 mult 50 floor .vtimer store
 .delgene dec
 stop
''''''''''''''''''''''''  Gene:  2 Ends at position  36  '''''''''''''''''''''''

''''''''''''''''''''''''  Gene:  3 Begins at position  37  '''''''''''''''''''''''
 cond
 65 *999 !=
 start
 *.thisgene .mkvirus store
 *.myeye *.myshoot add *.myup 31999 mult 50 floor .vtimer store
 .delgene dec
 stop
''''''''''''''''''''''''  Gene:  3 Ends at position  57  '''''''''''''''''''''''

Looks like your mrepro virus lost this round....
Title: Battle of viruses
Post by: Endy on January 21, 2008, 05:07:19 AM
The info about delgene could be useful to a bot too. It could constantly decrease both delgene and another variable. If it spots any unexpected returns to zero, it would know that a virus was present and trying/succeding in deleting a gene. Could even do a desperate 99 .mrepro to try and mutate the virus to death.
Title: Battle of viruses
Post by: EricL on January 21, 2008, 11:34:53 AM
I was thinking I should probably either reset .delgene independent of it's value or never reset it.  I don't think the current behaviour was intentional.  

What think?
Title: Battle of viruses
Post by: Numsgil on January 21, 2008, 05:09:20 PM
Resetting .delgene makes sense.  But at the same time, weird issues like that can sometimes give rise to interesting solutions.
Title: Battle of viruses
Post by: shvarz on January 22, 2008, 12:26:42 PM
Coming back to the original point.  This "defective" virus works great as a protection against viral infections. I see infections sparking up now and then, but they all get quenched very quickly and when I look at the bots all I see is infections with this "protective" virus.

Again, this is a great model for real life, as many antiviral systems are actually composed of former viral proteins, which are expressed in host cells to interfere with viral infections.
Title: Battle of viruses
Post by: shvarz on January 28, 2008, 08:05:27 PM
Another development. I see a virus that picked up conditions from one of the genes in my veggies. As a result the virus is only active when adult bots (over 1000 age) are attacked and loose their poison.  Good strategy that some viruses also use - they sit quietly when things are fine, but activate when their host is stressed. Amazing!  

I think viruses show real advantages of DB for simulating evolution. We are yet to see truly interesting behaviors appearing in bots, but viruses evolve much faster and thus are better at developing new strategies for survival.

Here is the code:

Quote
cond
 *.robage 1000 >
 *.poison 200 <
 start
 *.pleas 0 >
 *.myeye 0 =
 and
 50 .repro store
 314 .aimleft store
 clearbool
 *.out3 *.myeye !=
 *.robage 1 >
 and
 *.myeye 0 =
 or
 *.thisgene 1 add .delgene store
 *.thisgene 1 sub 340 1 rnd mult store
 clearbool
 *.out3 *.myeye =
 *.out3 0 !=
 and
 *.thisgene 0 >
 and
 *.thisgene .delgene store
 clearbool
 *.vtimer 0 =
 *.thisgene .mkvirus store
 100 .vshoot store
 stop
Title: Battle of viruses
Post by: Peter on January 29, 2008, 02:29:29 PM
This virus seems human-made.

I has too much 'logic' inside itself to be a complete evolved virus.
Title: Battle of viruses
Post by: shvarz on January 29, 2008, 03:09:11 PM
It is a human-made virus, but the conditions are evolved. Not from scratch, but rather the virus took them from a gene in my veggies - it was a poison-making gene, and it was designed to be active when veggies grew a bit first and when poison levels fell below 200.  The virus probably inserted after the gene, then the actual gene got deleted while its conditions got attached to the virus.
Title: Battle of viruses
Post by: Endy on February 01, 2008, 06:03:17 AM
I personally like the idea of leaving delgene as it is. I've managed to use it's ability to self reset, to do some interesting things.

.delgene dec
*.delgene .aimdx store

in this bit of code the bot spins constantly faster then resets to a slower spin rate again.

You can also do a *.delgene inc to set all the values up to (.delgene - 1) to 1.

Managed to make one of the smallest viruses with this that doesn't delete it's own dna
Title: Battle of viruses
Post by: EricL on February 01, 2008, 11:15:29 AM
Regarding .delgene, would there be an objection to never resetting it be it's value positive or neg?  Or perhaps only resetting it if a gene is actually deleted?   Asymetry bothers me, keeps me awake at night...

Regarding the virus, why is it do you think that viruses evolve faster than bots?  Is it because they have more instances (multiple per bot) and/or reproduce faster with shorter generations and/or need not balance costs to stay alive the way organisms with morphs must or have a lower mutation rate (due to their mutation-less reproduction method) or something else or perhaps all of the above?

If you think about it, viruses are in many ways close to the pure virtual organism I've been seeking - one without a true phenotype or requiring (directly) a simulated physics where every possible interaction must be anticipated and coded apriori in the simulator.  I ask the question:  are viruses a way to avoid the Dennet collision detection limitation?  The DB environment and host phenotypes in particular represent a digital world in which purely digital viral morph inhabits.  Yes, our simulated physics are still there and (indirectly) enrich and restrict the environment in which viruses inhabit and the set of interactions possible therein, but do the way viruses interact and evolve lend itself to a richer set of unintended or unanticipated interactions than simualted phsycial morphs given their interaction is primarily at the DNA level?

I find the pursuit of these fundemental questions (why a purely digital organism residing in a world more disconnected from simualted physical world physics might evolve faster) intriniscly fasinating and perhaps of critical importance for the future of alife.....
Title: Battle of viruses
Post by: shvarz on February 01, 2008, 01:09:56 PM
I don't know why they evolve faster, but I can always speculate

I think the points that you mentioned are correct. Viruses have shorter generation time and their population sizes are much higher. This should help evolution a lot.

It probably also helps that viruses inhabit a much richer world than bots. Their environment consists of hosts that behave in many different ways. Their resources are diverse in time and space. But in the general sense they also "inhabit" the space of memory locations within bots and the space of all the DNA that these bots have.  All together this creates a rich complex system, which allows adaptation and diversification.