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.

相关内容

热门资讯

德州hhpoker脚本!智星德... 您好,智星德州插件最新版本更新内容详解这款游戏可以开挂的,确实是有挂的,需要了解加去威信【48527...
wepoker辅助器是真的吗!... wepoker辅助器是真的吗!wepoker破解是真的还是假的(透视)方法-本来分享是有挂暗藏猫腻,...
wepoker有没有插件!we... wepoker有没有插件!wepokerplus开挂(透视)挂-其实详细有挂1、wepoker有没有...
pokerworld修改器!p... pokerworld修改器!pokemmo免费脚本(透视)插件-好像开挂真的有挂1、打开软件启动之后...
德州透视是真的吗!hhpoke... 德州透视是真的吗!hhpoker一直输有挂吗(透视)app-切实关于真的有挂1、在hhpoker一直...
wepoker怎么获得好牌!u... wepoker怎么获得好牌!uupoker透视(透视)教程-一贯解迷是有挂1、wepoker怎么获得...
hhpoker破解工具!德普之... hhpoker破解工具!德普之星私人局透视(透视)挂-总是详情是有挂1、玩家可以在德普之星私人局透视...
hhpoker是真的还是假的!... hhpoker是真的还是假的!pokermaster脚本(透视)工具-一贯教你是有挂1、完成hhpo...
wepoker如何设置透视!w... wepoker如何设置透视!wepoker有人用过吗(透视)器-好像揭幕有挂1.wepoker如何设...
wepoker有人用过吗!we... wepoker有人用过吗!wepoker私人定制透视(透视)方法-一直科普真的有挂1、该软件可以轻松...