Code center > Darwinbots Program Source Code
Eyes in DB!?
Greven:
This is both a question and a suggestion.
I havent checked this and therefore my question is:
I know that if a bot do use any eye commands, the function is entirely skipped, but what if there is only one, say eye8? Do the program calculate every single eye? I dont know have the eye distance etc. is calculated, but if eye9 aint dependent on anyother eye, there is no meaning in calculating eye1, if only eye9 is represented in the genome. or what? Please reply! Because if the program does this, calculates eye1, when only eye9 is used, this could speed the program!
Ulciscor:
Just wondering if this idea would be messed up by a virus inserting a gene which uses another .eye location? Like a bot using only .eye5 gets an insertion with a reference to .eye8 but this wouldn't work because the program only calculates .eye5.
Unless every cycle the program checks how many eye references there are, and calculates the appropriate values, but wouldn't that take a lot of time?
Carlo:
It works like that: the dna isn't explored at all; instead, each bot has a flag which is called eyeused (or something like that), which is false at birth. When a value is read from any one of the eye locations, that flag is set to true. When the flag is true, the sight routines are calculated. So, each robot sees only from the second time it tries to see in its life; on the other hand, the procedure will still work with viruses or everything else. There's no point in calculating only single eyes, since all eyes are calculated together with a single search on near robots.
Ulciscor:
So does that mean that the first time an eye location is read it won't get a value? Or is it read, the flag set the routine called and then the value passed back?
PurpleYouko:
That is right. When robot age is zero they are completely blind. By age 1 they can recognize everything around them.
Navigation
[0] Message Index
[#] Next page
Go to full version