Do we need to read an XML file to get useful information about an Optaplanner solution?

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

  •  13-06-2023
  •  | 
  •  

Question

I have been looking at the Optaplanner outputs for several problems, including N Queens, TSP, and Project Job Planning. The problem statements for TSP and Project Job Planning seem to be easily understood text files. The solutions generated by Optaplanner always seem to take the form of very long, somewhat obscure XML files.

While I have used XML a little bit, I usually use very short XML files that are easily understood. For example Apache Hadoop uses a few small XML files that are very easy to understand. The Optaplanner XML seems to be much more complicated than the Apache XML.

I imagine that most users of this product do not manually parse through each XML output. Probably many of them use some customized XML reading program.

The Optaplanner documentation doesn't seem to include any hints on how to read the XML output. Is the user supposed to figure out the XML just be looking at it, or am I failing to read some documentation that will explain how to interpret the output?

Était-ce utile?

La solution

OptaPlanner itself doesn't require XML input or output: it works on plain old java classes to represent a dataset.

In optaplanner-examples (and optaplanner-webexamples), we 've chosen to persist datasets through XML files, but we might as well have chosen a TXT file, a relational database or a hadoop cluster. Those XML files are verbose because they are an XStream mirror of the java classes (so no special mapping).

Many of the optaplanner-examples are based on an official research competition which have their own data format (usually TXT). Those are often far less verbose. You can find those in the import/export folders. The Importer and Exporter classes convert such a TXT file into java classes. Also look for ProblemIO implementations.

Read more about this in the manual in the new chapter for 6.1.0.Beta1 (although older versions behave the same way).

integration overview

Autres conseils

First of all please note that I'm not a skilled programmer.

Nevertheless, I took the export file of Employee Rostering and with +-50 lines of Python (8 hrs programming) wrote a conversion script which creates a: (2D) matrix of employee ID vs Date with Shift-type as values.

It would be great if such conversion could be made part of the standard downloadable examples as that is what a gazilion people are looking for!

If on top of that, the input could get an bit easier Interface I think Optaplanner can win a lot of terrain out there!

ps I'd be willing to help develop such In- & Output tools.

pps I do need to look into Java memory problem (My problem has: 90 days, 12 employees, 2 skills, 3 contracts, 8 patterns, <50 requests).

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top