NetLogo:使用工具 -> 暂停后创建的设置补丁?
NetLogo: setup-patches created after Tools -> Halt is used?
我是我的模型,我有几个版本的世界应该是什么样子。我将其实现为 "chooser" 包括选择:
"single_tree"
"clustered"。我的世界是501*501个补丁
当我 运行 setup
我的两个变体时,直到我按工具 -> "Halt" 才创建它们。
我真的不明白为什么,因为在我的工作模型上这很好用。此外,当我 运行 这个 "world variations" 带有基本参数时 - 只是 [set pcolor ...].
请问我的模型有什么问题或者我做错了什么?
这是工作示例 - 工作正常:
to setup-patches ; define patchy landscape
ask patches [
; Single tree
; -------------------------
if world = "single_tree" [
set pcolor green
]
; Clustered trees
; -------------------------
if world = "clustered" [
set pcolor red
]
end
这里的代码有点复杂,但我看不出有什么理由要花这么长时间来显示..
to setup-patches ; define patchy landscape
ask patches [
; Single tree
; -------------------------
if world = "single_tree" [
ask patches with [pxcor mod 50 = 0 and pycor mod 50 = 0] [
set pcolor red
]
]
; Clustered trees
; -------------------------
if world = "clustered" [
ask patch 0 0 [
ask patches in-radius (2.99 * Grid) with [pxcor mod Grid = 0 and pycor mod Grid = 0] [
set pcolor red
]
]
; ; determine cluster size
ask patches with [pcolor = red] [
ask patches in-radius radius [
set pcolor yellow
]
]
]
end
非常感谢任何建议,非常感谢!
我的问题是我用了太多次“ask patches
”到“ask patches
”来做某事...
固定代码在这里 - ask patches
每个 if
语句只有一次:
to setup-patches
if world = "single_tree" [
ask patches with [pxcor mod 50 = 0 and pycor mod 50 = 0] [
set pcolor red
]
]
if world = "clustered" [
ask patch 0 0 [ ask patches in-radius (2.99 * Grid) with [pxcor mod Grid = 0 and pycor mod Grid = 0] [
set pcolor red
]
]
ask patches with [pcolor = red] [
ask patches in-radius 5 [
set pcolor yellow
]
]
]
end
我是我的模型,我有几个版本的世界应该是什么样子。我将其实现为 "chooser" 包括选择: "single_tree" "clustered"。我的世界是501*501个补丁
当我 运行 setup
我的两个变体时,直到我按工具 -> "Halt" 才创建它们。
我真的不明白为什么,因为在我的工作模型上这很好用。此外,当我 运行 这个 "world variations" 带有基本参数时 - 只是 [set pcolor ...].
请问我的模型有什么问题或者我做错了什么?
这是工作示例 - 工作正常:
to setup-patches ; define patchy landscape
ask patches [
; Single tree
; -------------------------
if world = "single_tree" [
set pcolor green
]
; Clustered trees
; -------------------------
if world = "clustered" [
set pcolor red
]
end
这里的代码有点复杂,但我看不出有什么理由要花这么长时间来显示..
to setup-patches ; define patchy landscape
ask patches [
; Single tree
; -------------------------
if world = "single_tree" [
ask patches with [pxcor mod 50 = 0 and pycor mod 50 = 0] [
set pcolor red
]
]
; Clustered trees
; -------------------------
if world = "clustered" [
ask patch 0 0 [
ask patches in-radius (2.99 * Grid) with [pxcor mod Grid = 0 and pycor mod Grid = 0] [
set pcolor red
]
]
; ; determine cluster size
ask patches with [pcolor = red] [
ask patches in-radius radius [
set pcolor yellow
]
]
]
end
非常感谢任何建议,非常感谢!
我的问题是我用了太多次“ask patches
”到“ask patches
”来做某事...
固定代码在这里 - ask patches
每个 if
语句只有一次:
to setup-patches
if world = "single_tree" [
ask patches with [pxcor mod 50 = 0 and pycor mod 50 = 0] [
set pcolor red
]
]
if world = "clustered" [
ask patch 0 0 [ ask patches in-radius (2.99 * Grid) with [pxcor mod Grid = 0 and pycor mod Grid = 0] [
set pcolor red
]
]
ask patches with [pcolor = red] [
ask patches in-radius 5 [
set pcolor yellow
]
]
]
end