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方法,火鸟大厅切实真的是有作弊器方法运火鸟大厅辅助工具,进入...
盘点一款开挂!新世纪开挂多功能... 盘点一款开挂!新世纪开挂多功能AI脚本,新世纪好像是有开挂脚本小薇(辅助器软件下载)致您一封信;亲爱...
今日公布透视器!年年大厅透视器... 今日公布透视器!年年大厅透视器多功能AI插件,年年大厅切实是真的有透视器插件1、每一步都需要思考,不...
一分钟揭秘辅助器!火鸟大厅辅助... 一分钟揭秘辅助器!火鸟大厅辅助器多功能AI方法,火鸟大厅果然真的有辅助器方法1、火鸟大厅模拟器是什么...
总算了解透视器!天久大厅透视器... 总算了解透视器!天久大厅透视器多功能AI软件,天久大厅一贯真的有透视器软件1、许多玩家不知道天久大厅...
玩家实测透视器!美人透视器多功... 玩家实测透视器!美人透视器多功能AI技巧,美人竟然真的有透视器技巧1、玩家可以在美人线上大神俱乐部对...
必知教程透视器!新乐酷副厅透视... 必知教程透视器!新乐酷副厅透视器多功能AIapp,新乐酷副厅真是存在有透视器app1、该软件可以轻松...
热点推荐透视挂!新鸿狐透视挂多... 热点推荐透视挂!新鸿狐透视挂多功能AI工具,新鸿狐其实有透视挂工具1、新鸿狐透视辅助软件激活码多个强...
带你了解辅助!椰子大厅辅助多功... 带你了解辅助!椰子大厅辅助多功能AI攻略,椰子大厅总是真的有辅助攻略椰子大厅是不是有人用挂微扑克wp...
每日必看推荐作弊器!八戒大厅作... 每日必看推荐作弊器!八戒大厅作弊器多功能AI插件,八戒大厅竟然存在有作弊器插件八戒大厅破解侠是真的助...