0
我有一個列表,其中始終只包含1只烏龜。它是一個膜片僅變量,因此,當任何補丁被檢查看來像best-turtle: [(turtle 1)].
如何將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的列表轉換爲烏龜或其他方式來解決這個問題。