Darwinbots Forum
Bots and Simulations => DNA - General => Topic started by: Endy on December 21, 2006, 12:27:45 AM
-
Proving there's always more to learn...
Which tie exactly is acted upon, if all the ties have the same tie number? Assuming readtie/tienum match the tiepres number, does it go based on the last bot your bot tied to?
-
I believe it's supposed to act on all of them. If it doesn't, it probably acts on the first one with that designation (though this might not be true if you start forming and deleting ties).
-
I thought it just acted on the last tie given the number. Would be nice if it worked on all of them or we could use more than one tie per turn though.
PY kindly explained it to me before, IIRC it will address each of them in turn but only uses the last one because you can only use one tie per turn. Sort of like using two shoots or something, the program goes through the stages of using both but only the last shoot fires.
If I don't remember correctly then that's wrong.
-
A quick look through the code shows that Nums is correct. It acts upon all the ties with the same number.
-
You mean you can use more than one tie in a turn or that it acts upon all the ties with the same number but only does something with one of them? In which case is it the first or last tie created with that number?
-
It means tie operations such as .fixlen, .fixang, .deltie or sharing operate on all ties that have the same tie number as that placed in .tienum. All the ties with that number will get lengthened or deleted or whatever all in that cycle.
-
Ooh cool,
There is some advantage to be had from giving the ties the same number then, what about things like .sharenrg or feeding through ties?
I really didn't think you could do anything with more than one tie per cycle.
-
I haven't looked exhaustivly or tested it, but it does appear that all tie operations use a while loop that interates through all ties and does what it does for all ties with the right number including sharing and feeding.