我想制作人工景观,包括丘陵,山坡和山谷。到现在为止还好。现在,我想在谷底放置一条河流。我认为最简单的方法是让乌龟在这里下降时按海拔向上/向下移动:http://modelingcommons.org/browse/one_model/2352#model_tabs_browse_info
然而,由于我的景观不是真实的,我的山谷也不是直线,而只是地形中的“凹陷”,因此我的河流定位真的很奇怪吗?
请问,有没有办法在不使用GIS扩展的情况下,在netlogo中创建反映真实地形的丘陵和山谷?我已经找到了很好的侵蚀模型,分水岭和GIS梯度示例,但是我如何才能最初将我的乌龟放在只停留在山谷中?
编辑
GIS梯度示例提供了出色的解决所有单元在空间中移动的问题,并且它们聚集在山谷中。然而,当我想通过我的乌龟的运动来“创造”河床的谷底时,我如何放置它呢?也许从最低点开始,在几个滴答声后停下来,这样就不允许登上山顶了?谢谢!

globals [
low
high
range ]
patches-own [
altitude ]
to setup
clear-all
setup-hills
scale-patches
color-patches
end
to setup-hills
ask n-of 2 patches [
set pcolor magenta ]
ask patches [
let max_dist sqrt (world-width ^ world-width + world-height ^ world-height)
set altitude world-width - distance patch 10 10
set altitude world-width - distance min-one-of patches with [pcolor = magenta][distance myself]
]
crt 1 [ ; create a turtle, needed to identify the lowest slope
set color red
let bottom_valley min-one-of patches [altitude]
move-to bottom_valley
]
end
to scale-patches
set low [altitude] of min-one-of patches [altitude]
set high [altitude] of max-one-of patches [altitude]
set range high - low
ask patches [
set altitude altitude - low ; shift every patch down so lowest altitude is 0
set altitude altitude * 99.0 / range ; scale every patch so that the lowest is 0 and highest is 999
]
repeat 5 [
diffuse altitude 0.5 ]
end
to color-patches
ask patches [
set pcolor scale-color green altitude 0 100]
end
to create-river
ask turtles [
let p max-one-of neighbors in-radius 1 [altitude]
if [altitude] of p >= altitude [
face p
move-to p
set pcolor blue
]
]
end发布于 2016-05-20 06:01:05
你的总体想法是正确的。我建议在您的环境中查看"GIS梯度“模型。您可以在Code Examples/GIS下的Models库中找到它。然后考虑如何过滤随着时间推移通过的水粒子数量最少的补丁。
发布于 2016-07-19 04:52:36
基于地理信息系统梯度的景观水系识别--以http://modelingcommons.org/browse/one_model/2352#model_tabs_browse_info为例
复杂景观上水系识别的整个过程由3个子过程组成:
(create-source)
从河床系统中移除最高的“”
(remove-river-from-top-hill)
源的数量取决于可用的GIS数据类型。对于要从山顶移除的面片数量也是如此。
;; ----------------------------------------------
;; create river
;; ----------------------------------------------
to create-source
; identify the 5 highest points of the landscape
repeat 5 [
; avoid the highest points to be close to each other
ask max-one-of patches with [ not any? turtles-here and not any? turtles in-radius 20 ] [p_elev] [
;ask patches to sporout turtles
sprout 1 [
set size 1
set color orange
]
]
]
end
to go-downhill
; stop if there is no more turtles
if not any? turtles with [color = orange]
[ stop ]
; ask turtles located on top of thehills to move downhill
ask turtles with [color = orange] [
; die when you reach the edge of the world
if ([pxcor] of patch-here = max-pxcor) or ([pycor] of patch-here = max-pycor)
or ([pxcor] of patch-here = min-pxcor) or ([pycor] of patch-here = min-pycor) [
die ]
move-to patch-here ; go to patch center
set pcolor blue ; identify the use of patch
set p min-one-of neighbors with [pcolor != blue ] [p_elev] ;; or neighbors4 with [pcolor != blue]patches in-radius 3
if p != nobody [
; move downhill if elevation of patch you are standing on is higher then one of the neighboring patches
ifelse [p_elev] of p <= p_elev
[
face p
move-to p
set pcolor blue ; identify the use of patch
]
[
;move-to min-one-of patches with [pcolor != blue] [distance myself]
move-to min-one-of patches in-radius 2 with [pcolor != blue] [p_elev]
set pcolor blue ; identify the use of patch
]
]
]
end
to remove-river-from-top-hill
; remove 5% of the blue (river) patches placed on the top of the hill
let total_blue count patches with [pcolor = blue]
repeat total_blue * 0.05 [
ask max-one-of patches with [pcolor = blue] [p_elev] [
set pcolor yellow ]
]
end确定了复杂的河流系统:

(河床=蓝色,移除山顶=黄色):
https://stackoverflow.com/questions/37332038
复制相似问题