如何在netlogo中绘制排序数组?
我已经按照一个名为point的属性的值对所有海龟进行了排序。 现在我想要一个点对海龟数的图。我该怎么做如何在netlogo中绘制排序数组?,netlogo,Netlogo,我已经按照一个名为point的属性的值对所有海龟进行了排序。 现在我想要一个点对海龟数的图。我该怎么做 turtles-own [ point ] to setup ca crt 100 reset-ticks end to go repeat 100[ ask turtles[ if random 10 = 1[ set point point + 1 ] ] ];;sorting let array sort-on [point] turtles
turtles-own [ point ]
to setup
ca
crt 100
reset-ticks
end
to go
repeat 100[
ask turtles[
if random 10 = 1[
set point point + 1
]
]
];;sorting
let array sort-on [point] turtles
tick
end
“海龟号”,我想你指的是列表中的位置。然后用plotByOrder
替换let array sort on[point]turtles
,其中
to plotByOrder
clear-plot
let pts sort [point] of turtles
foreach pts [[pt] -> plot pt]
end
当然,您需要在界面中创建一个绘图,这假定它是当前绘图。通过“海龟编号”,我假定您指的是列表中的位置。然后用plotByOrder
替换let array sort on[point]turtles
,其中
to plotByOrder
clear-plot
let pts sort [point] of turtles
foreach pts [[pt] -> plot pt]
end
当然,您需要在界面中创建一个绘图,这假定它是当前绘图