我有一个迷你模型,我想找到所有的解决方案(我使用gecode),然后打印统计数据,这很简单:
mzn-gecode -as foo.mzn但此模型将生成数千个解决方案,并为每个解决方案打印一个分隔符:
----------
----------
----------
----------
==========我需要删除这些分隔符,只打印统计数据。有什么办法吗?
==Update==
中修改Gecode源代码就可以解决这个问题。
gecode/flatzinc/flatzinc.cpp我删除的地方
out << "----------" << std::endl;也许有更好的解决方案,但这对我很有效。
发布于 2012-10-08 20:47:49
之所以显示这些分隔符,是因为没有任何变量的output语句。
例如。
output [
show(x) ++ "\n" ++ show(y)
];发布于 2016-02-12 22:08:34
--soln-sep <s>, --soln-separator <s>, --solution-separator <s>
Specify the string used to separate solutions.
The default is to use the FlatZinc solution separator,
"----------".添加--soln-sep <s>覆盖标准分隔符
https://stackoverflow.com/questions/12780502
复制相似问题