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.

相关内容

热门资讯

透视了解!aapoker辅助器... 透视了解!aapoker辅助器是真的吗,aapoker透视辅助,攻略方法(一贯是真的有挂);人气非常...
透视系统!德扑之星ai代打,德... 透视系统!德扑之星ai代打,德扑之星软件有猫腻吗,揭秘攻略(真是有挂)1、很好的工具软件,可以解锁游...
透视工具!微扑克有辅助透视,微... 透视工具!微扑克有辅助透视,微扑克ai辅助神器,系统教程(一向真的是有挂);无聊就玩这款微扑克有辅助...
透视最新!aapoker辅助,... 透视最新!aapoker辅助,aapoker透明挂真假,2025教程(从来真的有挂);人气非常高,a...
透视模拟器!智星德州菠萝辅助器... 透视模拟器!智星德州菠萝辅助器推荐,智星德州菠萝辅助器免费下载,靠谱教程(好像真的是有挂);透视模拟...
透视插件!wpk透视挂会被封号... 您好,wpk透视挂会被封号吗这款游戏可以开挂的,确实是有挂的,需要了解加微【136704302】很多...
透视黑科技!红龙扑克辅助器第一... 透视黑科技!红龙扑克辅助器第一视角,红龙扑克机制,wpk教程(原生是真的有挂);透视黑科技!红龙扑克...
透视智能ai!微扑克如何让系统... 您好,微扑克如何让系统发好牌这款游戏可以开挂的,确实是有挂的,需要了解加微【136704302】很多...
透视安卓版!德扑ai软件购买,... 透视安卓版!德扑ai软件购买,德扑之星软件辅牌器,解密教程(好像是真的有挂)1、金币登录送、破产送、...
透视系统!wepoke怎么看有... 透视系统!wepoke怎么看有没有外挂,wepoke ai辅助,细节方法(往昔真的是有挂);致您一封...