我如何在 choco-solver 中调用 cpprofiler 进行约束编程分析

How can i call cpprofiler in choco-solver for contrainst programming profiling

我在 choco-solver 文档中找到了这个,但我不知道如何将它与提供的 choco-solver 示例程序一起使用以进行分析。

注意:我已经在我的机器上安装了 cpprofiller 并启动了它。所以它在端口 6565 上启动一个 tcp 服务器。

需要帮助。

首先,确保您的代码如下所示:

try (CPProfiler profiler = new CPProfiler(s1.getSolver(), true)) {
   solver.findSolution();
}

那么,你应该先启动CPProfiler,再启动运行 运行 Java程序。 返回 CPProfiler 界面后,您应该会看到正在更新的搜索树。