本文整理匯總了Java中org.cpsolver.ifs.solver.Solver.getProperties方法的典型用法代碼示例。如果您正苦於以下問題:Java Solver.getProperties方法的具體用法?Java Solver.getProperties怎麽用?Java Solver.getProperties使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.cpsolver.ifs.solver.Solver
的用法示例。
在下文中一共展示了Solver.getProperties方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: init
import org.cpsolver.ifs.solver.Solver; //導入方法依賴的package包/類
/**
* Initialization
*/
@Override
public void init(Solver<V, T> solver) {
super.init(solver);
if (!solver.hasSingleSolution())
iCon = new ParallelConstruction<V, T>(solver.getProperties(), iCon == null ? iStd : iCon);
iStd.init(solver);
if (iCon != null)
iCon.init(solver);
iSA.init(solver);
iHC.init(solver);
iGD.init(solver);
iProgress = Progress.getInstance(solver.currentSolution().getModel());
}
示例2: init
import org.cpsolver.ifs.solver.Solver; //導入方法依賴的package包/類
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());
}
示例3: NeighbourSelectionWithSuggestions
import org.cpsolver.ifs.solver.Solver; //導入方法依賴的package包/類
public NeighbourSelectionWithSuggestions(Solver<Lecture, Placement> solver) throws Exception {
this(solver.getProperties());
init(solver);
}
示例4: setup
import org.cpsolver.ifs.solver.Solver; //導入方法依賴的package包/類
public void setup(Solver<Request, Enrollment> solver) {
if (iMPP)
registerSelection(new AssignInitialSelection(solver.getProperties()));
// Phase 1: section all students using incremental branch & bound (no
// unassignments)
registerSelection(iUseConstruction ?
new PriorityConstructionSelection(solver.getProperties()) :
new BranchBoundSelection(solver.getProperties()));
// Phase 2: pick a student (one by one) with an incomplete schedule, try
// to find an improvement
registerSelection(new SwapStudentSelection(solver.getProperties()));
// Phase 3: use standard value selection for some time
registerSelection(new StandardSelection(solver.getProperties(), getVariableSelection(), getValueSelection()));
// Phase 4: use backtrack neighbour selection
registerSelection(new BacktrackSelection(solver.getProperties()));
// Phase 5: pick a student (one by one) with an incomplete schedule, try
// to find an improvement, identify problematic students
SwapStudentSelection swapStudentSelection = new SwapStudentSelection(solver.getProperties());
registerSelection(swapStudentSelection);
// Phase 6: random unassignment of some problematic students
registerSelection(new RndUnProblStudSelection(solver.getProperties(), swapStudentSelection));
// Phase 7: resection incomplete students
registerSelection(new ResectionIncompleteStudentsSelection(solver.getProperties()));
// Phase 8: resection of students that were unassigned in step 6
registerSelection(new ResectionUnassignedStudentsSelection(solver.getProperties()));
// Phase 9: pick a student (one by one) with an incomplete schedule, try
// to find an improvement
registerSelection(new SwapStudentSelection(solver.getProperties()));
// Phase 10: use standard value selection for some time
registerSelection(new StandardSelection(solver.getProperties(), new RouletteWheelRequestSelection(solver.getProperties()), getValueSelection()));
// Phase 11: pick a student (one by one) with an incomplete schedule,
// try to find an improvement
registerSelection(new SwapStudentSelection(solver.getProperties()));
// Phase 12: use backtrack neighbour selection
registerSelection(new BacktrackSelection(solver.getProperties()));
if (iShuffleStudentsSelection) {
// Phase 13: try shuffling students around request groups
registerSelection(new ShuffleStudentsSelection(solver.getProperties()));
// Phase 14: use backtrack neighbour selection to fix unassignments from the previous phase
registerSelection(new BacktrackSelection(solver.getProperties()));
}
// Phase 15: random unassignment of some students
registerSelection(new RandomUnassignmentSelection(solver.getProperties()));
}