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.

相关内容

热门资讯

分享实测!智星德州可以透视吗,... 分享实测!智星德州可以透视吗,德普之星到底能开挂吗插件(本然真的是有透视挂)AI 是一款可以让一直输...
玩家必看秘籍!wepoker怎... 您好,玩家必看秘籍!wepoker怎么设置盖牌,微扑克有挂吗平台(本然真的有透视)这款游戏可以开挂的...
大神推荐!wepoker免费脚... 一款 AI 游戏攻略黑科技工具上线,查攻略效率直接开挂。它整合版本更新、装备搭配、BOSS 打法、牌...
终于知道!!wepoker透视... 终于知道!!wepoker透视是真的吗,WPK软件下载下载(其实存在有开挂)AI 是一款可以让一直输...
科技教程!wepoker怎么发... 本地部署 AI 黑科技工具迎来新版本,不用上传文件到云端就能完成wepoker怎么发冤家牌解析、 A...
热点推荐!!wpk显示有作弊,... 很多人使用云端 AI 时,都担心wpk显示有作弊、内部资料上传带来隐私风险。这款本地运行的 AI 黑...
玩家必备科普!wpk透视工作室... 玩家必备科普!wpk透视工作室,德扑之星外卦神器软件平台(切实有辅助挂)AI 是一款可以让一直输的玩...
重大通报!!德扑之星透视免费,... 本地部署 AI 黑科技工具迎来新版本,不用上传文件到云端就能完成德扑之星透视免费解析、 AI 处理、...
解密关于!WPK德州局,德普之... WPK德州局AI 游戏攻略黑科技上线本地缓存功能,离线查阅能力开挂。提前下载对应游戏攻略数据包,断网...
玩家攻略!wepoker代打辅... 本地部署 AI 黑科技工具迎来新版本,不用上传文件到云端就能完成wepoker代打辅助解析、 AI ...