Darwinbots Forum
Code center => Bugs and fixes => Solved Bugs => Topic started by: Testlund on September 08, 2013, 07:05:56 AM
-
Some bots gain chloroplasts when they shouldn't. No .mkchlr command in the dna.
-
Hmmmmmmmmm, I have no idea about this. I'll have a look at this later.
-
What is the name of the robot? There is a good chance that it is not using .mkchlr directly. Example:
It may doing something like:
160 910 11 add store
which will be translated to:
160 921 store
that should translate to:
160 .mkchlr store
edit: there is no mutations in this simulation, that makes the problem easier to diagnose. I think the name of the robot being refereed to is "PokeMe." Panda do you want to take it, or you want to do it? If you want me to do it will not be earlier then 5pm Berlin time.
-
It's the bot PokeMe shown on the picture to the upper left. I know it doesn't have any dna for chloroplasts since I wrote it and it hasn't mutated yet. There are a few other bots with the same if you click around. :)
-
oh sorry, did not see the picy right away.
-
I think I found it, it is the altzheimer code. It has to do with waste.
It was effecting .chlr directly.
-
Then they are more sensitive to waste than they should be imo, cause I've set it quite high, and most of the bots with chloroplasts don't have any waste at all.
-
Altzheimer is definitely a possibility, it can overwrite mkchlr. I disabled this feature just now for a test only.
What is really bothering me is, chloroplasts should never have floating point values. edit: eh, nm, that will happen if the robot reproduces.
Anyway, I gtg, try this version and see if it fixed it, If not I'll keep digging.
Panda, try some stuff, maybe you can figure it out.
-
Panda, here is the exact code I implemented btw:
Private Sub altzheimer(n As Integer)
'makes robots with high waste act in a bizarre fashion.
Dim loc As Integer, val As Integer
Dim loops As Integer
Dim t As Integer
loops = (rob(n).Pwaste + rob(n).Waste - SimOpts.BadWastelevel) / 4
For t = 1 To loops
loc = Random(1, 1000)
If loc = mkchlr Then Exit For
val = Random(-32000, 32000)
rob(n).mem(loc) = val
Next t
End Sub
-
eh, I goofed up, I am bypassing the entire loop...
Private Sub altzheimer(n As Integer)
'makes robots with high waste act in a bizarre fashion.
Dim loc As Integer, val As Integer
Dim loops As Integer
Dim t As Integer
loops = (rob(n).Pwaste + rob(n).Waste - SimOpts.BadWastelevel) / 4
For t = 1 To loops
loc = Random(1, 1000)
If not loc = mkchlr Then
val = Random(-32000, 32000)
rob(n).mem(loc) = val
End If
Next t
End Sub
That should be cleaner.
Panda, go ahead and post your exe mods here.
Unless, I just figured out what the problem was.
-
I can't remember why I made them floating point variables, I think it was because energy and body were. It won't be a big issue to change this, though. Do you want me to change it? Erm, other than that there might be something a little bit wrong with the managing chloroplasts code. I'll have a go at it, though. Only just got to doing any of this. Spent the whole day packing for university.
EDIT: oh and did we do the tie sharing chloroplasts code or...?
-
emmm, no that is fine, it was fun to hack a robot to start with 1001 chlr and watch it reproduce. :P
1001
500.5
250.25
etc.
-
Spent the whole day packing for university.
good luck :)
EDIT: oh and did we do the tie sharing chloroplasts code or...?
Yea, I have implemented what you svn'd me. Would not hurt to check if that is working.
Btw, when I checked it, seemed to work backwards. 1% will give most energy to tie robot while 99% gave the least. I am ns if that is just for chloroplasts, or, are all sharing functions written backwards? Never had enough energy to check...
-
I think I wrote it in the same with the rest. Also, Testlund, did any of your other bots use venom or something because that corner bot has a seriously messed up memory?
EDIT: I only say this because it is really just that collection of bots there that have the chloroplasts but there are other bots with very messed up memories also.
-
that corner bot has a seriously messed up memory.
That is what I am talking about, it is altzheimers man.
-
I can't see how that code could be messed up like that, though. I looked at the settings and the threshold is higher than any bots waste.
-
I looked at the settings and the threshold is higher than any bots waste.
What settings? And, who cares it is just waste...
edit: Panda, I want you to make the decision on should we have altzheimers effect .mkchlr or not by the end of the day.
-
I think it shouldn't be bypassed, it is just like every other memory location, but I think for robots to have such a high number of memories messed up like that with waste 40* smaller than the threshold there must be something else wrong.
-
Unless they temporarily had a large amount of waste and got rid of it. Could that have happened in your bot, Testlund?
-
Unless they temporarily had a large amount of waste and got rid of it. Could that have happened in your bot, Testlund?
I'm trying to figure that out. I've been running the two latest beta versions at the same time now on each core with identical sims and it appeared Botsareus never really turned the waste function off, cause they got alzeimers in both instances, but than I realized I should have run with waste treshold set to -1 instead. Lol.
Well, altzeimers seems to work as it should, putting random values in chloroplasts and other places.
I'll run a test with waste treshold set to -1 now to see what happens. :)
-
Ok, this is what I think happened.
In the sim I uploaded in the zip file the program decided that Alzheimer's should mostly affect chloroplasts. That seemed odd and why I thought there was something wrong. Waste threshold was set to 4096 and most bots didn't have any waste when I looked.
When I ran the two beta versions, as Alzheimer's started to build up it favored to affect venom first and once it got to the waste threshold it started to affect everything randomly.
Maybe it was some pseudo random/seed thing that caused this difference.
In my last test with waste threshold set to -1 there was no Alzheimer's.
-
I just got back, I may know what is going on here:
I have changed the way feedvegs2 works: I made it work across all robots and I made it dependent how much chloroplasts a robot has:
Public Sub feedveg2(t As Integer) 'gives veg an additional meal based on waste 'Botsareus 8/25/2013 Fix for all robots based on chloroplasts
With rob(t)
If .nrg + (.Waste / 2) * (.chloroplasts / 32000) < 32000 Then
.nrg = .nrg + (.Waste / 2) * (.chloroplasts / 32000)
.Waste = .Waste - .Waste * (.chloroplasts / 32000)
End If
End With
End Sub
This means the more chloroplasts a robot has the more waste it converts into energy.
Sorry for the confusion, I only realized this can be the culprit half way to the mall.
edit: I am thinking get rid of the mkchlr block that I just implemented, and do something about this specific function.
Any ideas?
edit:
rofl, how appropriate: the conversation is about Alzheimer's
-
Yeah, I don't like having that block there, I can't see how it's that subroutine that is causing the problem as it doesn't modify the number of chloroplasts does it?
-
No, it does not
Your question was:
Unless they temporarily had a large amount of waste and got rid of it. Could that have happened in your bot, Testlund?
I may have your answer.
-
What do you think we should do Testlund?
Here is essentially what is happening:
Robot gets a sh*t load of waste
Robot gets Alzheimer's
Alzheimer's causes robot to use chloroplasts
Chloroplasts dump the robots waste into energy
-
Oh of course! That is why! You genius, bots!
-
What do you think we should do Testlund?
Here is essentially what is happening:
Robot gets a sh*t load of waste
Robot gets Alzheimer's
Alzheimer's causes robot to use chloroplasts
Chloroplasts dump the robots waste into energy
Well, I don't see anything wrong with that really, now when I understand what's going on.
But since you asked, how about a .fdwaste sysvar? You could have a more interesting eco sim with that, instead of waste automatically turns into chloroplasts.
Edit: Bah! I got that wrong! Ok, chloroplast converts waste to energy? Ok.