本文整理汇总了Java中org.cpsolver.ifs.solution.SolutionListener类的典型用法代码示例。如果您正苦于以下问题:Java SolutionListener类的具体用法?Java SolutionListener怎么用?Java SolutionListener使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SolutionListener类属于org.cpsolver.ifs.solution包,在下文中一共展示了SolutionListener类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createParallelSolution
import org.cpsolver.ifs.solution.SolutionListener; //导入依赖的package包/类
/**
* Create a solution that is to be used by a solver thread of the given index
* @param index solver thread index
* @return new solution to work with
*/
protected Solution<V, T> createParallelSolution(int index) {
Model<V, T> model = iCurrentSolution.getModel();
Assignment<V, T> assignment = new DefaultParallelAssignment<V, T>(index, model, iCurrentSolution.getAssignment());
model.createAssignmentContexts(assignment, true);
Solution<V, T> solution = new Solution<V, T>(model, assignment);
for (SolutionListener<V, T> listener: iCurrentSolution.getSolutionListeners())
solution.addSolutionListener(listener);
return solution;
}