在Netlogo中绘制X轴的时间

发布于 2025-02-09 23:39:50 字数 386 浏览 3 评论 0原文

我正在使用Netlogo的时间延长,每个刻度为一分钟。我已经使用设置当前时间设置此设置:锚到键的开始时间1.0 tick-“ minute”

该模型的运行正常。我能够根据日期/月/月进行时间步长操作,等等。

我无法绘制当前时间变量。我希望它在情节的X轴上。如果我尝试设置这样的范围set-plot-x范围的启动末期末日在绘图设置部分中,我会收到这样的错误:

Runtime Error: SET-PLOT-X-RANGE expected input to be number but got the org.nlogo.extensions.time.data.types.LogoTime

这是什么选择?

I am using the Time extension in NetLogo where each tick is a minute. I have set this up using set current-time time:anchor-to-ticks start-time 1.0 tick-"minute".

The running of the model works fine. I am able to perform my time step actions based on the date/day/month, etc.

I am unable to plot the current-time variable though. I would want it to be on the x-axis of the plot. If I try setting a range like this set-plot-x-range start-time end-time in the plot setup section, I get an error like this:

Runtime Error: SET-PLOT-X-RANGE expected input to be number but got the org.nlogo.extensions.time.data.types.LogoTime

What's the alternative to this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

星軌x 2025-02-16 23:39:50

对不起,我认为没有办法在Netlogo的情节上绘制格式化的时间。这些图只能在其轴上使用数字,而您的时间值是不同类型的变量,徽标,它更像是一个对象而不是数字。

取而代之的是,您只需在X轴上使用刻度,然后将轴标记为在几分钟内将轴标记为模拟时间。

您还可以将结果写入输出文件,包括格式为字符串的当前时间的值,例如,使用:

 file-type (time:show current-time "yyyy-MM-dd HH:mm") 
 ...

然后使用文件输出以及其他处理日期和时间的其他软件绘制图。

我很高兴看到人们使用时间延长!

I'm sorry but I don't think there is a way to plot a formatted time on NetLogo's plots. The plots can only use numbers on their axes, and your time values are a different type of variable, a Logotime, which is more like an object than a number.

Instead, you can simply use TICKS on the X axis and label the axis as simulated time in minutes.

You can also write your results to an output file, including the value of current-time formatted as a character string, e.g., using:

 file-type (time:show current-time "yyyy-MM-dd HH:mm") 
 ...

and then draw plots using the file output and some other software that handles dates and times.

I'm glad to see people using the Time extension!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文