Author Topic: Chloroplasts  (Read 7544 times)

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
    • DJ Paul Kononov
Re: Chloroplasts
« Reply #15 on: September 25, 2014, 03:28:20 PM »
The vertical line in the middle is 'average' light availability.

The first horizontal line from the top is the point where things are no longer 'average'
The second horizontal is when chloroplasts begin to hurt the robot.

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
    • DJ Paul Kononov
Re: Chloroplasts
« Reply #16 on: September 25, 2014, 03:30:23 PM »
I am also about to send you a simulation I just activated that should show what happens to the following robot over time:

Code: [Select]
cond
  *.chlr
  32000
  <
start
160 .mkchlr store
stop
cond
  *.nrg
  6000
  >
start
  50
  .repro
  store
  15
  .aimdx
  store
stop
end

the .light sysvar was replaced with 32,000 for this experiment, the .light sysvar simply states how much 'light availability' is in the current simulation.

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
    • DJ Paul Kononov
Re: Chloroplasts
« Reply #17 on: September 25, 2014, 04:15:12 PM »
The following is the result of the simulation I have just ran. It clearly shows robots gaining energy quickly until light limits are reached.

Offline shvarz

  • Bot God
  • *****
  • Posts: 1341
    • View Profile
Re: Chloroplasts
« Reply #18 on: September 25, 2014, 04:18:40 PM »
Sorry, I don't get it and the graph is not terribly helpful. Can we just take a simple case of feeding X energy per veggie and go through the logic (can use the math if you want to) of how that number gets used to figure out how much energy each bot gets?

From what I've heard it goes something like this:

X is somehow converted to total amount of "light" L (how?), then each bot gets its share of "L" based on how many chloroplasts it has (c) out of the total number of chloroplasts in the sim (C) =L*c/C

Is that right? Am i asking silly questions and all of this is documented somewhere? It should be.
« Last Edit: September 25, 2014, 04:23:46 PM by shvarz »
"Never underestimate the power of stupid things in big numbers" - Serious Sam

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
    • DJ Paul Kononov
Re: Chloroplasts
« Reply #19 on: September 25, 2014, 04:54:01 PM »
No, not a silly question at all. Not many people can look at a graph and tell right away what the formula for it is. Me included.

Lets say R is the total robot area. Lets say A is the area of the simulations field minus the shapes.

First thing that happens we calculate the simply value for light and store it in robots memory. Lets call that Ls.

Ls = R / (A * 0.85)

We multiply by .85 to account soft collisions in the fastest way possible. But that also means the value can go over 1 so we cap it at 1.

Ls > 1 : Ls = 1

What the robot actually sees in its DNA is the inverse of this value. Lets call this 'light' as it is called in the program.

light = 32000 - (Ls * 32000)

Finally we compute a more workable value for light. Just becomes easier to integrate.

L = (1 - Ls) ^ 2 * 4

Now we deal with each individual robot. There are many factors at play here such as is the robot in pond mode? Is the robot in sunlight? How strong is the sunlight? Is the robot feeding method based on body? etc. We get a Token of a calculation on all this values. Just like in the old system. Lets call this token T.

We divide this token by 3.5 because many people complained it was too overpowering. I mean who wants to bother to manually go back to there simulations and divide a number by 3.5 themselves right?

T = T / 3.5

Now we need a unit value of the amount of chloroplasts a robot has. Let us call that Cu.

Cu = c / 16K

Now we have to calculate what is the rate of adding chloroplasts, lets call that Ra.

Ra = (L * Cu) ^ 0.8 * T * 1.25

Now we have to calculate how much energy a robot is currently loosing by maintaining chloroplasts. Lets call that rate Rs.

Rs = (c / 32000) ^ 2 * T

Finally we calculate how much energy a robot is actually getting and store that into energy or body as defined by the slider.

E = Ra - Rs

(Slider calculations fallow)

It will be cool to get all of this properly documented using latex or another good formula editor.

A robot also looses some energy for creating new chloroplasts if defined in the costs.

Offline Peter

  • Bot God
  • *****
  • Posts: 1177
    • View Profile
Re: Chloroplasts
« Reply #20 on: September 25, 2014, 05:21:18 PM »
Basically the more bots, the less light. Few bots mean more light.
In the graph you can read 'empty space'* for light.
The numbers in on the left is the amount of chloroplasts and they correspondent with the lines. For 32000 chloroplast you see that you take in loads of nrg when the sim is empty and it costs nrg when the sim is full.

The chloroplast numbers are for a individual bot, the nrg giving doesn't take into account chloroplasts in other bots.

*empty space = space not occupied by bots
« Last Edit: September 25, 2014, 05:24:38 PM by Peter »
Oh my god, who the hell cares.

Offline shvarz

  • Bot God
  • *****
  • Posts: 1341
    • View Profile
Re: Chloroplasts
« Reply #21 on: September 25, 2014, 05:59:21 PM »
Quote
light = 32000 - (Ls * 32000)

You lost me here. Where does 32000 come from? Is this the "total amount of light that an empty sim would get"? Is that adjusted for sim size at all?
"Never underestimate the power of stupid things in big numbers" - Serious Sam

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
    • DJ Paul Kononov
Re: Chloroplasts
« Reply #22 on: September 25, 2014, 07:21:35 PM »
Robot DNA only understands values between 0 and (+-)32000. It is 32000 when it is the total amount of light an empty simulation will get, correct. It is adjusted proportional to simulation size. At larger simulation sizes it can take quite a while for this value to get lower, I recommend adding some overlapping shapes to speed things up.

Offline shvarz

  • Bot God
  • *****
  • Posts: 1341
    • View Profile
Re: Chloroplasts
« Reply #23 on: September 25, 2014, 07:52:50 PM »
OK

And what do you mean by

Quote
Finally we compute a more workable value for light. Just becomes easier to integrate.

L = (1 - Ls) ^ 2 * 4

What is "light"? Is it the light = 32000 - (Ls * 32000) or is light calculated by this formula? Or did you mean that 32000 - (Ls * 32000) is what robots see, but that value does not actually figure into further calculations?

And what do you mean by "more workable"? Workable for what? Why do you need to do these operations?

And to progress right to the next issue: If you don't have any funky things like pond mode or wheather, what's going to be the value of the tocken in the most boring of sims?
« Last Edit: September 25, 2014, 08:36:19 PM by shvarz »
"Never underestimate the power of stupid things in big numbers" - Serious Sam

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
    • DJ Paul Kononov
Re: Chloroplasts
« Reply #24 on: September 25, 2014, 08:42:48 PM »
32K - (Ls * 32K) is only what the robot sees.

It is more workable to make smooth transitions for the robots. It was a painful trial and error process.  Did you see the other graph I linked at 15:24:47?

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
    • DJ Paul Kononov
Re: Chloroplasts
« Reply #25 on: September 25, 2014, 08:46:57 PM »
Just the value you specify in the settings. Initial light energy is 40 in F1 mode.

Offline shvarz

  • Bot God
  • *****
  • Posts: 1341
    • View Profile
Re: Chloroplasts
« Reply #26 on: September 25, 2014, 09:14:44 PM »
Quote
It is more workable to make smooth transitions for the robots. It was a painful trial and error process. 

This does not really explain anything. Smooth transitions from what to what? Why do the square any multiply by 4? What's the logic behind it?

Let's go back to our calculations.

Quote
Now we need a unit value of the amount of chloroplasts a robot has. Let us call that Cu.

Cu = c / 16K

What is c? Why do you need to divide it by 16000?

Quote
Now we have to calculate what is the rate of adding chloroplasts, lets call that Ra.

Ra = (L * Cu) ^ 0.8 * T * 1.25

I assume you don't mean "the rate of adding chloroplasts", but mean "amount of energy a bot gets from chloroplasts". But the logic behind multiplying L by Cu completely escapes me. And even more confusing is the "^0.8" part. Why do that? What's the point?


Wow, this is really confusing and does not sound terribly logical. In your email to me you said this was based on my original design, but I would have never designed anything like it :)

Here's what I would have done:

"c" is amount of chloroplasts a bot has

"T" is what you put in settings "per veggie" (in reality it's "per chloroplast)

Then the amount of energy that a bot gets each cycle (E) is:

E=c*T*a

(where a is just a scaling constant to make sure the final number is of the right order of magnitude)

If you want to implement the rule so that the more bots a sim has the less energy they receive (I don't see why you would want that since there are other ways in the program to control total energy flow, but whatever), then the equation becomes:

E=c*T*a*Ls (where Ls is what you calculate as Ls = R / (A * 0.85))
« Last Edit: September 25, 2014, 09:36:50 PM by shvarz »
"Never underestimate the power of stupid things in big numbers" - Serious Sam

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
    • DJ Paul Kononov
Re: Chloroplasts
« Reply #27 on: September 25, 2014, 09:30:19 PM »
You instructed me to make chloroplasts less effective the more robots take up the screen. That is what I did.

I multiply by 4 to get a value of 1 when there is exactly half of screen populated. I take it to the power of 2 to increase the values effectiveness. That is, I am moving it away from 1.

c was from your own example above. It is the amount chloroplasts the robot has.

Yes, sorry, I did mean "amount of energy a robot gets from chloroplasts"

I multiply L by Cu because you wanted less positive stuff to come from chloroplasts when more robots occupy the screen.

I ended up 'de-amplifying' at this point because the results I was getting where a little to drastic for my tastes, hence I am taking to the power of .8
to bring the value closer to 1.

I multiply by 1.25 to balance out chloroplast loss. That is, at ideal conditions (16K chloroplasts at half screen density) the robots will be given the exact value in the 'Token'

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
    • DJ Paul Kononov
Re: Chloroplasts
« Reply #28 on: September 25, 2014, 09:59:41 PM »
Yes Shvarz. What you would have done is the first thing I tried. My point here was, I do not want to 'control' anything. I am a click and watch kind of guy. Maximum results from minimum interaction.

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
    • DJ Paul Kononov
Re: Chloroplasts
« Reply #29 on: September 25, 2014, 10:01:52 PM »
Generally, nothing interesting evolves using the first thing I have tried.