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.

相关内容

热门资讯

玩家必看攻略!微乐广东麻将辅助... 玩家必看攻略!微乐广东麻将辅助器功能神器,微乐广东麻将竟然真的有辅助器神器1、起透看视 微乐广东麻将...
必备科技!大懒人娱乐透视挂功能... 必备科技!大懒人娱乐透视挂功能脚本,大懒人娱乐一贯真的有透视挂脚本1、大懒人娱乐有没有辅助教程、大懒...
程序员教你!好运众娱透视挂功能... 程序员教你!好运众娱透视挂功能app,好运众娱好像真的有透视挂app亲,关键说明,好运众娱透视脚本安...
每日必看!中至吉安麻将透视功能... 每日必看!中至吉安麻将透视功能软件,中至吉安麻将确实有透视软件1、超多福利:超高返利,海量正版游戏,...
今日公布!闽游十三水开挂功能方... 今日公布!闽游十三水开挂功能方法,闽游十三水其实有开挂方法1、玩家可以在闽游十三水线上大神俱乐部对游...
玩家攻略!海潮娱乐辅助功能教程... 玩家攻略!海潮娱乐辅助功能教程,海潮娱乐其实有辅助教程1、上手简单,内置详细流程视频教学,新手小白可...
热点推荐!好乐游透视挂功能方法... 热点推荐!好乐游透视挂功能方法,好乐游原来有透视挂方法1、好乐游辅助软件下载优化,好乐游底牌透视脚本...
玩家必看秘籍!28圈辅助功能技... 您好,28圈这款游戏可以开挂的,确实是有挂的,需要了解加去威信【136704302】很多玩家在这款游...
玩家交流!宁波世纪茶馆辅助功能... 玩家交流!宁波世纪茶馆辅助功能脚本,宁波世纪茶馆总是存在有辅助脚本宁波世纪茶馆透视方法中分为三种模型...
盘点一款!华彩棋牌透视功能技巧... 盘点一款!华彩棋牌透视功能技巧,华彩棋牌其实真的有透视技巧1、进入游戏-大厅左侧-新手福利-激活码辅...