Author Topic: Population Control and selection pressure without costs  (Read 4838 times)

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
Population Control and selection pressure without costs
« on: August 21, 2007, 05:54:28 PM »
Even though it was my idea, I've long had an issue with auto-adjusted costs as the primary mechainsm for population control in evo sims.  The thesis has been that as bots evolve, they compete for limited resources, adapt, become better competitors and thus we require steeper costs over time to keep the population in check.  But this thesis only works if changes in costs are gradual - oh so gradual - so that selection can drive adaptations over time.  Alas, given our limted cpu resources and small population numbers, auto-costs has to spike up the cost multiplier many orders of magnitude faster than evolution can possibly adapt in order to prevent sims from grinding to a halt when population flurries occur.

Evolution can't provide adapations to sudden, unpredictable, seemingly unexplained bursts of increased costs which exhibit no locality to the event that caused them.   Our sims and popualtions are so small and fragile relative to something like the real world, that the explosive reproduction of a even single parent organism can spike the costs for the whole sim.  That just ain't right.

I've been toying with a new approach, one where costs in a sim can be fixed or non-existant.  Population is controled through prediation.  The problem with prediation as a menas for population control in the past has been keeping the preditors in line.   Generally, they either desimate the non-preditors and then die out or they overbreed and swamp the sim or get infected by a virus and stop doing what you wanted, etc.

We now have all the options we need to prevent unwanted mutation, breeding and virus infection of a species.  But the preditors still don't have a way to know when to cull the herd and when to lay off.

So, I've added two new sysvars in 2.43b.    

.totalbots (401) is read only and returns the total number of bots (including corpses, autotrophs, etc.) in the sim.

.totalmyspecies (402) also read only, returns the total number of bots in the bot's "species".

Now, evo sim folks can build a preditor that respects the total sim population and controls their own numbers.  I've been playing in my own evo sim with a version of Animal_Minimalis that stops feeding when the total sim population drops below a certain number and stops breeding when it's own population rises above a certain percentage of the total.  If they are configured as virus immune and prevented from mutating, they become an effect means of population control in an evo sim - part of the environment in essense - one other bots can potentially see, defend against and run from.

More sophisitcated strategies are possible.  Preditors can choose to move faster, bite harder, etc. as populations grow and scale back their attacks all the way to doing nothing as they decline.  They can even read the .totalmyspecies memloc of perspective victims and decide whether to prey on them or not.

The important point in all this is that unlike random cost spikes, evolution can adapt to preditors.   Over time, I would expect to see preditor avoidance DNA selected for.      

Comments?
Many beers....

Offline googlyeyesultra

  • Bot Destroyer
  • ***
  • Posts: 109
    • View Profile
Population Control and selection pressure without costs
« Reply #1 on: August 21, 2007, 06:05:51 PM »
Very interesting. I wonder what I can do with this for F1. . .

Also, thanks for picking memory locations no bots (at least that I've seen) use.

One thing I have to wonder: If totalbots includes corpses, then won't a predator continue killing, even if most of the remaining enemy bots are corpses? Essentially, how will it tell how many are dead and how many are alive? Does totalmyspecies work the same, and also return corpses of my species?

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
Population Control and selection pressure without costs
« Reply #2 on: August 21, 2007, 06:39:44 PM »
Yes, it is possible for preditors to feed beyond the intended limit because corpses are counted in the total.  But corpses decay away and I think you would have to pick an extremely slow corpse decay rate for this to be an issue.  If people find this to be a problem going forward, I can add a .totalcorpses or something similar.

Corpses are NOT currently counted in .totalmyspecies.  Corpse is essentially it's own special built-in species, similar to the way graphs work now.

We actually have a great deal of free memory space remaining - only 217 memory locations are currently reserved by the system.  Bots can use the rest for their own purposes of course, but even so...
Many beers....

Offline googlyeyesultra

  • Bot Destroyer
  • ***
  • Posts: 109
    • View Profile
Population Control and selection pressure without costs
« Reply #3 on: August 21, 2007, 08:37:52 PM »
We might want to (perhaps when we add in the egrid and what-not), set up a large block (preferably at least 100 contiguous variables) that are reserved exclusively for free variables. Since we'd be breaking most old bots anyways, we could reorganize which sysvars are where.

Offline Martian

  • Bot Neophyte
  • *
  • Posts: 44
    • View Profile
Population Control and selection pressure without costs
« Reply #4 on: August 22, 2007, 05:37:35 AM »
Quote from: EricL
Comments?

I like it.  

Offline Jez

  • Bot Overlord
  • ****
  • Posts: 788
    • View Profile
Population Control and selection pressure without costs
« Reply #5 on: August 22, 2007, 06:35:08 AM »
That's a very neat way of allowing predators in the evosims, I like it!
If you try and take a cat apart to see how it works, the first thing you have in your hands is a non-working cat.
Douglas Adams

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Population Control and selection pressure without costs
« Reply #6 on: August 22, 2007, 09:08:10 AM »
I like it for evosims.  But for the leagues I think it's too overpowered.  Set up a toggle so the leagues can turn it off.  Maybe even a toggle to turn it off for different species, so just your guardian bots can access it.

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
Population Control and selection pressure without costs
« Reply #7 on: August 22, 2007, 10:53:12 AM »
I'm happy to disable these in league mode if people like.  I don't really have a stong opinion there.  But let me make the case for a sec that they should be left enabled for leagues.

Think of these as a poor man's (I.e. computationally inexpensive) way for a bot to know in a single cycle how crowded things are and how much they are responsible for the crowding - a substitution of sorts for looking around and counting bots over the course of many cycles.  Given infinite time on my part and infinite cpu cyles, I would have instead implemented something with more locality - a bot relative indication of the population of total bots within a certain distance and an indication of how many of those bots are of the same species.  But that would have been computationally expensive not to mention take a while to implement.  The way it is, with the totals being for the entire sim, there is only the tiniest of cpu perf impact from populating these.

When I think of what could be done in leagues with these, the things that come to mind are all pretty sophsiticated I.e. running from a fight and trying to find a veggy to gain some nrg to repopulate instead of attacking when your own species population is below a certain percentage or the total, attacking with more vigor or in concert when the opposite is true as a bot might assume the probability of others of its species being near is high, counter measures such as faking out a bot coded to care about relative population by giving birth to a large number of weak offspring to fake out the numbers for a time, etc.

Don't we want to encourage sophisticated coding in the leagues?  Perhaps I am missing something fundemental w.r.t. how these might be unfarily used...
Many beers....

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
Population Control and selection pressure without costs
« Reply #8 on: August 22, 2007, 11:19:55 AM »
Quote from: googlyeyesultra
We might want to (perhaps when we add in the egrid and what-not), set up a large block (preferably at least 100 contiguous variables) that are reserved exclusively for free variables. Since we'd be breaking most old bots anyways, we could reorganize which sysvars are where.
Sounds good.  Even today, we could designate locations 50-149 as free variables and reserve all others for potential system use....
Many beers....

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Population Control and selection pressure without costs
« Reply #9 on: August 23, 2007, 12:32:14 AM »
Quote from: EricL
I'm happy to disable these in league mode if people like.  I don't really have a stong opinion there.  But let me make the case for a sec that they should be left enabled for leagues.

Think of these as a poor man's (I.e. computationally inexpensive) way for a bot to know in a single cycle how crowded things are and how much they are responsible for the crowding - a substitution of sorts for looking around and counting bots over the course of many cycles.  Given infinite time on my part and infinite cpu cyles, I would have instead implemented something with more locality - a bot relative indication of the population of total bots within a certain distance and an indication of how many of those bots are of the same species.  But that would have been computationally expensive not to mention take a while to implement.  The way it is, with the totals being for the entire sim, there is only the tiniest of cpu perf impact from populating these.

When I think of what could be done in leagues with these, the things that come to mind are all pretty sophsiticated I.e. running from a fight and trying to find a veggy to gain some nrg to repopulate instead of attacking when your own species population is below a certain percentage or the total, attacking with more vigor or in concert when the opposite is true as a bot might assume the probability of others of its species being near is high, counter measures such as faking out a bot coded to care about relative population by giving birth to a large number of weak offspring to fake out the numbers for a time, etc.

Don't we want to encourage sophisticated coding in the leagues?  Perhaps I am missing something fundemental w.r.t. how these might be unfarily used...

The way I see it tracking how many of your species is left is a complex behavior that bots should have to build for themselves.  We could also give bots information on how much slime there is in other bots, or information like that.  But I think determining things like this is central to the challenge.  The leagues are all about building sophisticated behavior from simpler building blocks.  I'd like to keep those building blocks as ground level and justifiable as possible.  Makes a bot all the more impressive.

Offline Jez

  • Bot Overlord
  • ****
  • Posts: 788
    • View Profile
Population Control and selection pressure without costs
« Reply #10 on: August 24, 2007, 05:53:01 PM »
I don't see that this would give bots an undue advantage in the leagues;

It seems a James Bond sort of theme tune 'kill or be killed' might be apt, certainly with the 'instakill' mkshell shots (fixed yet?) it's a sort of non sequitur, I can't see Guardian caring about how many targets it has left!

On the other hand, being as this could be seen as a passive advantage, I think that it could encourage new and novel behaviour among league bots and might be a positive change.
If you try and take a cat apart to see how it works, the first thing you have in your hands is a non-working cat.
Douglas Adams