Anylogic是否提供在运行实验后将数据集保存到Excel/csv文件的选项?
创始人
2024-08-22 18:00:32
0次

Yes, Anylogic provides the option to save datasets in Excel or CSV files after running an experiment. You can use the following code to achieve this:

是的,Anylogic提供了在运行实验后将数据集保存在Excel或CSV文件中的选项。您可以使用以下代码来实现:

// Create dataset object Dataset myData = new Dataset();

// Add data to the dataset

myData.add("Column1", value1); myData.add("Column2", value2); myData.add("Column3", value3);

// Save the dataset as an Excel file myData.exportToExcel(getProject().getWorkspacePath("results/data.xlsx"));

// Save the dataset as a CSV file myData.exportToCSV(getProject().getWorkspacePath("results/data.csv"));

In this code, we first create a dataset object named "myData." We then add data to this dataset object using the "add" method. In the example above, we are adding three columns of data to the dataset.

Once we have added our data, we can use the "exportToExcel" or "exportToCSV" methods to save the dataset as an Excel or CSV file, respectively.

In the code above, we are saving the dataset as an Excel file named "data.xlsx" in a folder named "results" located in the Anylogic project workspace. We are also saving the dataset as a CSV file named "data.csv" in the same folder.

Note that the "getProject().getWorkspacePath" method is used to get the workspace path of the Anylogic project. This method returns a string representing the path to the project's workspace, which we use to specify the location to save our Excel and CSV files.

相关内容

热门资讯

一分钟带你了解,AApoker... 一款 AI 游戏攻略黑科技工具上线,查攻略效率直接开挂。它整合版本更新、装备搭配、BOSS 打法、牌...
分享开挂内幕,wepoker透... 分享开挂内幕,wepoker透视挂作弊挂方法,德扑之星怎么开挂项目(固有是有辅助)主打赛后复盘的 A...
信息共享,微扑克辅助器有用吗,... 您好:微扑克辅助器有用吗这款游戏可以开挂的,确实是有挂的,很多玩家在这款游戏中打牌都会发现很多用户的...
玩家必看,微poker脚本,菠... 玩家必看,微poker脚本,菠萝智星德州真的有挂操作(原先真的是有辅助器)是一款可以让一直输的玩家,...
大神讲解,德州小辅助下载安装最... 您好:德州小辅助下载安装最新版本这款游戏可以开挂的,确实是有挂的,很多玩家在这款游戏中打牌都会发现很...
实测发现,wpk透视插件,WO... 您好:wpk透视插件这款游戏可以开挂的,确实是有挂的,很多玩家在这款游戏中打牌都会发现很多用户的牌特...
一分钟教会你,德扑之星能不能透... 一分钟教会你,德扑之星能不能透视,WePoKer透视方法讲义(好像真的是有透视挂)是一款可以让一直输...
玩家必看教程,德扑之星网页版透... 您好,德扑之星网页版透视辅助这款游戏可以开挂的,确实是有挂的,需要了解加微【485275054】很多...
避坑细节,德州最厉害三个辅助,... 避坑细节,德州最厉害三个辅助,AApoker透视是真的吗学习(本来存在有辅助器)主打赛后复盘的 AI...
实测发现,微扑克辅助软件免费版... 实测发现,微扑克辅助软件免费版,智星菠萝德州怎么开挂方针(都是是真的有辅助器)是一款可以让一直输的玩...