chocoteam/choco-parsers

write solution (and possibly logging) into file

pchtsp opened this issue · 4 comments

It would be interesting to have the option to write the solution into a file instead of only showing it in the screen. This could be configured by a new command line option like the following:

-o <file_path>

Also, although less important, would be to have the log output (progress) written into, yet another, file.

That way, we could at the same time show the output in screen and write it into a file and not mix the solution logging with the solution itself.

Thanks!

Franco

If you are referring to MPS, the last (optimal) solution is the only one to print, right ?
Or you are also interested in having intermediate solutions.
In that case, I would suggest to give an output directory and that each solution is prefixed with "solution_".

If I can share options among all formats, that's better.

For the mps I'm only interested in the last (best) solution found.

It's true that it could be better to have common arguments for all the different interfaces. Maybe -o <file_path> could mean "write the last solution found in the following file" while another argument (-s <dir_path>?) could mean "write all the solutions found in the following directory".

What about something like:
-o sol.txt : output the last solution to sol.txt
-sas (or --save-all-solutions): save all solutions (false by default), post-fixed sol.txt with the number of the solutions
?

Yes, that could work. The only thing would be enforcing that if -sas is active, -o sol.txt needs to be active too. That way it is possible to use the given name for all the solution files.