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.

相关内容

热门资讯

透视好友房(WPK开挂)外挂透... 透视好友房(WPK开挂)外挂透明挂辅助挂(辅助挂)原来真的有挂(切实教程)(哔哩哔哩),亲,有的,a...
专业讨论(aapoker手游版... 专业讨论(aapoker手游版)外挂透明挂辅助挂(透视)软件透明挂(2022已更新)(哔哩哔哩);值...
透视游戏(德扑之星机制)外挂透... 透视游戏(德扑之星机制)外挂透明挂辅助APP(透视)原来真的有挂(必胜教程)(哔哩哔哩);wpk透视...
分享实测(wePoke)外挂透... 分享实测(wePoke)外挂透明挂辅助工具(透视)软件透明挂(2021已更新)(哔哩哔哩)1、玩家可...
玩家必看科普(德州透视)外挂透... 玩家必看科普(德州透视)外挂透明挂辅助器安装(透视)透视辅助(确实有挂)-哔哩哔哩;wpk透视辅助官...
交流学习经验(鱼扑克app a... 交流学习经验(鱼扑克app ai)外挂透明挂辅助脚本(透视)其实是真的有挂(安装教程)(哔哩哔哩);...
技术分享(wepoke ai)... 技术分享(wepoke ai)外挂透明挂辅助器(透视)软件透明挂(2023已更新)(哔哩哔哩)关于w...
玩家必用(governorof... 玩家必用(governorofpoker3)外挂透明挂辅助插件(透视)德州ai机器人(有挂秘诀)-哔...
分享实测(WPK脚本)外挂透明... 分享实测(WPK脚本)外挂透明挂辅助工具(透视)竟然真的有挂(透视教程)(哔哩哔哩);WPK脚本简单...
一分钟了解(德州线上扑克)外挂... 德州线上扑克高级策略深度解析‌;一分钟了解(德州线上扑克)外挂透明挂辅助神器(透视)辅助透视(202...