Author Topic: Population Control and Energy Management Aren't Intuitive  (Read 1692 times)

Offline PhiNotPi

  • Bot Builder
  • **
  • Posts: 64
    • View Profile
Population Control and Energy Management Aren't Intuitive
« on: February 23, 2014, 07:22:31 PM »
Edit: I think I make a better argument in my most recent post.

Original post:

I feel that the current (2.46.02) method of energy management and population control is inadequate and counter-intuitive.  In the past, when repopulating and veggies were the same, the system was simple.  Now, with chloroplasts, it is not as simple.

With chloroplasts, there is no set definition of a "veggy."  Bots with many chloroplasts are more veggy-like, while bots with few veggies are pretty much carnivores.  So, menu options like "40 NRG veggy per cycle" does make any intuitive sense.  Given the variability of light level and chloroplast count, chances are that not a single robot received exactly 40 NRG in that particular cycle.  Also, settings like "maximum number average veggies" don't make sense, as they now involve the number of chloroplasts in the sim.

There are a few functions for population control and energy management:

  • Limiting the flow of nrg into the simulation.  This, in turn, helps to create a competitive environment.
  • Simply limiting the total number of robots, which directly improves simulation speed.

Let's focus on the first function.  It is important to limit the flow of energy into the sim.  I think that focusing on the total number of chloroplasts is not necessarily (as of right now) the best way to do it.  The efficiency of chloroplasts depends on how they are distributed (many chloroplasts in one bot, vs few chloroplasts in many bots).

Here are actual measurements, taken at a size 3 sim set to "40 NRG veggy per cycle."  Here, "avg chlr" is equal to the total number of chloroplasts divided by 16000, since that is what is used to determine the repopulation limits and is what is displayed at the bottom of the screen.  I calculated the total nrg per cycle, to give a good idea of how much energy is entering the sim, as well as the nrg per avg chlr per cycle, to balance for the fact that more chloroplasts generate more energy.
  • 325 bots, 1 chloroplast each, light level 30837: Total of 20 nrg per cycle.  About 985 nrg per avg chlr per cycle.
  • 1 bot, 325 chloroplasts, light level 31996: Total of 7 nrg per cycle.  About 345 nrg per avg chlr per cycle.
  • 32 bots, 1000 chloroplasts each, light level 31820: Total of 512 (but sometimes 544) nrg per cycle. About 256 (sometimes 272) nrg per avg chlr per cycle.
  • 1000 bots, 32 chloroplasts each, light level 28422: Total of 1000 nrg per cycle.  About 500 nrg per avg chlr per cycle.
  • 1 bot, 32000 chloroplasts, light level 31996: Total of 224 nrg per cycle.  About 112 nrg per avg chlr per cycle.
  • 30 bots, 32000 chloroplasts each, light level 31798: Total of 6660 nrg per cycle. About 111 per avg chlr per cycle.

So, I guess my point here is that these settings don't do a good job of describing their effects.  The setting of "40 NRG veggy per cycle" does not describe these end results.

First of all, this setting should be renamed to include chloroplasts in its name, because it does not involve the number of veggies.  Rather, it involves the number of chloroplasts.  It functions as a multiplier on the feeding formula. 

If a bot has a high number of chloroplasts, each bot can receive up to 5x as much nrg per cycle as compared to the setting.  If there are many bots, with the same total number of chloroplasts, then there is a very high efficiency, and the nrg per avg chloroplast is much higher than the setting.  You can see this above.

One thing to point out is that this change in efficiency (as the chloroplasts per bot decreases) is actually pretty major.  Let's say that you start with 1 bot with 32000 chloroplasts.  Then it slowly divides into 1000 bots with 32 chloroplasts.  Now, even though the chloroplast count remains constant, the rate of nrg creation has quadrupled.  There are 1000x more bots to share that energy, so each individual bot gains energy very slowly, but there are also 1000x more bots with the ability reproduce.  This all cancels out in the end, so you actually end up with a rate of reproduction which increases over time.  On this basis, I don't think that the current system does a good job of accomplishing task #2, which is to limit population.

The main problem is that these settings (max number of veggies and NRG per veggy) do not do a good job of telling me how much energy is entering the sim.

Most of this can be alleviated by renaming the settings to something meaningful, like changing "veggy" to "chloroplasts."  This will fix some confusion.

Some of this, I don't really know how we might fix it.

One possibility is changing the chloroplast formula by dividing all feeding rates by the magic number 3.54.  This way, when you enter 40 NRG per veggy per cycle into the text box, then the feeding rates are actually multiplied by 11.3 rather than 40.  That way, when a veggy has 16000 chloroplasts (1 "avg" chloroplast) and 32000 light, then it will actually receive 40 energy per cycle.

A second possibility is the creation of two maximums.  There could be the maximum number of chloroplasts (like currently), as well as the maximum number of repopulating robots.

A third possibility it that we can change the way that we turn the sun off once energy levels are too high.  Rather than toggling the sun completely, we can just lower the feeding rates once nrg is above a certain level.  Completely turning off the sun destroys any advantage to having chloroplasts, but lowering the feeding rates accomplishes the same goals without destroying those advantages.

A fourth possibility is to change the chloroplast formula by dividing all feeding rates by the magic number 26.27.  This way, the "NRG per veggy" setting, multiplied by the "max avg. veggies" setting, gives the actual maximum feeding rate for the entire sim.  So, if I have 40 NRG per veggie and 1 max veggy, then there will be an absolute maximum of 40 nrg per cycle (this implies 1 chlr per veggy, as that is the most efficient).

These are just ideas I am throwing around, but the main goal is to make energy management and population control more intuitive and meaningful.
« Last Edit: February 24, 2014, 10:28:34 PM by PhiNotPi »
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: Population Control and Energy Management Aren't Intuitive
« Reply #1 on: February 24, 2014, 09:37:49 AM »
The idea behind the feeding rate is that it is dead on when half the screen is populated.
I don't really see a reason why vegys at the beginning of the simulation should not get more energy, I do want the populations to grow quickly.
You can always reduce feeding rates in your simulation to what ever you like, no one is stopping you.
Also, you can add overlapping shapes to your simulation to limit light levels to whatever you like.
However, we do need to come up with more meaningful names.


edit:

The only thing I was just considering is changing the ^0.8 in my formula to ^0.6 (you should have my excel file) But then the whole thing looks liner.
I do not want it to look liner.

Maybe I can meet you half way? Divide everything by 1.77? But then, (considering 16K chlr) that means at half screen area with feeding rate 40 the robot just gets 22, I do not like that.  :(


edit:

I have another idea.

How about I divide the feeding rate by 3.5 (compilers like round numbers) and call it "initial feeding rate" instead of simply feeding rate?
Then all I have to do is multiply the F1 rules by 3.5...
« Last Edit: February 24, 2014, 10:37:12 AM by Botsareus »

Offline Peter

  • Bot God
  • *****
  • Posts: 1177
    • View Profile
Re: Population Control and Energy Management Aren't Intuitive
« Reply #2 on: February 24, 2014, 03:31:46 PM »
It should be simple to understand. A optimal chloroplast gene should be short and not too hard to understand. So I don't newbies don't have trouble understanding it.

As example, it should be as simple as this.
Code: [Select]
cond
 *.light
 *.chlr >
start
 *.light *.chlr sub .mkchlr store
stop

How about I divide the feeding rate by 3.5 (compilers like round numbers) and call it "initial feeding rate" instead of simply feeding rate?
Then all I have to do is multiply the F1 rules by 3.5...
Is the feeding rate of the veggies in F1  based on that half of the screen is filled with bots, compared with the original feeding rate?
Oh my god, who the hell cares.

Offline PhiNotPi

  • Bot Builder
  • **
  • Posts: 64
    • View Profile
Re: Population Control and Energy Management Aren't Intuitive
« Reply #3 on: February 24, 2014, 10:25:57 PM »
The main thing (which might have been just me)  is that the number 40 just felt like an arbitrary multiplier.  For example, it is hard to determine how much energy you are actually feeding the veggies, without doing a measurement after the fact.

Before chloroplasts were implemented, if I set "max veggies = 200" and "20 nrg per veggy," then I knew that there is going to be 4000 nrg created every cycle, as well as 200 veggy bots in the sim.  Now, if I set "max veggies = 200" and "20 nrg per veggy" then I honestly have no clue how many bots are going to be in the sim, or how much nrg is going to be created.

I feel that, in general, the settings tend to drastically underestimate the amount of energy put into the sim.  Why?  I think it has to do with the choice of light level as the "baseline."  Currently, 16000 light is the baseline (half the screen).  Does this ever happen?  If I put 1000 bots in a size 1 sim, then the light level is still slightly over 25000.  So, every veggie receives much more energy than what the settings imply. 

For example, take that one simulation in which there were 1000 veggies (16000 chlr each) in a size 1 sim.  There was 10000 total "avg" chloroplasts, a setting of 100 nrg per veggy, and a light level of about 25000.  The "intuitive prediction" is that the veggies will receive 1000 chlr * 100 nrg = 100000 nrg per cycle.  Rather, they receive 237000 nrg per cycle because of the very high light level. If you look at my attachment, however, you can see that it is very overcrowded and this doesn't make sense!

Nothing has to be fundamentally altered, you don't have to change any exponents (actually, please don't).  I think that there should be a "scaling factor" of sorts.   Basically, since the actual feeding rates are always higher than what the settings imply (since light level is always pretty high), we can divide the feeding rate by a scaling factor to make the effects more similar to what the settings imply.

I propose a scaling factor of 1/3.53929, which makes the "baseline" light level equal to 32000 rather than 16000.

To see how this makes things better, take the "intuitive" prediction of 100000 nrg for the sim I was talking about earlier.  Without the scaling factor, the sim receives 237000 nrg per cycle.  With the scaling factor, the sim receives 66963 nrg per cycle.  This is much closer to the prediction, given the insanely high amount of crowding which reduces light level.
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: Population Control and Energy Management Aren't Intuitive
« Reply #4 on: February 25, 2014, 11:11:36 AM »
Quote
Is the feeding rate of the veggies in F1  based on that half of the screen is filled with bots, compared with the original feeding rate?
It is...

Actually I tend to agree.

Added Peter to credits and a little fix for PhinotPi.
In other news:  Tournament league is almost done, should have Stepladder league done by the end of the week.
« Last Edit: February 25, 2014, 11:13:49 AM by Botsareus »