我正在使用NetLogo中的时间扩展来加载一些每日温度数据。我的模型中的海龟有一些与温度数据相关的程序。我可以将时间方面设置如下:
set time-series time:ts-load "environmentTimeseries.txt"
set start-time time:create "2018/01/01"
set current-time time:anchor-to-ticks start-time 1.0 "day"
time:anchor-schedule start-time 1.0 "day"海龟可以与这些温度数据进行交互:
set current-temp time:ts-get time-series current-time "temp"
ask turtles [
set my-temp random-normal current-temp 1 ; my-temp is a turtles-own variable
]我现在想做的是让海龟只在一年中的某些月份做这个手术。有点像,if month > 5 & < 7 [do procedure]。不幸的是,时间扩展中的调度程序不断破坏我的模型,所以我不确定这是一个选项。
希望你能帮上忙
发布于 2018-08-29 08:33:10
我在时间文件里找到了我想要的东西。我可以创建一个名为turtles-own的my-month变量,然后应用下面的代码行,使代理能够监视当前月份:
set my-month time:get "month" current-timehttps://stackoverflow.com/questions/52061991
复制相似问题