简体   繁体   English

AnyLogic 将数据集导出到 excel 文件

[英]AnyLogic exporting dataset into excel file

I got a dataset named datasetHourly and I would like to get the data after a simulation into an excel file, how can I get this?我有一个名为 datasetHourly 的数据集,我想将模拟后的数据放入 excel 文件中,我该如何获取? I can copy the dataset of the first 1000 dataset but dont get more.我可以复制前 1000 个数据集的数据集,但不会得到更多。

First be sure you are saving more than 1000 values in your dataset.首先确保您在数据集中保存了 1000 个以上的值。 In the following image you can see that I'm storing 2000 values in my dataset.在下图中,您可以看到我在数据集中存储了 2000 个值。 The dataset will hold ONLY the LAST 2000 values, nothing else.数据集将只保存最后 2000 个值,没有别的。 So be careful with that.所以要小心。

数据集

Second, to copy the dataset values to your excelfile, assuming that you have an excel object in your model you can do this:其次,要将数据集值复制到您的 excelfile,假设您的模型中有一个 excel 对象,您可以执行以下操作:

excelFile.writeDataSet(datasetHourly, sheetIndex, row, column);
excelFile.writeFile();

you just need to choose in which cell (row,column) and what sheet (sheetIndex) you want to copy your dataset.您只需要选择要复制数据集的单元格(行、列)和工作表(sheetIndex)。

And that should be all这应该是全部

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM