OptaPlanner benchmarking without XML inputSolutionFile

青春壹個敷衍的年華 提交于 2019-12-12 22:03:24

问题


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?


回答1:


One way that should work:

  • 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.


来源:https://stackoverflow.com/questions/30115141/optaplanner-benchmarking-without-xml-inputsolutionfile

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!