Netlogo:在补丁迭代中迭代一组海龟

Netlogo:在补丁迭代中迭代一组海龟,netlogo,Netlogo,我试着给每个斑块分配一个特定的值,这是基于它与某一组海龟的接近程度。这些值将存储在一个表中。有没有办法在补丁迭代中迭代海龟?这是我代码的一部分: ask patches [ let this_xcor pxcor let this_ycor pycor if pcolor != obstacle-color [ ask turtles with [patch-ahead Movement_Speed = obstacle-color][

我试着给每个斑块分配一个特定的值,这是基于它与某一组海龟的接近程度。这些值将存储在一个表中。有没有办法在补丁迭代中迭代海龟?这是我代码的一部分:

ask patches [
    let this_xcor pxcor
    let this_ycor pycor
    if pcolor != obstacle-color [
        ask turtles with [patch-ahead Movement_Speed = obstacle-color][ 
            set patchdist sqrt(((xcor - this_xcor)*(xcor - this_xcor) + (ycor - this_ycor)*(ycor - this_ycor))) 

那代码有什么问题?它失败了吗?它在哪里失败?给我们更多的细节,我们可以帮助你!