use of org.logicng.testutils.NQueensGenerator in project LogicNG by logic-ng.
the class LargeBDDTest method testNumberOfNodesHandlerSmall.
@Test
public void testNumberOfNodesHandlerSmall() {
final FormulaFactory f = new FormulaFactory();
final NQueensGenerator generator = new NQueensGenerator(f);
final Formula queens = generator.generate(4);
final BDDKernel kernel = new BDDKernel(f, queens.variables().size(), 10000, 10000);
final NumberOfNodesBDDHandler handler = new NumberOfNodesBDDHandler(1000);
final BDD bdd = BDDFactory.build(queens, kernel, handler);
assertThat(handler.aborted()).isFalse();
assertThat(bdd.index()).isNotEqualTo(BDDKernel.BDD_ABORT);
}
use of org.logicng.testutils.NQueensGenerator in project LogicNG by logic-ng.
the class LargeBDDTest method testTimeoutBDDHandlerSmall.
@Test
public void testTimeoutBDDHandlerSmall() {
final FormulaFactory f = new FormulaFactory();
final NQueensGenerator generator = new NQueensGenerator(f);
final Formula queens = generator.generate(4);
final BDDKernel kernel = new BDDKernel(f, queens.variables().size(), 10000, 10000);
final TimeoutBDDHandler handler = new TimeoutBDDHandler(2000L);
final BDD bdd = BDDFactory.build(queens, kernel, handler);
assertThat(handler.aborted()).isFalse();
assertThat(bdd.index()).isNotEqualTo(BDDKernel.BDD_ABORT);
}
use of org.logicng.testutils.NQueensGenerator in project LogicNG by logic-ng.
the class LargeBDDTest method testQueens.
@Test
public void testQueens() {
final FormulaFactory f = new FormulaFactory();
final NQueensGenerator generator = new NQueensGenerator(f);
testQueens(f, generator, 4, 2);
testQueens(f, generator, 5, 10);
testQueens(f, generator, 6, 4);
testQueens(f, generator, 7, 40);
testQueens(f, generator, 8, 92);
}
use of org.logicng.testutils.NQueensGenerator in project LogicNG by logic-ng.
the class ModelCounterTest method testQueens.
@Test
public void testQueens() {
final NQueensGenerator generator = new NQueensGenerator(this.f);
testQueens(generator, 4, 2);
testQueens(generator, 5, 10);
testQueens(generator, 6, 4);
testQueens(generator, 7, 40);
testQueens(generator, 8, 92);
}
use of org.logicng.testutils.NQueensGenerator in project LogicNG by logic-ng.
the class LargeBDDTest method testNumberOfNodesHandlerLarge.
@Test
public void testNumberOfNodesHandlerLarge() {
final FormulaFactory f = new FormulaFactory();
final NQueensGenerator generator = new NQueensGenerator(f);
final Formula queens = generator.generate(10);
final BDDKernel kernel = new BDDKernel(f, queens.variables().size(), 10000, 10000);
final NumberOfNodesBDDHandler handler = new NumberOfNodesBDDHandler(5);
final BDD bdd = BDDFactory.build(queens, kernel, handler);
assertThat(handler.aborted()).isTrue();
assertThat(bdd.index()).isEqualTo(BDDKernel.BDD_ABORT);
}
Aggregations