出口地块与netlogo [英] export plots with netlogo

查看:201
本文介绍了出口地块与netlogo的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图导出我的NetLogo模型的所有地块模拟运行后的csv格式与原始 export-all-plots
我至少还没有找到和外部读取器打开此csv文件的方式,以获得更清晰的图表。我尝试使用 gnuplot ,但它似乎无法打开使用NetLogo创建的csv格式:

I am trying to export all the plots of my NetLogo model after simulation runs in a csv format with the primitive export-all-plots. I haven't found yet the way to open this csv file with an external reader in order to get more clear plots. I tried with gnuplot but it looks like it's not able to open the csv format created with NetLogo:

export-plots data(NetLogo 5.0.5)

"export-plots data (NetLogo 5.0.5)"

^

C:\results\interface.csv,第1行:无效的命令

"C:\results\interface.csv", line 1: invalid command

如何使用外部阅读器打开csv图? p>

How can I open csv plots with an external reader?

推荐答案

Netlogo的图导出格式有两个复杂因素。首先,在开头有一个三行头(加上一个空行),只是提供有关模型的信息和何时生成数据。接下来,有关于模型设置,绘图状态(笔颜色等)的数据。最后,有数据本身,这本身有点复杂的事实,你可以有多个笔每个情节。所以我不惊讶gnuplot无法读取它。

There are two complicating factors about NetLogo's plot export format. First, there's a three line header at the beginning (plus an empty line after) that just gives information about the model and when the data was generated. Next, there's data about the model settings, the plot state (pen colors and such). Finally, there's the data itself, which itself is somewhat complicated by the fact that you can have multiple pens per plot. So I'm not surprised gnuplot couldn't read it as is.

这个表格在GUI电子表格应用程序中非常容易使用,如Excel,LibreOffice的Calc或Gnumeric 。您只需选择所需的数据并生成图表。

The table's are quite easy to use in GUI spreadsheet application, like Excel, LibreOffice's Calc, or Gnumeric. You can just select the data you want and generate the plots.

要在命令行执行此操作,恐怕您可能需要编写脚本来读取它这在Python或R之类的应该很容易。只需跳过元数据行,并使用CSV解析器读取其余的。

To do this at the command line, I'm afraid you might have to write a script to read it in. This should be pretty easy in something like Python or R. Just skip the metadata lines, and use a CSV parser to read in the rest.

您也可以尝试使用 BehaviorSpace 生成数据,但确保使用表输出。它让你一次从许多运行生成数据,并且格式有点更一致。顶部还有6行元数据,但您可以删除它。我相信这是更多的NetLogo的标准做法。

You might also try using BehaviorSpace to generate the data, but make sure to use the table output. It let's you generate the data from many runs at once, and the format is a little more consistent. There are still 6 lines of metadata at the top, but you can just delete that. I believe this is more the standard practice in NetLogo.

这篇关于出口地块与netlogo的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆