Darwinbots Forum

Bots and Simulations => DNA - General => Topic started by: Zelos on April 29, 2005, 08:53:44 AM

Title: and/or
Post 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:
Code: [Select]
cond
2
3 and
4 and
1 or
start
? or how shall it be?
Title: and/or
Post by: Light on April 29, 2005, 09:29:09 AM
I think that is right ;)
Title: and/or
Post by: PurpleYouko on April 29, 2005, 09:44:23 AM
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.

Code: [Select]
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.

Code: [Select]
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.
Title: and/or
Post by: Zelos on April 29, 2005, 11:31:46 AM
im afrain then the program will think 23 or any of 1/4, so it would be either 123 or 234
Title: and/or
Post by: Numsgil on April 29, 2005, 11:54:26 AM
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?
Title: and/or
Post by: PurpleYouko on April 29, 2005, 01:32:51 PM
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.
Title: and/or
Post by: Botsareus on April 29, 2005, 02:25:00 PM
I Should make it possible for robots to evolve logic stuff , since now that I know how it works.
Title: and/or
Post by: PurpleYouko on April 29, 2005, 02:41:09 PM
Quote
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.