我有一个列表,其中只包含1只乌龟。它是一个仅补丁变量,因此当检查任何补丁时,它看起来像best-turtle: [(turtle 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的列表转换为乌龟或其他一些方法来解决这个问题。