List 如何将列表1转换为单个海龟

List 如何将列表1转换为单个海龟,list,netlogo,agentset,List,Netlogo,Agentset,我有一个列表,其中始终只包含一只海龟。它是一个仅限补丁的变量,因此当检查任何补丁时,它看起来像是最佳海龟:[(海龟1)]。 我在另一个例程中使用以下代码引用了这只特殊的海龟: ask patches [ set closest-turtle best-turtle set pcolor scale-color ([color] of closest-turtle + 2) share 0 10 ] 我得到以下错误: OF expected input to be a turtle agents

我有一个列表,其中始终只包含一只海龟。它是一个仅限补丁的变量,因此当检查任何补丁时,它看起来像是
最佳海龟:[(海龟1)]。

我在另一个例程中使用以下代码引用了这只特殊的海龟:

ask patches [
set closest-turtle best-turtle
set pcolor scale-color ([color] of closest-turtle + 2) share 0 10
]
我得到以下错误:

OF expected input to be a turtle agentset or link agentset or turtle or link but got the list [(party 0)] instead.
error while patch 4 -2 running OF
  called by procedure UPDATE-SUPPORT
  called by procedure SETUP
  called by Button 'Setup'

这是因为最近的海龟变量是一个列表而不是海龟。那么,有没有一种方法可以将列表中的1转换为海龟或其他方法来解决此问题。

如果您确实确定列表中始终有一只海龟,您可以使用或提取它:

或:

set closest-turtle first best-turtle
set closest-turtle item 0 best-turtle