[ library(minizinc) | Reference Manual | Alphabetic Index ]

mzn_run(+File, ++SolverOrOptions)

Run a MiniZinc model from a given file
File
File name (extension defaults to .mzn)
SolverOrOptions
Name of solver mapping module, or zn_options-structure

Description

Reads a MiniZinc model from a file, and interprets it using the solver mapping defined in SolverOrOptions. At the end of solving, results are printed to the output stream, timing and progress messages are printed to the log_output stream, warnings to the warning_output stream, and error messages the error stream. This predicate always succeeds.

Modes and Determinism

Examples

    ?- mzn_run("mymodel.mzn", fzn_ic).
    Found a solution with cost 10
    Found no solution with cost 7.0 .. 9.0
    end = 10
    b1 = 1
    b2 = 0
    b3 = 1
    b4 = 0
    Objective value = 10
    Total time 0.031s cpu (0.016 setup + 0.000 search)

    ?- mzn_run(queens8, zn_options{solver:fzn_ic,solutions:3}).
    Starting search
    q = [1,5,8,6,3,7,2,4]
    Total time 0.016s cpu (0.016 setup + 0.000 search)
    q = [1,6,8,3,7,4,2,5]
    Total time 0.016s cpu (0.016 setup + 0.000 search)
    q = [1,7,4,6,8,2,5,3]
    Total time 0.016s cpu (0.016 setup + 0.000 search)

See Also

flatzinc : fzn_run / 2, mzn_run / 3, mzn_run_string / 2, flatzinc : struct(zn_options)