use of org.cpsolver.studentsct.heuristics.RandomizedBacktrackNeighbourSelection in project cpsolver by UniTime.
the class BacktrackSelection method init.
public void init(Solver<Request, Enrollment> solver, String name) {
List<Request> variables = new ArrayList<Request>(iIncludeAssignedRequests ? solver.currentSolution().getModel().variables() : solver.currentSolution().getModel().unassignedVariables(solver.currentSolution().getAssignment()));
Collections.shuffle(variables);
iRequests = new LinkedList<Request>(variables);
if (iRBtNSel == null) {
try {
iRBtNSel = new RandomizedBacktrackNeighbourSelection(solver.getProperties());
iRBtNSel.init(solver);
} catch (Exception e) {
throw new RuntimeException(e.getMessage(), e);
}
}
Progress.getInstance(solver.currentSolution().getModel()).setPhase(name, variables.size());
}
Aggregations