Darwinbots Forum
Code center => Suggestions => Topic started by: Botsareus on June 10, 2005, 04:36:48 PM
-
cond
*.20 0 >
start
*.20 .up store
stop
Translation:
Lets say memory location 20 is equal to 310.
Thats means if the robot is not dead (.nrg > 0) it will move *.nrg .up store
I need this to make an effective "nerual network" bot.
-
It's an interesting idea. I have a * operator that I've been working on that returns the value of the memory location pointed to by the top value on the stack.
So you could do *20 * to get the memory location *20 is pointing to.
-
Here is how this bot is supposed to work
The robot counts one memory location up every cycle we call this memory location "n"
The robot waits until it reproduces or until it kills another robot or until its energy is below 300..........
Basicaly we have a dna inside dna , after the robot reproduces or kills another robot it checks if it did better on time and energy then lest time. If it did then the sub-dna is saved as the "defult sub-dna", otherwise a new more mutated virsion of the "active sub-dna" is created out of the defult sub-dna.
Here is the model of sub dna (all this memory is used up twice , once for defult sub-dna , once for active sub-dna)
(there are special genes that copy defult sub-dna into active sub dna and wise versa)
a(20) 'instruction number
b(20) 'instruction type
all conditions are ">"
c 'is condition top part a number or a sysvar
d(20) 'condition top part value
e 'is condition buttom part a number or a sysvar
f(20) 'condition buttom part value
then we go
cond
*.20
*.40
>
start
*60 *80 store
stop
cond
*.21
*.41
>
start
*61 *81 store
stop
somthing like that...
-
EERRRMMMM???
*.20 won't work since the dot is only used to prefix a sysvar name.
*20 will return the value stored in memory location 20. It always has done.
so *60 *80 store will store the value in memory location 60 into the memory location pointed at by the value currently stored in memory position 80
If mem(60) contains 25 and mem(80) contains 1 then this will store 25 into position 1 (.up)
Unless I am reading the post wrong there is nothing difficult about any of this.
-
Problem:
*.20 won't work
I need it to work.
I also revise my post above for lack of accurasy in design , brb.
-
It's an interesting idea. I have a * operator that I've been working on that returns the value of the memory location pointed to by the top value on the stack.
So you could do *20 * to get the memory location *20 is pointing to.
And didn't I just say this?
-
I gess I have to this evey time:
cond
start
*20 * *12 store
*30 * *13 store
stop
cond
*12
*13
>
start
*60 *80 store
stop
genes are checked in order correct?
-
I wish you'd use custom labels. All these *numbers makes my head hurt.
Genes are executed linearly at the moment, yes. In the future, it'll change so that the genes won't be able to tell who executed first or last except by passing values along in the stack.
-
PY I think he wants *.20 to read the value of an address that is stored in *20, so if *20 has 30 stored in it, *.20 would read the value in address 30.
Hopefully Ive got the right end of tthe stick
-
In that case **20 would make more sense since the dot is only used as a prefix for a text name so that the parser can associate the actual number with it.
-
And, as I said, I added a command in the latest version called "*", that reads the value of the memory location on top of the stack.
So 20 * does the same thing as *20.
So problem solved :lol:
-
when you say the latest version you mean 2.37.2 or so new its yet to be released?
-
Yet to be released.
-
that still wouldn't give the value stored in the memory location pointed at by the value stored in the memory location pointed at by the value on top of the stack though..... would it? :wacko:
-
Well, you could do it multiple times since it's a command.
*20 * * gives the value pointed at by the value pointed at by *20.
-
Num, how is this:
cond
start
*20 * *12 store
*30 * *13 store
stop
cond
*12
*13
>
start
*60 *80 store
stop
supposed to work, when you make the gene execution non-liner ?
-
Exactly like before, except the store statement doesn't take effect immediatly. So that second gene'll take an extra cycle to execute.
It'll go entire DNA executed, apply stores, incs, and decs, update bots.
-
well this robot is a crazy idea anyway , will see , maybe I will find enough memory locations to make it work in the new system.
(I was planning to use the *12 and the *13 once for each virtual gene)
That thing I quoted is 1 virtual gene out of 20... Gess I will just how to use 40 more memory locations.
we got about 800 free memory locations.
'backbuffer sub dna
(20) top part of condition
(20) buttom part of condition
(20) top part of condition type (number or sysvar)
(20) buttom part of condition type (number or sysvar)
(20) sysvar input value for instruction
(20) actual sysvar for instruction
'active sub dna
(20) top part of condition
(20) buttom part of condition
(20) top part of condition type (number or sysvar)
(20) buttom part of condition type (number or sysvar)
(20) sysvar input value for instruction
(20) actual sysvar for instruction
'
(20) actual value returning of top part of condition
(20) actual value returning of buttom part of condition
800 - 280, nice, I still have 520 memory locations to use for other stuff
-
That's alot of memory locations, tell me how it goes.
-
http://s9.invisionfree.com/DarwinBots_Foru...ndpost&p=709853 (http://s9.invisionfree.com/DarwinBots_Forum/index.php?showtopic=561&view=findpost&p=709853)
Basicaly the robot will generate random conditions and instructions until it finds the best 20 for a givin situation