Search code examples
minizinc

MiniZinc: No statistics output


The Minizinc documentation states that diagnostic statistics can be printed to the output stream by adding special lines in the form

%%%mzn-stat: <name>=<value>

where <value> can be one of a number of diagnostics. However, adding the line

%%%mzn-stat: n_failures=failures

doesn't change the output. Using the -s flag outputs some, but not all, of the available statistics, but only with gecode-- Chuffed instead prints a list of numbers which I can only assume correspond to those variables.

How can I better control the output of statistics while running problems? Are they very dependent on the choice of solver?


Solution

  • Are they [the statistics] very dependent on the choice of solver?

    I think that's the obvious expectation.

    I am not sure, but I think you misunderstood the documentation. The code:

    %%%mzn-stat: <name>=<value>
    

    is supposed to be printed by the FlatZinc solver as an output, and not to appear in the FlatZinc input model (where it would obviously be ignored, since it starts with the comment prefix %).


    The documentation says:

    FlatZinc solvers can output statistics in a standard format so that it can be read by scripts, for example, in order to run experiments and automatically aggregate the results.

    Notice the use of the word can instead of must.

    How can I better control the output of statistics while running problems?

    1. Refer to the documentation of each tool, if any, otherwise try playing with the tool or contact the authors.

    2. Possibly contact the authors and suggest the adoption of a given format if you notice that the majority of the remaining tools actually adhere to it. If many requests of such type start queueing in, sooner or later it will make a difference.