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.

相关内容

热门资讯

科技新动态!微扑克发牌算法,W... 科技新动态!微扑克发牌算法,WePoKe透视挂,技巧教程(最初有挂)是一款可以让一直输的玩家,快速成...
终于清楚!fishpoker扑... 终于清楚!fishpoker扑克辅助,智星德州菠萝偷偷看牌功能,wpk教程(固有真的有挂)智星德州菠...
今日焦点!约局吧辅牌器,wep... 1、今日焦点!约局吧辅牌器,wepoke有挂,分享教程(一贯是真的有挂);代表性(透视辅助软件透明挂...
总算了解!微扑克有辅助挂吗,w... 总算了解!微扑克有辅助挂吗,wepoke模拟器,新2025版(最初真的是有挂)是一款可以让一直输的玩...
揭秘一下!ai机器人代打德州,... 揭秘一下!ai机器人代打德州,wepoke黑科技,大神讲解(原先真的有挂)1)wepoke黑科技辅助...
必看攻略!wepoke美元局稳... 自定义wepokeai代打的胜率系统规律,只需要输入自己想要的开挂功能,一键便可以生成出微扑克专用辅...
最新研发!微扑克俱乐部24小时... 1、最新研发!微扑克俱乐部24小时,wepoke智能ai,力荐教程(先前真的是有挂);代表性(透视辅...
终于知道!wpk辅助器小程序,... 终于知道!wpk辅助器小程序,aapoker透明挂,解密教程(固有真的是有挂)1、构建自己的微扑克辅...
分享一款!微扑克ai辅助会封号... 分享一款!微扑克ai辅助会封号吗,wepoke有没有挂,可靠技巧(一直真的有挂)1、构建自己的微扑克...
科技揭秘!智星德州菠萝辅助,智... 科技揭秘!智星德州菠萝辅助,智星德州菠萝开挂,攻略方法(切实存在有挂)是一款可以让一直输的玩家,快速...