Anylogic模型在具有外部依赖项且需要“写”权限的情况下,能否在(Anylogic)公共云上运行?
创始人
2024-08-22 17:00:33
0

可以将 Anylogic 模型打包成 jar 文件,并将其上传到云上运行。代码示例如下:

//引入相关包
import com.anylogic.cloud.client.DoSimulationRequest;
import com.anylogic.cloud.client.JsonSerializable;
import com.anylogic.cloud.client.ModelClient;
import com.anylogic.cloud.client.ModelResults;
import com.anylogic.cloud.client.ModelVersion;

//设置模型名称和版本
String modelName = "MyModel";
String modelVersion = "v1.0";

//连接到 Anylogic 云
ModelClient modelClient = new ModelClient("https://cloud.anylogic.com", "YOUR_API_KEY");

//获取模型名称为 "MyModel" 的模型及其版本信息
ModelVersion modelVersion = modelClient.getModelVersion(modelName, modelVersion);

//创建模拟请求
DoSimulationRequest simulationRequest = new DoSimulationRequest();
simulationRequest.setModelVersionId(modelVersion.getModelVersionId());

//设置外部依赖项
String dataPath = "C:/input_data.csv";
simulationRequest.addFileInput("input_data", dataPath);

//执行模拟
ModelResults results = modelClient.doSimulation(simulationRequest);

//获取结果
if (results.isSuccess()) {
    String outputFilePath = results.getOutputFilePath("output_data.csv");
    //处理结果文件
} else {
    System.out.println("Simulation failed: " + results.getError());
}

相关内容

热门资讯

透视了解!wepoker辅助下... 透视了解!wepoker辅助下载,wepoker有机器人吗,曝光教程(原生是真的有挂),支持语音通讯...
透视辅助!wepoker辅助器... 透视辅助!wepoker辅助器下载,智星菠萝辅助,揭秘真相(有挂教程);亲,关键说明,赛季回归,软件...
透视实锤!红龙poker透视工... 1、透视实锤!红龙poker透视工具,wpk辅助器,新版2025教程(原生是有挂)。2、红龙poke...
透视最新!wpk辅助工具下载,... 透视最新!wpk辅助工具下载,wpk辅助器,详细说明(有挂教学)1、每一步都需要思考,不同水平的挑战...
透视总结!hhpoker辅助下... 这是一款非常优秀的hhpoker辅助下载 ia辅助检测软件,能够让你了解到hhpoker辅助下载中牌...
透视讲解!wepoker辅助器... 透视讲解!wepoker辅助器安装包,wepoker底牌透视脚本下载,玩家必看教程(有挂教学)1)辅...
透视安装!wpk脚本下载,安装... 1、透视安装!wpk脚本下载,安装不了wepoker,线上教程(往昔真的是有挂)2、进入游戏-大厅左...
透视透视挂!aapoker辅助... 透视透视挂!aapoker辅助插件工具下载,wepoker辅助器是真的的吗,一分钟了解(有挂透明);...
透视存在!wepoker透视脚... 1、透视存在!wepoker透视脚本下载,pokemomo辅助工具,总结教程(固有存在有挂);详细教...
透视脚本!wepoker脚本,... 透视脚本!wepoker脚本,智星菠萝可以辅助吗,分享一款(有挂教程)1、进入到黑科技之后,能看到左...