當前位置: 首頁>>代碼示例>>Java>>正文


Java Solver.getProperties方法代碼示例

本文整理匯總了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());
}
 
開發者ID:UniTime,項目名稱:cpsolver,代碼行數:17,代碼來源:SimpleSearch.java

示例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());
}
 
開發者ID:UniTime,項目名稱:cpsolver,代碼行數:15,代碼來源:BacktrackSelection.java

示例3: NeighbourSelectionWithSuggestions

import org.cpsolver.ifs.solver.Solver; //導入方法依賴的package包/類
public NeighbourSelectionWithSuggestions(Solver<Lecture, Placement> solver) throws Exception {
    this(solver.getProperties());
    init(solver);
}
 
開發者ID:UniTime,項目名稱:cpsolver,代碼行數:5,代碼來源:NeighbourSelectionWithSuggestions.java

示例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()));
}
 
開發者ID:UniTime,項目名稱:cpsolver,代碼行數:60,代碼來源:StudentSctNeighbourSelection.java


注:本文中的org.cpsolver.ifs.solver.Solver.getProperties方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。