本文整理匯總了Java中org.cpsolver.ifs.solver.SolverListener類的典型用法代碼示例。如果您正苦於以下問題:Java SolverListener類的具體用法?Java SolverListener怎麽用?Java SolverListener使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
SolverListener類屬於org.cpsolver.ifs.solver包,在下文中一共展示了SolverListener類的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: selectVariable
import org.cpsolver.ifs.solver.SolverListener; //導入依賴的package包/類
/** Use the provided variable selection criterion to select a variable
* @param solution current solution
* @return selected variable
**/
public V selectVariable(Solution<V, T> solution) {
// Variable selection
V variable = getVariableSelection().selectVariable(solution);
for (SolverListener<V, T> listener : iSolver.getSolverListeners())
if (!listener.variableSelected(solution.getAssignment(), solution.getIteration(), variable))
return null;
if (variable == null)
sLogger.debug("No variable selected.");
if (variable != null && variable.values(solution.getAssignment()).isEmpty()) {
sLogger.debug("Variable " + variable.getName() + " has no values.");
return null;
}
return variable;
}