本文整理匯總了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());
}
示例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());
}
示例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();
}
示例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());
}
示例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());
}
示例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;
}
示例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;
}
示例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;
}
示例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();
}
示例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
}
示例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);
}
示例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());
}
}
示例13: setOrder
import org.sat4j.minisat.core.IOrder; //導入依賴的package包/類
public void setOrder(IOrder order) {
this.order = order;
}
示例14: RandomWalkDecorator
import org.sat4j.minisat.core.IOrder; //導入依賴的package包/類
public RandomWalkDecorator(IOrder order) {
this(order, 0.01);
}
示例15: setVariableOrderObject
import org.sat4j.minisat.core.IOrder; //導入依賴的package包/類
public void setVariableOrderObject(IOrder order) {
((Solver)satSolver).setOrder(order);
}