我正在尝试从节点js运行minizinc解算器 我找到了minizinc-solver库,但是我不知道如何构建问题的字符串,您有示例吗? 这是我的程序:
var minizincSolver = require("minizinc-solver")
var problem = String('include "globals.mzn";var 1..9:S;var 0..9:E;var 0..9:N;var 0..9:D;var 1..9:M;var 0..9:O;var 0..9:R;var 0..9:Y;constraint 1000_S + 100_E + 10_N + D + 1000_M + 100_O + 10_R + E = 10000_M + 1000_O + 100_N + 10_E + Y;constraint alldifferent([S,E,N,D,M,O,R,Y]);solve satisfy;output [" ",show(S),show(E),show(N),show(D),"\n"," + ",show(M),show(O),show(R),show(E),"\n"," = ",show(M),show(O),show(N),show(E),show(Y),"\n"];');
console.log(problem);
minizincSolver.solve(problem);
运行时我有未定义的响应 谢谢!