netlogo:你知道如何获取ID最大的乌龟的X轴信息吗?

netlogo: Do you know how to take the X axis information where there is a turtle with the biggest ID?

我想在某些特定条件下获取具有最大 ID 的海龟的 X 轴信息。我想统计X轴信息右侧的海龟数量。以下是示例程序。我想画一个代码来获取X轴信息,在这个示例程序中,在"here?"点有一个ID最大的乌龟。感谢您的建议。 (这个link是3D图https://i.stack.imgur.com/DQf93.png)

count turtles with [xcor >  "here?"  ]

你的问题有很多歧义,但你应该可以更改以下内容以满足你的需要。

turtles-own [ID] ;if unique, you can just use `who`

to setup  ;make some turtles with various xcors and IDs
  ca
  crt 100 [
    setxy random-xcor random-ycor
    set ID random 1000
  ]
end

to-report top ;get a turtle with biggest id
  report max-one-of turtles [ID]
end

to-report winners ;get turtles to right of top
  let topx [xcor] of top
  report turtles with [xcor > topx]
end

to test
  setup
  print count winners
end