netlogo - NetLogo:使用 SDM 中“库存”的值作为 ABM 的输入
问题描述
我做了两个简单的模型;NetLogo 中的一个系统动力学模型和一个基于代理的模型。SDM 有一个存量“游客”,其价值取决于流入和流出。每次报价都会重新计算该值。游客们在 ABM 的每一刻都在萌芽。现在,我想使用 TouristStock 的值作为基于代理的模型中每个滴答声都发芽的海龟的输入。做这个的最好方式是什么?我已经检查了模型库中的示例代码(如 Tabonuco Yagromo 模型),但这对我来说没有任何意义。将这些模型相互集成的最佳方式是什么?提前致谢!
ABM的相关代码如下:
to go
clear-turtles
;sprouts turtles only on patches with value beach AND patches that are close to the lagoon (calculated in ArcMap)
;the initial number of tourists is multiplied by the percentage of tourists that were satisfied in the previous tick.
;percentage of tourists that were not satisfied is subtracted from 100 and divided by 100 to make it a factor between 0-1.
ask n-of (initial-number-tourists * ((100 - percent-dissatisfied) / 100)) (patches with [ beach_close_to_lagoon = 1])
[
sprout 1 [
set color black
set size 10
]
]
ask turtles [
set neighbor min-one-of other turtles [distance myself] ;; choose my nearest tourist based on distance
set distance-tourist distance neighbor ; measure/calculate distance of closest neighboring tourist
]
ask turtles
[ ifelse distance-tourist > 5
[ set satisfied? True]
[ set satisfied? False ] ]
update-turtles ;before the end of each tick, the satisfaction of each turtle is updated
update-globals ;before the end of each tick, the percentage of satisfied tourists is updated in globals
;clear-turtles ;because each tick represents one day, the tourists will leave the beach after one tick so the turtles will die
tick
end
解决方案
推荐阅读
- c# - 使用匿名对象列表查询数组
- javascript - Javascript中的字符转义
- python - 使用 - < Dockerfile 构建 docker 映像时 COPY 指令出现问题
- .net - 在 Docker 中编译 .net 5 项目时不遵守复制目标
- python - 使用python从txt文件中提取行
- javascript - Vue3 vuex "TypeError: vuex__WEBPACK_IMPORTED_MODULE_1__.Store.commit is not a function"
- sql-server-2012 - SQL Server - 插入表太慢
- node.js - ZMQ sockets do not work as expected on Kubernetes
- regex - 正则表达式模式替换包含特殊字符的字符串
- timer - 如何在没有背景颜色的情况下通过进度条 GUI 制作 Autohotkey 单击