Darwinbots Forum

Bots and Simulations => Evolution and Internet Sharing Sims => Topic started by: EricL on April 07, 2006, 02:46:17 PM

Title: South Pacific Sim
Post by: EricL on April 07, 2006, 02:46:17 PM
Looking for stress and stability bugs in 2.42.1, I needed to construct long running sims (> 1M cycles) at the largest field size where I could have complex bots with lots of mutation evolve indefintly without runaway selection or other short-sighted adaptations causing the entire sim to go extict - a common occurance in some of my previous evo sims where bots evolved to kill off all the plants or became canibalistic, forgot about plants, and killed each other off.

I also wanted to try to keep the bot population somewhere around 1000 or so; low enough to keep things moving fast and not bump up against the artificial 5000 bot limit but high enough to get some real population variation and mutation in different directions.  Additionally, I wanted population isloation.  That is, to set up an evironment where speciation would occur.  I wanted enough isolation that it was difficult, but not impossible for bots to migrate from one local ecosystem to another without using walls.

The solution was to create a veggy "chain of islands" not unlike the Pacific Ocean Island chain.  What I did was use a small number of very high energy, stable, fixed veggies - no more than 25 or so for the largest sim size and strung them out across the screen.  Each "island" provided essentially infinite food, but physical access to that resoruce is limited by space.  Each island is far out of sight form the other, so bots have to balance staying put and competing for a limited resource versus venturing out into the blue and taking their chances on finding a new undiscoverred resourse in some random direction.

I wanted to favor DNA complexity, so I removed all the costs on DNA operations so that having a longer DNA or executing more genes is not in and of itself disdvantageous.  But I had to tax something to provide selective pressure so there is a body upkeep cost of 0.1 per cycle as well as costs on things like venom and shell.  This way, DNA complexity can evolve and selection favors action effeciency.  They have to eat, they to have to find food and compete for limited resources or they will die.  The genes they use to do that can be as many or as complex as they need.  Generally a bot with typical energy can live long enough to reach the next island if they happened to set out in the right direction, but if they didn't, leaving your island tends to be fatal.

The limited number of veggy islands, the restrictiosn in physical access to these resources and the body upkeep cost tends to keep the population between 1000 and 15000, about where I want it.  (I actually had to increase the body upkeep cost over the first few 100,000 cycles as bots got more effecient.)  Sometimes a population spike or fall off will occur as a bot evolves cannabalistic tendencies or some other new short term strategy that gives individuals massive advantage in the short term, but if such an adaptaion is disadvantagous for the species and ecosystem (will leads to extinction relatively quickly) it won't spread to all the islands due to the time and cost it takes to do so.  Island populations can go extict, but they get resettled eventually by populations from surviving islands which did not develop the fatal adaptation.   Thus, the sim as a whole never seems to die.  Things change, sub species change and evolve, and go extinct, but the sim as a whole lives on.

The Settings file is attached.  I'd attach the sim, but even zipped, its 818k...

-Eric
Title: South Pacific Sim
Post by: Numsgil on April 07, 2006, 03:09:12 PM
Nice idea, I think that's how other Alife sims tend to tackle similar problems.  As long as you're shuffling the island populations from time to time it should help keep the bots from suiciding.
Title: South Pacific Sim
Post by: PurpleYouko on April 07, 2006, 03:23:45 PM
Did you try running this in zero-momentum mode?
I have been getting good results when trying to restrict movement by doing that lately.

BTW. Where do I get the robots? They aren't in the zip.



Hey Num!

What's the deal with the monkey?
Title: South Pacific Sim
Post by: EricL on April 07, 2006, 03:31:00 PM
Quote
Did you try running this in zero-momentum mode?

I have not.  I may try that next.  As it is though, it's sufficiently difficult for bots to migrate between islands that each evolves it's own little local sub-species.  I can actually zoom out and see that each islands has it's own unique color of surrounding bots, where the colors of islands in close proximity are more similar than those far apart!  Way way cool.

Quote
Hey Num!

What's the deal with the monkey?

He went extinct.  His avatar got populated from an adjacent island.  
Title: South Pacific Sim
Post by: Griz on April 07, 2006, 03:34:47 PM
no doubt I'll have to decrease the field size.
I'll try to compensate by scaling down the pop of veggies and starting bots
and see if it's still works and is interesting.

I'm always tring to find was of isolating populations ...
using gravity and selective placement windows for veggies up hgh
or along one edge.
I wonder if it possible to have mulitple placement windows for veggies?
I've tried having more than one species of veggie ...
but seems the prog ends up only doing repop events for one of them.

ok
more ideas to play with.

Eric ...
are you retired, independantly wealthy with time on your hands ...
or do you do all this in you 'spare' time.
hmmmm ....
or perhaps locked up somewhere in a correctional facility with
only a computer and internet connection.

whatever ...
glad you're doing it.
Title: South Pacific Sim
Post by: EricL on April 07, 2006, 03:47:24 PM
Quote
or perhaps locked up somewhere in a correctional facility with
only a computer and internet connection.
Hey, she swore she was 18.  How was I to know?

Actually, DB is the best way I've found to not work on my novel.  
Title: South Pacific Sim
Post by: PurpleYouko on April 07, 2006, 03:50:35 PM
Quote
I wonder if it possible to have mulitple placement windows for veggies?
I've tried having more than one species of veggie ...

No it isn't currently possible, however you can have multiple identical species that have different locations.

Quote
but seems the prog ends up only doing repop events for one of them.
Yup. That it does.
It should be pretty easy to change that though. Just randomize the species on a re-pop event and do it again if you get a non-veg.
One of the simpler parts of the code.
Title: South Pacific Sim
Post by: Numsgil on April 07, 2006, 05:29:37 PM
Quote from: EricL
Actually, DB is the best way I've found to not work on my novel.  

Amen.  Hehe.

Quote
Hey Num!

What's the deal with the monkey?

Since I had to upload a new avatar anyway, I went for one that was actually new.
Title: South Pacific Sim
Post by: Griz on April 07, 2006, 08:00:45 PM
Quote
Quote
but seems the prog ends up only doing repop events for one of them.
Yup. That it does.
It should be pretty easy to change that though. Just randomize the species on a re-pop event and do it again if you get a non-veg.
???
are you talking about recoding?

I guess currently the first veggie species is locked in ...
so that needs to be randomized ...
and then checked to see the species selected is a veg ...
if not,  randomize again?

if this is so ...
then it could be a different species, yes ...
as long as it was recognized as being a veg?

can you point me to where?
and a hint at the code?
Title: South Pacific Sim
Post by: Numsgil on April 07, 2006, 08:09:11 PM
Quote from: Griz
can you point me to where?
and a hint at the code?

Check in the vegs module.  I don't remember the function name, but it's not a large module so it shouldn't be too hard to rat it out.
Title: South Pacific Sim
Post by: EricL on April 08, 2006, 12:29:29 PM
Just FYI, I'm approaching 1M uniterupted cycles on this sim.  Populations still surprisingly steady between 1000 and 1500.  Average bot has over 100 cumulative mutations now.  Average DNA length has actually fallen a few percent from the starting organism (still around 361bp though).  Hmm.  I would have expected it to rise.  I'll have to check the mutation percentages.  

The range of bot colors is amazing, from deep purples and dark blue in the upper left corner through light blue and light green in the middle, to dark green and brown in the lower right.  Amazingly cool.
Title: South Pacific Sim
Post by: Numsgil on April 08, 2006, 12:46:45 PM
How uniform are the colors in each of the little islands?  Personally I try to create settings that limit diversity in environments, sicne, as my reasoning goes, if you have as many different colors as you have bots you must not be strongly selecting or mutation rates are too high.

I have no idea how valid that thinking pattern is though.

As to DNA lengths, generally the first things bots mutate effectively are deletions or inactivations.  You'd be surprised at how mnay things we give our bots to be "better" seem to be the first to drop off.

Whereas insertions of new matterial is quite dangerous, since it could really be anything.  So maybe there's a selective pressure against the insertion of new code, which is why your bots aren't growing in DNA length.

Just a thought, agian, this is really a grey area.
Title: South Pacific Sim
Post by: EricL on April 08, 2006, 01:00:59 PM
I have 25 islands.  In 15 or so, all the bots around an island are the same color.  Each island is very uniform, though colors between islands can be quite different.  Colors for bots around islands near each other are more similar than islands far apart.  In the other 10 cases, there are multiple colors.  In some cases, the colors are extremenly close, so I think it's just recent mutations.  In a few others though, there seem to be multiple species co-existing.  I'll try to attach an image...

Hey, it worked.  The image on the left shows an island with multiple colors.  There are only a few of these though they seem pretty stable.  This one has been showing multiple colors for at least 100k cycles.  The image in the middle gives an example of what most islands look like though each has it's own color.  The image on the far right shows that some island populations have evolved very visible traits such as spewing shots though in general, most island populations seem to favor ties over shots.
Title: South Pacific Sim
Post by: EricL on April 08, 2006, 01:17:53 PM
Here's an image of the whole sim.

Damn, it's too big.  I'll try a clipped view of just part of the sim.  Let's see if the colors are visable at this resolution...

This represents the upper left quadrant of the sim.  Note that some of the islands have been pulled out of place.  They used to form a nice little chain but the bots seem to be able to tug them around at least a little bit and maybe even get one to no longer be fixed.  Memory shot maybe?
Title: South Pacific Sim
Post by: Elite on April 08, 2006, 05:11:56 PM
Yeah, I got that when I was doing an evo sim. Somehow, the bots find a way of unfixing all the vegs  
Title: South Pacific Sim
Post by: EricL on April 09, 2006, 09:38:45 PM
Still going strong.  Well over 1M cycles now.  I'm just blown away by the colors...
Title: South Pacific Sim
Post by: Griz on April 09, 2006, 10:03:53 PM
great ... haven't had an opportunity to play with it yet.
ii think it was elite's bot that moved by reproduction ...
that resulted, with some tweaking, in quite a few color
changes. very visually pleasing.
might be a way to give the user control over how big
a color shift takes place with mutations ...
something I thought about but haven't gotten around
to exploring.
too many irons in the fire!
pesky real life interferring with my DBing.
Title: South Pacific Sim
Post by: EricL on April 10, 2006, 02:22:39 AM
It's not the colors themselves I find so fasnicating, its the magnitude of speciation they represent.
Title: South Pacific Sim
Post by: Elite on April 10, 2006, 05:44:44 AM
Wow, pretty colours

You'll have to document each island's species EricL

Nice sim
Title: South Pacific Sim
Post by: EricL on April 11, 2006, 01:22:41 AM
PY asked about the bots in this sim.  Attached is the guy I started with, EricL1.txt.  Not a very refined bot, still has some bugs, just my own learning bot, but lots of DNA for evolution to work with.  (23 genes, 363bp)

Also attached is just a sample of one of the evolved bots in the sim (34 genes, 383bp) snapped at around 700k cycles (I had to restart a couple of times due to bugs that are fixed in 2.42.2).  He's 134 mutations away from the starting bot.  The text of the mutations is below.

-E


Mutations:
Copy Error changed value of condition from < to ~= at position 294 during cycle 515509
Insertion changed the :  to the flow command: cond at position 213 during cycle 515422
Minor Deletion deleted a run of 1 bps at position 338 during cycle 514548
Copy Error changed value of store command from store to dec at position 117 during cycle 514548
Minor Deletion deleted a run of 1 bps at position 37 during cycle 513025
Point Mutation changed value of flow command from cond to else at position 1 during cycle 512215
Reversal of 5bps centered at  115 during cycle 511453
Insertion changed the :  to the bit command: ~ at position 141 during cycle 510433
Reversal of 3bps centered at  273 during cycle 510304
Copy Error changed value of store command from inc to store at position 89 during cycle 507067
Reversal of 3bps centered at  205 during cycle 506619
Copy Error changed value of condition from != to !%= at position 259 during cycle 504080
Minor Deletion deleted a run of 1 bps at position 200 during cycle 503354
Major Deletion deleted a run of 3 bps at position 152 during cycle 499316
Copy Error changed value of flow command from cond to start at position 104 during cycle 499316
Insertion changed the :  to the *number: *-10 at position 317 during cycle 499108
Insertion changed the :  to the number: 157 at position 222 during cycle 496900
Major Deletion deleted a run of 3 bps at position 85 during cycle 481991
Minor Deletion deleted a run of 1 bps at position 343 during cycle 481981
Minor Deletion deleted a run of 1 bps at position 192 during cycle 481981
Minor Deletion deleted a run of 1 bps at position 50 during cycle 477022
Point Mutation changed value of flow command from else to cond at position 352 during cycle 474308
Reversal of 5bps centered at  263 during cycle 470014
Insertion changed the :  to the number: -115 at position 345 during cycle 470014
Insertion changed the :  to the logic operator: and at position 238 during cycle 470014
Copy Error changed value of flow command from cond to start at position 357 during cycle 464101
Point Mutation changed number from 8 to 9 at position 332 during cycle 442301
Reversal of 3bps centered at  347 during cycle 439678
Point Mutation changed value of store command from store to inc at position 93 during cycle 428709
Reversal of 5bps centered at  44 during cycle 426545
Minor Deletion deleted a run of 1 bps at position 165 during cycle 417101
Reversal of 3bps centered at  363 during cycle 402557
Reversal of 5bps centered at  267 during cycle 402396
Point Mutation changed *number from 707 to 652 at position 268 during cycle 389393
Point Mutation changed value of condition from = to !%= at position 291 during cycle 383206
Point Mutation changed value of flow command from stop to start at position 94 during cycle 381197
Point Mutation changed *number from 707 to 805 at position 245 during cycle 379513
Reversal of 5bps centered at  280 during cycle 359740
Reversal of 3bps centered at  106 during cycle 359740
Point Mutation changed value of condition from > to >= at position 193 during cycle 476011
Point Mutation changed value of basic command from abs to sub at position 39 during cycle 460298
Point Mutation changed *number from 462 to 557 at position 219 during cycle 455445
Point Mutation changed value of flow command from stop to cond at position 13 during cycle 455073
Point Mutation changed number from 50 to 53 at position 252 during cycle 445180
Reversal of 3bps centered at  335 during cycle 429760
Copy Error changed number from 84 to 88 at position 179 during cycle 427983
Reversal of 5bps centered at  60 during cycle 427749
Copy Error changed *number from 503 to 564 at position 85 during cycle 427094
Point Mutation changed number from 467 to 463 at position 224 during cycle 426156
Copy Error changed value of flow command from stop to else at position 351 during cycle 425605
Copy Error changed value of store command from store to dec at position 274 during cycle 425605
Point Mutation changed the flow command: stop to the store command: store at position 240 during cycle 425090
Point Mutation changed the number: 77 to the *number: *77 at position 205 during cycle 422316
Insertion changed the :  to the store command: inc at position 206 during cycle 413313
Point Mutation changed number from 10 to 19 at position 38 during cycle 408276
Copy Error changed value of store command from inc to dec at position 103 during cycle 403517
Insertion changed the :  to the logic operator: and at position 113 during cycle 403500
Copy Error changed *number from 501 to 518 at position 47 during cycle 403264
Minor Deletion deleted a run of 1 bps at position 126 during cycle 399635
Minor Deletion deleted a run of 1 bps at position 144 during cycle 393998
Insertion changed the :  to the store command: store at position 260 during cycle 393985
Major Deletion deleted a run of 2 bps at position 32 during cycle 393724
Insertion changed the :  to the *number: *89 at position 149 during cycle 390285
Reversal of 3bps centered at  353 during cycle 387385
Reversal of 3bps centered at  166 during cycle 387005
Point Mutation changed value of flow command from start to else at position 209 during cycle 379486
Point Mutation changed value of condition from = to <= at position 119 during cycle 353451
Major Deletion deleted a run of 2 bps at position 350 during cycle 353436
Point Mutation changed value of basic command from rnd to abs at position 41 during cycle 351306
Point Mutation changed number from 452 to 456 at position 356 during cycle 339965
Minor Deletion deleted a run of 1 bps at position 265 during cycle 331537
Insertion changed the :  to the bit command: ++ at position 196 during cycle 329431
Point Mutation changed number from 697 to 666 at position 129 during cycle 311742
Point Mutation changed *number from 508 to 475 at position 65 during cycle 308836
Point Mutation changed value of flow command from start to cond at position 86 during cycle 305043
Insertion changed the :  to the flow command: start at position 208 during cycle 290806
Insertion changed the :  to the condition: < at position 300 during cycle 274132
Insertion changed the :  to the store command: inc at position 105 during cycle 261416
Minor Deletion deleted a run of 1 bps at position 253 during cycle 223600
Insertion changed the :  to the *number: *.out2 at position 281 during cycle 211765
Major Deletion deleted a run of 2 bps at position 26 during cycle 203816
Reversal of 5bps centered at  33 during cycle 201158
Reversal of 3bps centered at  295 during cycle 201151
Insertion changed the :  to the flow command: cond at position 62 during cycle 201151
Point Mutation changed *number from 501 to 486 at position 58 during cycle 200466
Major Deletion deleted a run of 4 bps at position 297 during cycle 200129
Point Mutation changed number from 4 to-6 at position 122 during cycle 189624
Point Mutation changed value of flow command from start to else at position 282 during cycle 166993
Insertion changed the :  to the number: .refveldx at position 129 during cycle 166670
Point Mutation changed *number from 454 to 487 at position 353 during cycle 162609
Point Mutation changed number from 6 to-12 at position 107 during cycle 161405
Reversal of 3bps centered at  72 during cycle 160986
Copy Error changed number from 90 to 84 at position 180 during cycle 160986
Major Deletion deleted a run of 3 bps at position 40 during cycle 158904
Point Mutation changed number from 6 to 22 at position 98 during cycle 157817
Copy Error changed value of condition from = to %= at position 5 during cycle 155662
Minor Deletion deleted a run of 1 bps at position 137 during cycle 152923
Insertion changed the :  to the advanced command: angle at position 340 during cycle 144640
Reversal of 3bps centered at  288 during cycle 144101
Point Mutation changed value of basic command from sub to mult at position 185 during cycle 134099
Point Mutation changed *number from 707 to 639 at position 139 during cycle 108575
Major Deletion deleted a run of 2 bps at position 101 during cycle 102159
Point Mutation changed value of store command from store to dec at position 113 during cycle 102056
Point Mutation changed number from 200 to 201 at position 232 during cycle 87405
Point Mutation changed value of condition from > to != at position 233 during cycle 82046
Minor Deletion deleted a run of 1 bps at position 284 during cycle 75400
Reversal of 5bps centered at  310 during cycle 75400
Point Mutation changed number from 314 to 300 at position 302 during cycle 51943
Minor Deletion deleted a run of 1 bps at position 41 during cycle 44642
Point Mutation changed value of store command from store to inc at position 33 during cycle 29979
Point Mutation changed value of condition from < to %= at position 288 during cycle 24660
Point Mutation changed the number: 100 to the advanced command: dist at position 131 during cycle 23240
Point Mutation changed number from 728 to 639 at position 34 during cycle 18720
Reversal of 3bps centered at  355 during cycle 18232
Copy Error changed the flow command: stop to the number: .dx at position 307 during cycle 14812
Minor Deletion deleted a run of 1 bps at position 368 during cycle 11357
Copy Error changed number from 471 to 418 at position 213 during cycle 11041
Minor Deletion deleted a run of 1 bps at position 230 during cycle 5328
Insertion changed the :  to the store command: store at position 172 during cycle 3791
Insertion changed the :  to the bit command: & at position 4 during cycle 1915
Title: South Pacific Sim
Post by: Endy on April 11, 2006, 03:57:04 AM
Do like playing with evolution in restricted enviroments myself. Normally gravity works great. I've also done bots with no movement code at all in a brownian enviroment. Every so often you'll have a trait evolves thats bad to a group overall, but the spread will be naturally limited.

Had some good effects with walls when we had them. One species developed one feeding method, while the other found a completly different method.

Quote
As to DNA lengths, generally the first things bots mutate effectively are deletions or inactivations. You'd be surprised at how mnay things we give our bots to be "better" seem to be the first to drop off.

Whereas insertions of new matterial is quite dangerous, since it could really be anything. So maybe there's a selective pressure against the insertion of new code, which is why your bots aren't growing in DNA length.

I agree with this completly. They also seem to like playing around with the gene structure lately to accomplish inactivations quicker.

Some of what we think would help the bots actually restricts them in an evolving enviroment. They'll be adapting to evolving family, enemies, and the enviroment; what we generally code for is just efficency and fighting enemies in a species/species combat enviroment. There's also a question of fault tolerance. For instance it's better when mutating to either tie permanently at birth or not tie at all. A birth-tie will always naturally deltie itself a regular tie can not be expected to always do the same with mutations involved.

On another note  

Is that how you manage to afford to cruise around so much? I'm onboard a sub and it's insanely expensive just to get us from one port to another.