Bots and Simulations > DNA - General
my tryouts. Help plz
Welwordion:
ok I tried to design a search gene but for some reason it does not work were is the mistake?
cond
*.eye4 *.eye5 > or
*.eye3 *.eye5 > or
*.eye2 *.eye5 > or
*.eye1 *.eye5 > or
*.eye6 *.eye5 > or
*.eye7 *.eye5 > or
*.eye8 *.eye5 > or
*.eye9 *.eye5 >
start
*.eye1 3 mult *.eye2 4 mult add *.eye3 5 mult add *.eye4 6 mult add 10 div
*.eye9 -3 mult *.eye8 -4 mult add *.eye7 -5 mult add *.eye6 -6 mult add 10 div
add .aimsx store
stop
end
so what it should do, if any target is nearer then the target in front it should
rotate based on the attractivity of the side. I weighted the values to calculate attractivity.
Well in any case the rotation is to weak , but the real problem is it only rotates correctly clockwise never anticlockwise.
Ulciscor:
I'm not certain but won't the first weighting calculation result get overwritten by the second?
I have split this one gene into two seperate genes and it works fine. There might be another way to keep it as one gene though; let some of the professionals have a look!
Numsgil:
Turning genes always give me a headache. Ugh. There's a reason my bots all turn like a station wagon...
Anyway, just thought I'd post and say I looked it over. I have nothing more to add than what Ulc has already said.
Welwordion:
how you seperated that? its one calculation I put in 3 lines
weight left
weight right(negative)
sum both together and store value
????? :huh:
bye the way if you write .aimsx 30 inc will the value in .aimsx be increased by thirty
(remember seeing something like that in purples tutorial but I am not sure.)
Ulciscor:
--- Code: ---cond
*.eye4 *.eye5 > or
*.eye3 *.eye5 > or
*.eye2 *.eye5 > or
*.eye1 *.eye5 >
start
*.eye1 3 mult *.eye2 4 mult add *.eye3 5 mult add *.eye4 6 mult add 10 div
.aimsx store
stop
cond
*.eye6 *.eye5 > or
*.eye7 *.eye5 > or
*.eye8 *.eye5 > or
*.eye9 *.eye5 >
start
*.eye9 3 mult *.eye8 4 mult add *.eye7 5 mult add *.eye6 6 mult add 10 div
.aimdx store
stop
--- End code ---
Worked alright-ish for me anyway!
Navigation
[0] Message Index
[#] Next page
Go to full version