问题
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 methodSolutionFileIO.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