I have a doubt and apologize if the answer is very obvious. I created the following code. Pretty simple & straightforward:
patches-own [ tl ls ls2 ls3 ls4 tsl]
turtles-own [mysize]
to setup
clear-all
reset-ticks
crt 5
ask turtles [ set heading random 360 jump random 20 set mysize random-float 1]
asd
inspect patch 0 0
end
to asd
let old sum [mysize] of turtles
ask patches [ set tl other turtles
set tsl [self] of tl
set ls [distance myself] of tl
set ls2 [distance myself ^ 2] of tl
set ls3 [(mysize) / old] of tl
]
;print tl
end
to initial
set heading random 360 jump random 20 set mysize 1
end
to go
inspect patch 0 0
ask turtles [ fd 1 set mysize mysize + random-float 1]
let qwe random-float 1
print qwe
if qwe < 0.2 and count turtles > 2 [ask one-of turtles [die]]
if qwe > 0.8 [ ask one-of patches [sprout 1 [initial]]]
asd
tick
end
As you can see, i have a inspect function in the code and below is the snapshot:
My question is why is the
ls
and ls2
agents out of order. Agentset TSL
shows the order of the turtles, so shouldn't the other agentsets created based on that follow the same order.