Darwinbots Forum
Bots and Simulations => DNA - General => Topic started by: Jez on September 02, 2006, 06:59:22 AM
-
Had a problem when writing a 1G bot and think I know why but wanted to confirm.
Lengthy bit of And Or code needed to be put at start of series of instructions or it wouldn't work properly.
Occured to me that if the stack has a max length and it zero's anything over that then I might have run out of space for the calculation to be carried out properly.
Is that stack thing true? If so what's the max length?
-
Pretty sure it's twenty still. Now it'll drop numbers off the bottom whenever it over fills.
Example:
19) 664
20) 452
Number added to top:
19) 344
20) 452
Anyways it's not normally a problem, as you add SG conditions like *.robage sgn you can simply mult them together. Normally I try to keep all my conditions equaling 1 for true or zero for false just to keep things straight and the dna working properly.
Ie.
' repro when nrg > 3000 and eye5 < 45
50 .repro *.nrg 3000 sub sgn 0 floor mult 45 *.eye5 sub sgn 0 floor mult
store
-
The C++ version I'm working on eliminates the stack limit all together. So you can look forward to that