Darwinbots Forum
Bots and Simulations => DNA - General => Topic started by: Zelos on April 29, 2005, 08:53:44 AM
-
I have 4 conditions ina gene, lets call them for 1,2,3 and 4.
I want 2,3 and 4 to be true if the gene geos on. but I also want it to eb or for 1 so its either 234 or 1 that is true, how do I do?
shall it be like:
cond
2
3 and
4 and
1 or
start
? or how shall it be?
-
I think that is right ;)
-
Num would be the one to ask since he programmed that section but I think the correct way is to put the "or" bofre the "or'd" condition.
cond
2 and
3 and
4 or
1
start
I also don't think you even need to specify the "and" since it is assumed to be the default anyway.
cond
2
3
4 or
1
should work just as well
Please correct me if I'm wrong Num. I have never actually tried using these yet.
-
im afrain then the program will think 23 or any of 1/4, so it would be either 123 or 234
-
You have to think of it in terms of the stack.
2
3
4 or
1
will not do what you want. 3 and 4 will be ored together, then 2, 3 or 4, and 1 will be anded together.
The way you have it looks right, is it giving you problems Zelos?
-
So it works the same way as regular stack entries followed by an operator.
The previous two conditions are "ored" and all others are anded.
Thanks for clearing that up Num. I wasn't sure if you had extended the reverse Polish notation to the condition stack in that way.
-
I Should make it possible for robots to evolve logic stuff , since now that I know how it works.
-
I Should make it possible for robots to evolve logic stuff , since now that I know how it works.
Now there is something that is completely missing from the code.
Right now there is no way for any robot to evolve an "and", "or" or any other logic.
They can be lost (I think) but never added. Delete random value should be able to remove them but even then I am not quite sure since the logical operators use a different "DNA(n).tipo" code than any other kind of value does. It is possible that even this function will utterly ignore them.