本文整理汇总了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);
}