Time NetLogo中的离散事件调度:每日和每月任务
这个问题与一个有点关联 使用NetLogo 5.1.0和Windows 8.1上的NetLogo时间扩展,我希望我的模拟Time NetLogo中的离散事件调度:每日和每月任务,time,netlogo,Time,Netlogo,这个问题与一个有点关联 使用NetLogo 5.1.0和Windows 8.1上的NetLogo时间扩展,我希望我的模拟 将一天表示为一个netlogo勾号 做一些日常工作 在每个月的第一天做一些月度任务 (做一些年度和十年任务,但这与这个问题无关) 根据报告,这应该是可能的: 因此,如果使用time:plus原语将日期“2012-02-02”加上1个月,则会得到“2012-03-02”;如果再加上一个月,则会得到“2012-04-02”,即使2月和3月的天数不同 但是,在下面的最小工作示例
- 将一天表示为一个netlogo勾号
- 做一些日常工作
- 在每个月的第一天做一些月度任务
- (做一些年度和十年任务,但这与这个问题无关)李>
print
命令的输出是2011年1月2日
,2011年2月2日
,2011年3月5日
和2011年4月5日
那么,我如何在每个月的某一天安排一项任务呢
奖金问题:我如何将任务安排在每月的第一个月(而不是第二个月)
以下是工作示例:
extensions [time]
globals[
start-time
current-time
]
to setup
clear-all
reset-ticks
set start-time time:create "2011-01-01"
set current-time time:anchor-to-ticks start-time 1.0 "days"
time:anchor-schedule start-time 1.0 "days"
;time:schedule-repeating-event-with-period "observer" task do-daily 1 1.0 "days"
time:schedule-repeating-event-with-period "observer" task do-monthly 1 1 "months"
go-until
end
to do-daily
; here are the daily tasks
end
to do-monthly
; here are the monthly tasks
print time:show current-time "yyyy MMMM d"
end
to go-until
time:go-until 100
end
这是一个现已修复的错误。见:
也许可以在“谢谢”网站上报告!我刚刚测试了新版本,现在重新安排的工作按预期进行。