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


Java IOrder類代碼示例

本文整理匯總了Java中org.sat4j.minisat.core.IOrder的典型用法代碼示例。如果您正苦於以下問題:Java IOrder類的具體用法?Java IOrder怎麽用?Java IOrder使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


IOrder類屬於org.sat4j.minisat.core包,在下文中一共展示了IOrder類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: test

import org.sat4j.minisat.core.IOrder; //導入依賴的package包/類
@Test
public void test() throws ContradictionException, TimeoutException {
    Solver<DataStructureFactory> solver = SolverFactory.newGlucose();
    int[] backdoor = { 1, 2, 3 };
    IOrder order = new SubsetVarOrder(backdoor);
    solver.setOrder(order);
    IVecInt clause = new VecInt();
    clause.push(1).push(4);
    solver.addClause(clause);
    clause = new VecInt();
    clause.push(2).push(5);
    solver.addClause(clause);
    clause = new VecInt();
    clause.push(3).push(6);
    solver.addClause(clause);
    assertTrue(solver.isSatisfiable());
}
 
開發者ID:TakehideSoh,項目名稱:Scarab,代碼行數:18,代碼來源:BugSAT50.java

示例2: test2

import org.sat4j.minisat.core.IOrder; //導入依賴的package包/類
@Test
public void test2() throws ContradictionException, TimeoutException {
    Solver<DataStructureFactory> solver = SolverFactory.newGlucose();
    int[] backdoor = { 1, 2, 3 };
    IOrder order = new SubsetVarOrder(backdoor);
    solver.setOrder(order);
    IVecInt clause = new VecInt();
    clause.push(-1).push(4);
    solver.addClause(clause);
    clause = new VecInt();
    clause.push(-2).push(5);
    solver.addClause(clause);
    clause = new VecInt();
    clause.push(-3).push(6);
    solver.addClause(clause);
    assertTrue(solver.isSatisfiable());
}
 
開發者ID:TakehideSoh,項目名稱:Scarab,代碼行數:18,代碼來源:BugSAT50.java

示例3: test3

import org.sat4j.minisat.core.IOrder; //導入依賴的package包/類
@Test(expected = TimeoutException.class)
public void test3() throws ContradictionException, TimeoutException {
    Solver<DataStructureFactory> solver = SolverFactory.newGlucose();
    solver.setSearchListener(new TextOutputTracing<Object>(null));
    int[] backdoor = { 1, 2, 3 };
    IOrder order = new SubsetVarOrder(backdoor);
    solver.setOrder(order);
    IVecInt clause = new VecInt();
    clause.push(-1).push(4).push(7);
    solver.addClause(clause);
    clause = new VecInt();
    clause.push(-2).push(5).push(7);
    solver.addClause(clause);
    clause = new VecInt();
    clause.push(-3).push(6).push(5);
    solver.addClause(clause);
    clause = new VecInt();
    clause.push(1).push(2).push(3).push(7).push(8);
    solver.addClause(clause);
    solver.isSatisfiable();
}
 
開發者ID:TakehideSoh,項目名稱:Scarab,代碼行數:22,代碼來源:BugSAT50.java

示例4: testJeanGuy1

import org.sat4j.minisat.core.IOrder; //導入依賴的package包/類
@Test
public void testJeanGuy1() throws ContradictionException, TimeoutException {
    Solver<DataStructureFactory> solver = SolverFactory.newGlucose();
    int[] backdoor = { 1, 2, 3, 4 };
    IOrder order = new SubsetVarOrder(backdoor);
    solver.setOrder(order);
    IVecInt clause = new VecInt();
    clause.push(-1).push(5);
    solver.addClause(clause);
    clause = new VecInt();
    clause.push(-2).push(3).push(5);
    solver.addClause(clause);
    clause = new VecInt();
    clause.push(-4).push(5);
    solver.addClause(clause);
    assertTrue(solver.isSatisfiable());
}
 
開發者ID:TakehideSoh,項目名稱:Scarab,代碼行數:18,代碼來源:BugSAT50.java

示例5: testJeanGuy2

import org.sat4j.minisat.core.IOrder; //導入依賴的package包/類
@Test
public void testJeanGuy2() throws ContradictionException, TimeoutException {
    Solver<DataStructureFactory> solver = SolverFactory.newGlucose();
    int[] backdoor = { 5 };
    IOrder order = new SubsetVarOrder(backdoor);
    solver.setOrder(order);
    IVecInt clause = new VecInt();
    clause.push(-1).push(5);
    solver.addClause(clause);
    clause = new VecInt();
    clause.push(-2).push(3).push(5);
    solver.addClause(clause);
    clause = new VecInt();
    clause.push(-4).push(5);
    solver.addClause(clause);
    assertTrue(solver.isSatisfiable());
}
 
開發者ID:TakehideSoh,項目名稱:Scarab,代碼行數:18,代碼來源:BugSAT50.java

示例6: newPBCP

import org.sat4j.minisat.core.IOrder; //導入依賴的package包/類
private static PBSolverCP newPBCP(PBDataStructureFactory dsf, IOrder order,
        boolean noRemove) {
    MiniSATLearning<PBDataStructureFactory> learning = new MiniSATLearning<PBDataStructureFactory>();
    PBSolverCP solver = new PBSolverCP(learning, dsf, order, noRemove);
    learning.setDataStructureFactory(solver.getDSFactory());
    learning.setVarActivityListener(solver);
    solver.setRestartStrategy(new ArminRestarts());
    solver.setLearnedConstraintsDeletionStrategy(solver.lbd_based);
    return solver;
}
 
開發者ID:TakehideSoh,項目名稱:Scarab,代碼行數:11,代碼來源:SolverFactory.java

示例7: newPBCPStar

import org.sat4j.minisat.core.IOrder; //導入依賴的package包/類
private static PBSolverCP newPBCPStar(PBDataStructureFactory dsf,
        IOrder order, boolean noRemove) {
    MiniSATLearning<PBDataStructureFactory> learning = new MiniSATLearning<PBDataStructureFactory>();
    PBSolverCP solver = new PBSolverCPLong(learning, dsf, order, noRemove);
    // PBSolverCP solver = new PBSolverCautious(learning, dsf, order,
    // PBSolverCautious.BOUND);
    learning.setDataStructureFactory(solver.getDSFactory());
    learning.setVarActivityListener(solver);
    solver.setRestartStrategy(new ArminRestarts());
    solver.setLearnedConstraintsDeletionStrategy(solver.lbd_based);
    return solver;
}
 
開發者ID:TakehideSoh,項目名稱:Scarab,代碼行數:13,代碼來源:SolverFactory.java

示例8: newPBCPStarReduceToCard

import org.sat4j.minisat.core.IOrder; //導入依賴的package包/類
private static PBSolverCP newPBCPStarReduceToCard(
        PBDataStructureFactory dsf, IOrder order, boolean noRemove) {
    MiniSATLearning<PBDataStructureFactory> learning = new MiniSATLearning<PBDataStructureFactory>();
    PBSolverCP solver = new PBSolverCPLongReduceToCard(learning, dsf,
            order, noRemove);
    learning.setDataStructureFactory(solver.getDSFactory());
    learning.setVarActivityListener(solver);
    solver.setRestartStrategy(new ArminRestarts());
    solver.setLearnedConstraintsDeletionStrategy(solver.lbd_based);
    return solver;
}
 
開發者ID:TakehideSoh,項目名稱:Scarab,代碼行數:12,代碼來源:SolverFactory.java

示例9: InprocCardConstrLearningSolver

import org.sat4j.minisat.core.IOrder; //導入依賴的package包/類
public InprocCardConstrLearningSolver(
        LearningStrategy<PBDataStructureFactory> learner,
        PBDataStructureFactory dsf, IOrder order, boolean noRemove) {
    super(learner, dsf, order, noRemove);
    this.coSolver = SolverFactory.newResolution();
    this.cardFinder = new CardConstrFinder(this.coSolver);
    configureSolver();
}
 
開發者ID:TakehideSoh,項目名稱:Scarab,代碼行數:9,代碼來源:InprocCardConstrLearningSolver.java

示例10: PBSolverCPLongReduceToCard

import org.sat4j.minisat.core.IOrder; //導入依賴的package包/類
public PBSolverCPLongReduceToCard(
        LearningStrategy<PBDataStructureFactory> learner,
        PBDataStructureFactory dsf, SearchParams params, IOrder order,
        RestartStrategy restarter) {
    super(learner, dsf, params, order, restarter);
    // TODO Auto-generated constructor stub
}
 
開發者ID:TakehideSoh,項目名稱:Scarab,代碼行數:8,代碼來源:PBSolverCPLongReduceToCard.java

示例11: PBSolver

import org.sat4j.minisat.core.IOrder; //導入依賴的package包/類
public PBSolver(LearningStrategy<PBDataStructureFactory> learner,
        PBDataStructureFactory dsf, SearchParams params, IOrder order,
        RestartStrategy restarter) {
    super(learner, dsf, params, order, restarter);
    this.stats = new PBSolverStats();
    initStats(this.stats);
}
 
開發者ID:TakehideSoh,項目名稱:Scarab,代碼行數:8,代碼來源:PBSolver.java

示例12: setObjectiveFunction

import org.sat4j.minisat.core.IOrder; //導入依賴的package包/類
public void setObjectiveFunction(ObjectiveFunction obj) {
    this.objf = obj;
    IOrder order = getOrder();
    if (order instanceof IOrderObjective) {
        ((IOrderObjective) order).setObjectiveFunction(obj);
    }
    // register literals only visible in the objective function (see
    // SAT-130)
    if (obj != null) {
        dimacs2internal(obj.getVars());
    }
}
 
開發者ID:TakehideSoh,項目名稱:Scarab,代碼行數:13,代碼來源:PBSolver.java

示例13: setOrder

import org.sat4j.minisat.core.IOrder; //導入依賴的package包/類
public void setOrder(IOrder order) {
	this.order = order;
}
 
開發者ID:axel-halin,項目名稱:Thesis-JHipster,代碼行數:4,代碼來源:ActiveLearning.java

示例14: RandomWalkDecorator

import org.sat4j.minisat.core.IOrder; //導入依賴的package包/類
public RandomWalkDecorator(IOrder order) {
	this(order, 0.01);
}
 
開發者ID:axel-halin,項目名稱:Thesis-JHipster,代碼行數:4,代碼來源:RandomWalkDecorator.java

示例15: setVariableOrderObject

import org.sat4j.minisat.core.IOrder; //導入依賴的package包/類
public void setVariableOrderObject(IOrder order) {
	((Solver)satSolver).setOrder(order);
}
 
開發者ID:axel-halin,項目名稱:Thesis-JHipster,代碼行數:4,代碼來源:ReasoningWithSAT.java


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