How to use an alternative(JAXB) to XStream for reading the solver configuration in optaplanner?

StackOverflow https://stackoverflow.com/questions/19842013

  •  29-07-2022
  •  | 
  •  

Question

The optaplanner uses XStream for reading the solver configuration from XML. For using JAXB instead, is it sufficient to have custom implementation of XMLSolverFactory and SolverConfig?

Was it helpful?

Solution

No, because the *Config classes aren't annotated with JAXB annotations in 6.0.0. There's a open discussion if we want to migrate from XStream to JAXB, so we can offer an XSD of the solver config.

Also note, that these 2 things are completely distinct:

  1. read a solver configuration from XML
  2. read a solution dataset from XML (~ProblemIO)

For 2), you can very easily replace XStreamProblemIO with a JaxbProblemIO (which should be easy to write).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top