Machine-readable output

24 views
Skip to first unread message

Yury Semenov

unread,
May 24, 2024, 6:25:26 AMMay 24
to MiniZinc
Hi,

I'm using MiniZinc as a layer between my code and solvers, and my code needs to get variable values from MiniZinc output. Unfortunately, this is not a pleasant task even with the --json-stream option, which, according to the documentation, is supposed to produce machine-readable output. This is because the variables are encoded in minizinc syntax and are stored in a single string inside the json. Is there any way to produce something even more machine-readable? For example, to store variables in a structured json like "{"var1": 0, "var_array": [1, 2, 3]}"?

Cyderize

unread,
May 24, 2024, 6:30:34 AMMay 24
to MiniZinc
Yes, if you also add `--output-mode json` MinIZinc will output the solution in JSON format (described here).

Thank you,
Jason

Yury Semenov

unread,
May 24, 2024, 7:13:32 AMMay 24
to MiniZinc
It worked, thank you!

пятница, 24 мая 2024 г. в 13:30:34 UTC+3, Cyderize:
Reply all
Reply to author
Forward
0 new messages