DarwinBotsManual
Open the app EspañolES

.tielen

The length of the .tiepres tie, measured edge to edge between the two bots.

Facts

Address
451
Name
.tielen
Kind
Sense: the engine writes it for the DNA to read
Group
Ties
Written by
The engine, in the actions phase: the edge-to-edge length of the .tiepres tie, or 0 if there is none. You read it in the next cycle.
Cleared
The engine recalculates it every cycle; writing to it changes nothing.
Range
from about −240 (overlapping bots) up to 32000
Mutations
picked as a read (*)

It is the distance between the bot and its partner minus the two radii: close to 0 when they touch, and it can be slightly negative if they overlap. The engine publishes it at the end of every cycle, so you read it one cycle late. It is 0 if there is no tie.

Like .tieang, it always measures the .tiepres tie, even if you write another one in .tienum; and the parent, which sees the birth tie with tie port 0, reads 0 until it has another tie.

It is useful for controlling the shape of an organism or for knowing whether you are being dragged: a tie that breaks is one that went past 1000 edge to edge.

' if the partner ended up far away, go toward it
cond
*.tielen 200 >
start
*.tieang .aimdx store
10 .up store
stop

To set the length there is .fixlen, and to measure the first four ties of a multicellular bot, .tielen1….tielen4.