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

时间:2015-07-01 04:07:27

标签: netlogo

我正在尝试为每个补丁分配一个特定的值,这取决于它与某一组乌龟的距离。这些值将存储在表格中。有没有办法在补丁迭代中迭代海龟?这是我的代码的一部分:

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))) 

0 个答案:

没有答案