Darwinbots Forum

Bots and Simulations => DNA - General => Topic started by: Endy on December 21, 2006, 12:27:45 AM

Title: Question on Ties
Post 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?
Title: Question on Ties
Post by: Numsgil on December 21, 2006, 01:00:41 AM
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).
Title: Question on Ties
Post by: Jez on December 21, 2006, 11:23:06 AM
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.  
Title: Question on Ties
Post by: EricL on December 21, 2006, 12:37:31 PM
A quick look through the code shows that Nums is correct.  It acts upon all the ties with the same number.
Title: Question on Ties
Post by: Jez on December 21, 2006, 03:36:17 PM
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?
Title: Question on Ties
Post by: EricL on December 21, 2006, 05:07:52 PM
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.
Title: Question on Ties
Post by: Jez on December 21, 2006, 05:29:25 PM
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.
Title: Question on Ties
Post by: EricL on December 21, 2006, 05:35:45 PM
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.