没有XML输入的OptaPlanner基准测试解决方案 [英] OptaPlanner benchmarking without XML inputSolutionFile

查看:90
本文介绍了没有XML输入的OptaPlanner基准测试解决方案的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经开发了一个有效的求解器,它可以直接从数据库(没有XML文件)生成未解决的解决方案.现在,我开始开发它的基准测试器.由于所有示例基准测试人员都使用inputSolutionFile(xml文件),因此我试图将我生成的未解决的解决方案添加到PlannerBenchmarkFactory中.我可以绕过创建xml inputSolutionFile吗?如果没有,我如何将未解决的解决方案序列化为可接受的inputSolutionFile?

I have developed a working solver, which generates the unsolved solution directly from database(without and XML file). Now I am starting to develop it's benchmarker. Since all the example benchmarkers utilizes inputSolutionFile(xml files), I am trying to get the unsolved solution I generated into the PlannerBenchmarkFactory. Am I able to bypass creating the xml inputSolutionFile? If not, how would I serialize the unsolved solution into an acceptable inputSolutionFile?

推荐答案

一种可行的方法:

  • 创建一个小的txt文件作为输入文件,其中仅提及数据库连接参数和未初始化的解决方案实例的记录ID.
  • 实施接口SolutionFileIO,并在基准测试器配置中对其进行配置.在方法SolutionFileIO.read(File)中读取参数,连接到数据库并获取未初始化的解决方案实例.
  • Create a small txt file as the inputfile that just mentions the database connection parameters and the record ID of the uninitialized solution instance.
  • Implement the interface SolutionFileIO and configure it in the benchmarker config. In the method SolutionFileIO.read(File) read the parameters, connect to the database and fetch the uninitialized solution intance.

这篇关于没有XML输入的OptaPlanner基准测试解决方案的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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