在OptaPlanner 6.1.0中加载现实世界中的XML问题 [英] Loading real world XML problems in OptaPlanner 6.1.0

查看:100
本文介绍了在OptaPlanner 6.1.0中加载现实世界中的XML问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在研究OptaPlanner框架,发现CloudBalancingHelloWorld示例非常适合我所要处理的问题-只有它可以加载伪造的问题集,并且我想创建自己的XML文件并加载它...但是文档对此主题似乎有点稀疏,我看不到任何示例.

I've been studying the OptaPlanner framwork for a bit and have found the CloudBalancingHelloWorld example fits a problem I'm tasked with fairly well - only it loads a fake generated problem set and I'd like to create my own XML file and load that instead ... but the docs seem a bit sparse on this subject, and I don't see any examples.

CloudBalancingHellowWorld.java中的现有代码为:

The existing code in CloudBalancingHellowWorld.java is:

// Load a problem with 400 computers and 1200 processes
// This gets replaced with a class that loads a *real* problem - from a DB for example.
CloudBalance unsolvedCloudBalance = new CloudBalancingGenerator().createCloudBalance(400, 1200);

而且我希望能够以编程方式加载XML问题描述.是否有完成此操作的示例,或者可以细读Docs以获得一些启发?

And I'd like to be able to programmatically load an XML problem description. Are there any examples out there of this being done or Docs to be perused to gain some inspiration?

推荐答案

从XML到XML的整个数据集序列化都是optaplanner-examples的一部分:OptaPlanner本身不提供或不需要任何序列化格式.话虽如此,optaplanner-examples包含以下序列化格式:

The whole dataset serialization from and to XML is part of optaplanner-examples: OptaPlanner itself doesn't provide or require any serialization format. That being said, optaplanner-examples includes the following serialization formats:

  • 每个示例:data目录unsolvedsolved中的 XStream XML格式.格式由域类上的XStream批注(@XStreamAlias等)定义.在某些情况下,XML格式过于冗长,导致OutOfMemoryError,例如对于大型MachineReassignment B数据集.
  • 大多数示例:data目录importexport中特定于比赛的TXT格式.格式由比赛定义(请参阅文档).在示例GUI中,单击导入"按钮以加载它们.
  • Every example: XStream XML format in data directories unsolved and solved. The format is defined by the XStream annotations (@XStreamAlias etc) on the domain classes. In some cases the XML format is too verbose, causing OutOfMemoryError, for example for the big MachineReassignment B datasets.
  • Most examples: Competition specific TXT format in data directories import and export. The format is defined by the competition (see docs). In the examples GUI, click on button Import to load them.

这篇关于在OptaPlanner 6.1.0中加载现实世界中的XML问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆