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.

相关内容

热门资讯

wepokeai代打!wepo... wepokeai代打!wepokeai代打,(wePOke)真是有挂,安装教程(有挂脚本)1、wep...
透视科技!aapoker辅助插... 透视科技!aapoker辅助插件工具下载,wepoker透视脚本苹果,科技通报(有挂规律)1)aap...
wepoke有辅助挂!微扑克辅... wepoke有辅助挂!微扑克辅助机器人,(WePoKer)本来有挂,专业教程(有挂教程)1、在微扑克...
透视挂!wepoker透视版下... 透视挂!wepoker透视版下载,aapoker辅助插件工具,揭秘关于(有挂介绍)1、下载好aapo...
WePoKe透明挂!wepok... WePoKe透明挂!wepokeai机器人,(wopoker)真是真的有挂,2025版教程(有挂技巧...
透视有挂!wpk透视脚本视频,... 透视有挂!wpk透视脚本视频,wepoker透视版下载,一分钟揭秘(有挂详情);进入游戏-大厅左侧-...
aapoker俱乐部!wpk透... aapoker俱乐部!wpk透明挂,(WepoKe)竟然真的是有挂,分享教程(有挂脚本)1、每一步都...
透视教程!aapoker透视脚... 透视教程!aapoker透视脚本,wepoker脚本,实测教程(有挂介绍)辅助器中分为三种模型:软件...
wpk德州透视辅助!微扑克ai... wpk德州透视辅助!微扑克ai辅助,(WepOke)其实是真的有挂,2025新版教程(有挂介绍);1...
透视软件!wpk辅助ai,wp... 透视软件!wpk辅助ai,wpk辅助工具,终于发现(有挂攻略)1、透视辅助简单,软件透明挂操作,黑科...