Darwinbots Forum

Welcome To Darwinbots => Newbie => Topic started by: shvarz on September 24, 2014, 09:19:17 PM

Title: Chloroplasts
Post by: shvarz on September 24, 2014, 09:19:17 PM
OK, i'm not a newbie, but rather an oldie so old that he lost touch...  ;)

Can someone explain to me how chloroplasts work and how they relate to the other options for energy for bots?

And since we are on the topic, do we even need an option to feed veggies in ways that are not chloroplast-dependent?
Title: Re: Chloroplasts
Post by: Botsareus on September 24, 2014, 09:40:00 PM
Your plants will now have to have a 'chloroplast' gene. I will have to link you the feeding rate charts and all the good stuff. No energy to do so now, long Karate lesson  :) You should find an Alga_Minimales_Chloroplastus in the robots folder. I recommend running the chloroplast ecosystem shipped with version 2.48.15. Good luck! If anyone has anything else to add, please do. I take Thursdays off.  :) Update soon. Thank you for stopping by.
Title: Re: Chloroplasts
Post by: shvarz on September 24, 2014, 10:54:35 PM
Thanks. That part I kind of figured. The more chloroplasts you have, the more energy you get if the sun is up. Does that calculation take into account the settings to give energy "per cycle" "per kilobody" or "quadratic per kilobody"? If it does, how?
Title: Re: Chloroplasts
Post by: Shadowgod2 on September 25, 2014, 12:29:35 AM
those work but in a different manner. it's calculated by both chlr and body (except on the per cycle). the chlr is the main then the body has the least effect on energy. you can tell when a bot becomes a bigbirtha and has had 32000 chlr for a while and just becomes day. they start slow but quickly gain speed. i can't be any more specific without showing graphs and i don't have the time to make them.
Title: Re: Chloroplasts
Post by: shvarz on September 25, 2014, 06:54:51 AM
So, if "per veggie" is turned on, then chloroplasts don't count at all or does each veggie get extra energy?

Seems like these options are not really necessary anymore.

Do chloroplasts contribute a lot to the size of the bot? How much do they contribute to the body and weight? Any other downsides to having chloroplasts?
Title: Re: Chloroplasts
Post by: Shadowgod2 on September 25, 2014, 12:48:09 PM
On the per vegi only chlr count. If you have a bot without chlr as a vegi it will not gain nrg.

emagin each chlr as it's own vegi bot living inside the bot that has chlr. Each one is only able to get a small amount. Add more chlr more nrg gain. Then with the other sets aply the same logic but for each chlr the nrg is multiplied by each body of what ever the set is
Title: Re: Chloroplasts
Post by: shvarz on September 25, 2014, 01:31:46 PM
Thanks, this is quite helpful.

The logic of multiplying by body points is not clear, however. What is it meant to simulate?

How much do chloroplasts cost to make? Do they decay over time?

Also, it looks like now "repopulation" is driven by chloroplast count. Why and how does it work?
Title: Re: Chloroplasts
Post by: Shadowgod2 on September 25, 2014, 02:50:41 PM
Ok so sence I am currently trying to forge out a knife I only have small amount of time to post. I even had to stop 5times just to post this. So 1 ? at a time I can answer
Title: Re: Chloroplasts
Post by: Shadowgod2 on September 25, 2014, 02:55:56 PM
? 1 body is like leafe coverage the more body the larger the leaf
Title: Re: Chloroplasts
Post by: Shadowgod2 on September 25, 2014, 03:01:31 PM
?2 chlr is by default f1 sets costs .02

?3 bots has to tell you that or at least someone who does know
Title: Re: Chloroplasts
Post by: shvarz on September 25, 2014, 03:01:55 PM
Quote
? 1 body is like leafe coverage the more body the larger the leaf

Sorry, but that does not make any sense. If you are getting energy from chloroplasts, then it should not matter how large your body is. For one, body is not equal size in DB2. Second, spreading the same number of chloroplasts over a larger space should not give you more energy.
Title: Re: Chloroplasts
Post by: Botsareus on September 25, 2014, 03:05:48 PM
That is why it is optional.  :) Good news  is I have enough time right now to actually link you a pritty graph. Going to go fireup XP.
Title: Re: Chloroplasts
Post by: Shadowgod2 on September 25, 2014, 03:14:26 PM
I'll get you a pic tonight of what I mean
Title: Re: Chloroplasts
Post by: Botsareus on September 25, 2014, 03:21:40 PM
TY Shadow, I got it.
Title: Re: Chloroplasts
Post by: Botsareus on September 25, 2014, 03:24:47 PM
The graph below shows what the energy gets multiplied by over the amount of light availability.
Title: Re: Chloroplasts
Post by: Botsareus 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.
Title: Re: Chloroplasts
Post by: Botsareus 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.
Title: Re: Chloroplasts
Post by: Botsareus 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.
Title: Re: Chloroplasts
Post by: shvarz 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.
Title: Re: Chloroplasts
Post by: Botsareus 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.
Title: Re: Chloroplasts
Post by: Peter 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
Title: Re: Chloroplasts
Post by: shvarz 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?
Title: Re: Chloroplasts
Post by: Botsareus 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.
Title: Re: Chloroplasts
Post by: shvarz 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?
Title: Re: Chloroplasts
Post by: Botsareus 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?
Title: Re: Chloroplasts
Post by: Botsareus on September 25, 2014, 08:46:57 PM
Just the value you specify in the settings. Initial light energy is 40 in F1 mode.
Title: Re: Chloroplasts
Post by: shvarz 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))
Title: Re: Chloroplasts
Post by: Botsareus 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'
Title: Re: Chloroplasts
Post by: Botsareus 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.
Title: Re: Chloroplasts
Post by: Botsareus on September 25, 2014, 10:01:52 PM
Generally, nothing interesting evolves using the first thing I have tried.
Title: Re: Chloroplasts
Post by: shvarz on September 25, 2014, 10:03:38 PM
Maybe I'm blanking, but I don't remember ever suggesting anything you describe. Maybe you are confusing me with someone else?

From what I understand your calculations are driven mostly by the desire to adjust for something or make something to work better, but it's not clear at all to me what it is that you are trying to optimize and why do you choose that particular way to fix it. The final result makes very little sense to me. Maybe we should have another chat (or even voice) session tomorrow?
Title: Re: Chloroplasts
Post by: Botsareus on September 25, 2014, 10:06:54 PM
That would be cool. Give me a time frame, I would love to properly talk to you in our native language. Anything after 11 AM ET is fine. Send me an email.  :)
Title: Re: Chloroplasts
Post by: Botsareus on September 26, 2014, 01:57:40 PM
I just realized that the sediment level in chloroplast ecosystem .set is a little too overpowering.
I am going to play with it a little and post a screen shot of result.
Title: Re: Chloroplasts
Post by: Botsareus on October 01, 2014, 03:01:23 PM
Alright, found cleaner solutions. Testing now for 43 hours.
Title: Re: Chloroplasts
Post by: Botsareus on October 10, 2014, 05:57:00 PM
Results from the latest chloroplast experiment (attached 200 cycles/dp)

Average life expectancy for chloroplasts is now 750 cycles.

Next version of Darwinbots is nearly here.