The optaplanner manual explains how to use the benchmarker to read input files and write the output solutions using XStreamProblemIO.
What i don't understand is how to create the initial input solution file that goes in <inputSolutionFile></inputSolutionFile>
. how do i take the solution i generate in my test cases and write that to an xml file? i tried this:
ActivitySolution activitySolution = createInitialSolution(organization, dateRangeStart, dateRangeEnd);
// create the dataset xml for benchmark
ClassLoader classLoader = getClass().getClassLoader();
URL url = classLoader.getResource("benchmark/testSimpleResourceAllocationAssignment.xml");
String path = url.getFile();
File file = new File(path);
XStreamSolutionFileIO fileIO = new XStreamSolutionFileIO();
fileIO.write(activitySolution, file);
But am left with an empty file.
I really don't understand how am i supposed to dump my dataset into an xml file.
Thanks