Darwinbots Forum
Bots and Simulations => DNA - General => Topic started by: Welwordion on April 14, 2006, 08:44:27 PM
-
ok first:
cond
*.function 0 =
*.swarming 0 =
*.refeye *.myeye =
*.eye1 *.eye2 add *.eye3 add *.eye4 add *.eye5 add *.eye6 add *.eye7 add *.eye8 add *.eye9 add 0 =
or
start
.out3 .tmemloc store
*.tmemval .out1 store
stop
Duid I use the or right? I want it to activate when it sees only his brethren or nothing.
second:
cond
start
.satposx .tmemloc store
*.tmemval .satposx store
stop
cond
start
.satposy .tmemloc store
*.tmemval .satposy store
stop
In order to move the tied unit will be killed, before that happens this information has to be stored.
However the surviving unit uses satposx and satposy usually for his own information storage.
So which cond to insert?
-
The first gene looks right. As to the second,
it takes a full cycle between when you set tmemloc or memloc and when you can read the value back from tmemval or memval.
-
Well I could scream ^^, you think: lets just programm a basic ability and leave the rest up to evolution, but you end up with a smoking head trying to figure out how to make this ability work out.
-
I would use the in/out pair to commincate coordinates.
-
If the head has to face the eye(head and eye = parts of the multibot) to read this information, there is no purpose in making this a multibot
well in1 and out1 are for extern information exchange in3 and out3 for intern(head and eye) information exchange.
(probably I should use the racial memory)
-
Maybe you can use a combination of info shots and tmemloc/tmemval
-
How large can the numbers be stored in memory location?
Because if I use modulo I can store two numbers into 1.
And how far can a bot see?
Because I can change the satpos(position of the information access) into satdistances and store this information into the last two digits of body and shell(which can be read by trefbody and trefshell)
-
The default seeing distance is 1440, or roughly 12 robot lengths.
The robot DNA uses 16 bit integers, which means a range of [-32000, 32000]
-
Hmm seems like I have to rethink satcoordinates, best is I try out normal movement then I probably do not need these.
Well another question concerning conditions:
Will .in1 be zero or the last value stored into it, when the robot has nothing in sight.
(oh and thx that you help me so much )
-
I believe, but am not 100% certain, that it will be the last value stored in it.
-
Although function and swarming are 0 out1 does not become the same value as out3
'
target choosing
'head uses his x coordinate
cond
*.function 0 =
*.swarming 0 =
start
*.out3 .out1 store
stop
Maybe out3 is deleted every turn and is only refilled after the whole code is read?
-
Hmm...
Try using a constant instead of *.out3 to make sure it's not another problem.
That looks like it should work.
-
Tried to use *66 and 66 instead of *.out3 .out3 but no improvement.
(if you want to see the complete code just go into my communication network post I attached it as file(although thats probably a little long to read XD))
-
No improvement meaning that *66 and 66 didn't work?
That would mean it's an issue with your DNA flow coding. If it did make it better, that means it's an issue with the program.
-
just a quick tip here.
When you want to comunicate between bots that are joined by ties, simply use one bot to write directly to a memory location in the other. This is always done right at the start of the program loop so it will be acted upon immediately by the other bot if it is monitoring a specific internal memloc for instructions from the head.
Don't waste time and effort with tmemloc and tmemval. Just "poke' the value directly into the memory.
-
hm you mean using tieloc and tieval? However in this case th bot needs to monitor the value to decide if he wants to copy it. So instead of using a new memory location as clipboard does it not make more sense using tmemloc and tmemval who are supposed to work that way naturally?
(bye the way this has nothing to do with the failure I had, as the bot should have read his own .out3 value not the one from his tied partner)
ok this was really strange, the complete bot copies refxpos correctly into out3 however fails to copy the value from out3 into out1, so I made a test bot only with the 3 resbonsible genes (even deleted some conditions)
cond
.eye5 8 =
start
.eye5
stop
cond
*.refeye *.myeye =
start
*.in1 .out3 store
stop
cond
*.refeye *.myeye !=
start
*.refxpos .out3 store
stop
cond
start
*.out3 .out1 store
stop
end
However the only result was that this testbot could not even see something in in1 or .refxpos in fact when I clicked on his field of vision it was always empty even when there where bots in it.
Note: I found out this problem only occurs when there is a lack of conditions like
*.eye5 40 >. After I corrected that the genes worked fine (strangely why does it not work in the big bot?).
I could correct the failure , its seems I stored they y coord also into out1(well they y coordinates storing and reading is still alittle buggy)