Darwinbots Forum
Bots and Simulations => DNA - General => Topic started by: Botsareus on February 21, 2005, 04:01:05 PM
-
Dim memory(1000) as Intager 'this actualy already Exists in the program
Do '<--- this loop is the robot stack loop itself
memory(0) = 0
Do
memory(0) = memory(0) + 1
Debug.Print memory(0) 'there should be some kind of Debug in Db right
If memory(0) > 100 Then Exit Do
Loop
Loop
***The above is inpossible to program in DB for me , CAN ANYONE GIVE ME A WORKING DNA FOR THAT WITH A INFORMATION ON HOW TO DEBUG AS WELL?
-
There aren't any loops in the DNA. If we added them, infinite loops could potentially develop. Straightforward DNA execution helps add to program stability.
-
I know there is no loops, I am talking about each sycle increases the number by 1. So it takes 100 sycles to increase the number to 100
-
I'm not sure what it is you want then.
Unless you just want to have:
cond
*.var 100 <
start
.var inc
stop
And to debug, load up the console for a robot. It has all kinds of useful debugging tools. Type help to get a list of them.
-
There we go , lest time I tryed that it did not work , the robot console was returning 0 , also how do I later reset the number back to 0 when its over 100 so it repeats the whole thing again
by "*.var" what do you mean? There is only memory locations from 1 to 1000
if *.var did mean a memory location , I have never seen *.var 100 <
mutate naturaly in the program
forget about *.var *.var <
I am hopeing that num ment somthing like:
cond
*.32 100 <
start
*32 inc
stop
-
To reset it, have this before the below gene:
cond
*.var 100 >=
start
0 .var store
stop
Also, by *.var I mean a custom label. At the top of your DNA have this:
def var memorylocation. where var is the label name and memorylocation is a free memory location.
inc tends to work differently than a store command. Inc seems to work more immediatly, so make sure you don't do something like:
cond
*.var = 0
start
.var inc
stop
cond
*.var = 1
start
.var inc
stop
or it will execute both genes. Place them in reverse order and you're safe.
-
And *32 inc won't work like you want. It needs to be 32 inc to increment memory location 32. Unless you're using 32 as a pointer.
-
Num can bots mutate there own custom labels , or atleast reguler memory locations and memory pointers !!! yey !!!! , or else I start a new thread
ex:
*.32 100 <
or is it
.32 100 <
now I am confused
if *.32 100 <
really means a pointer from memory location 32, then I should have never started "errays other topic" thread, But now there is use for the "errays other topic" thread once more!!!!
:D sorry for the complete inconsistency
-
Bots can (I think) mutate to use new memory locations. I'm not sure how advanced the code is for it, to be honest. One of these days I'll go through the mutations code and rework it a bit.
-
Make sure mutation works for "condition" part of the gene , I know mutation really works well creating memory locations in the "execution" part of the gene
make sure its for bouth pointers and reguler memory...
...This conversation has moved to the (suggestions > "arrays other topic") thread
thanks for your help Num
-
can bots mutate there own custom labels , or just reguler D$$#amed memory locations
No. Bots cannot mutate their own custom labels.
The def command is not stored as part of the DNA code within the program. The bot only sees the memory location value and not the label.
It would be quite possible for a robot to evolve the use of a memory location as a custom variable but it would not have a name.
:D PY :D