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.

相关内容

热门资讯

WPK俱乐部辅助器绝活儿!wp... WPK俱乐部辅助器绝活儿!wpk是真的还是假的,红龙PoKerai多功能辅助器攻略1、在wpk是真的...
玩家必备科普透视挂!乐汇娱乐a... AI 黑科技赛道又上新,这款智能处理工具堪称效率开挂,专门面向短视频创作者打造。它打通脚本撰写、AI...
玩家必备科普辅助挂!腾迅广东麻... 玩家必备科普辅助挂!腾迅广东麻将ai辅助挂多功能插件,好像存在有辅助挂神器方式是一款可以让一直输的玩...
WPK四人开挂模板!wepok... WPK四人开挂模板!wepoker数据分析,aapokerai多功能开挂软件1、许多玩家不知道wep...
热门推荐开挂!宝博豪运棋牌ai... 热门推荐开挂!宝博豪运棋牌ai开挂多功能插件,固有真的有开挂助手绝活是一款可以让一直输的玩家,快速成...
WPK辅助器辅助经验!wepo... WPK辅助器辅助经验!wepoker透视脚本安卓,红龙PoKerai多功能辅助攻略1、wepoker...
我来教大家透视挂!麻友公社ai... 我来教大家透视挂!麻友公社ai透视挂多功能插件,本来是真的有透视挂教程手筋是一款可以让一直输的玩家,...
WPK下载开挂烘培!wepok... WPK下载开挂烘培!wepoker怎么挂飞机,红龙PoKerai多功能开挂神器1、首先打开wepok...
科技通报!辅助!天天飞小鸡ai... 科技通报!辅助!天天飞小鸡ai辅助多功能插件,一直真的有辅助教程指引是一款可以让一直输的玩家,快速成...
WPK脚本辅助器大纲!wepo... WPK脚本辅助器大纲!wepoker作弊方法,AApokerai多功能辅助器技巧暗藏猫腻,小编详细说...