Bots and Simulations > Evolution and Internet Sharing Sims

Help with code-2

<< < (2/2)

shvarz:
Hmm, interesting...

And this makes me think that maybe we should modify the way conditions and genes work...  

Maybe we should not ignore logical operators in bodies of genes?  Seems a bit wasteful.  Why not let them place "true"s and "false"s on to the conditions stack?  In fact, this would allow to just drop the "cond" command all together.  Just write genomes like

2 1 >
start
.repro store


Also, I'm not sure how is it that a single condition can control multiple starts?  I thought the program took of the condition from the conditions stack every time it encountered start or else...

Numsgil:
When a cond statement is entirely finished, it's summed up into a single "cond" flag that alerts the program as to wether the next start or the next else statement should be executed.  This flag is only ever changed at the end of a cond statement.

shvarz:
Hmm, that's one way to do it.  I seem to remember discussions about a more mobile "conditions stack", where "true" and "false" statements would be placed by conditions and taken off by "start" and "else" commands.  And these statements could be operated by logical commands such as "and" and "or".  Am I hallucinating?    Or was that for the new version of DB?

I kind of assumed that this is how things work in DB now.  But I guess I was completely out of the loop.

I personally think that this way is much more flexible and powerful.  Seems like it would be a nice bonus for evolution, because it allows sloppiness in the code and evolution likes to be sloppy.  Am I missing something?

Numsgil:
The conditions stack works inside a condition.  For instance, the comparison statements place boolean values onto the conditions stack.  At the end of the condition block, those conditions are all added up (and'ed together).

I don't see another way to do this that allows for multiple conditions in a single cond block -and- mantains backwards compatibilty.

I'm willing to entertain other ideas for a future DNA specification that doesn't need to be backwards compatible.

Navigation

[0] Message Index

[*] Previous page

Go to full version