Netlogo:未定义任何名为edge的内容

Netlogo:未定义任何名为edge的内容,netlogo,Netlogo,我是netlogo(版本:6.1.1)的新手。我只是想创建一个围绕原点的补丁。但它提醒我,“没有定义任何名为edge的内容。” 到安装中心 清除所有 询问补丁[ 如果pxcor=((边/2))和pycor>=((边/2))和pycor=((边/2))和pxcor=((边/2))和pycor=((边/2))而pxcor问题在于NelLogo中没有定义edge。而是用min-pxcor、max-pxcor、min-pycor和max-pycor来描述世界的边缘。因此,您的过程(稍微简化)将是 到安装

我是netlogo(版本:6.1.1)的新手。我只是想创建一个围绕原点的补丁。但它提醒我,“没有定义任何名为edge的内容。”

到安装中心
清除所有
询问补丁[

如果pxcor=((边/2))和pycor>=((边/2))和pycor=((边/2))和pxcor=((边/2))和pycor=((边/2))而pxcor问题在于NelLogo中没有定义
edge
。而是用
min-pxcor
max-pxcor
min-pycor
max-pycor
来描述世界的边缘。因此,您的过程(稍微简化)将是

到安装中心
清除所有
让顶部为max pycor/2
让底部最小pycor/2
让左侧最小pxcor/2
让右侧最大pxcor/2
询问补丁[

如果pxcor=left side和pycor>=bottom和pycor=left side和pxcor=bottom和pycor=left side和pxcor,那么已经解决了。谢谢你的帮助,教授
to setup-center
  clear-all
  ask patches [
  if pxcor = (- (edge / 2)) and pycor >= (- (edge / 2)) and pycor <= (0 + (edge / 2))
  [set pcolor red]
  if pycor = (- (edge / 2)) and pxcor >= (- (edge / 2)) and pxcor <= (0 + (edge / 2))
  [set pcolor red]
  if pxcor = (edge / 2) and pycor >= (- (edge / 2)) and pycor <= (0 + (edge / 2))
  [set pcolor red]
  if pycor = (edge / 2) and pxcor >= (- (edge / 2)) and pxcor <= (0 + (edge / 2))
  [set pcolor red]
  ]
end
to setup-center
  clear-all
  let top max-pycor / 2
  let bottom min-pycor / 2
  let left-side min-pxcor / 2
  let right-side max-pxcor / 2
  ask patches [
    if pxcor = left-side and pycor >= bottom and pycor <= (0 + top)
    [set pcolor red]
    if pycor = bottom and pxcor >= left-side and pxcor <= (0 + right-side)
    [set pcolor red]
    if pxcor = right-side and pycor >= bottom and pycor <= (0 + top)
    [set pcolor red]
    if pycor = top and pxcor >= left-side and pxcor <= (0 + right-side)
    [set pcolor red]
  ]
end