Exemplo n.º 1
0
 @Test(groups = "1s")
 public void testBacktrack() {
   Solver s = modelit();
   long bl = 50;
   SearchMonitorFactory.limitBacktrack(s, bl);
   s.findAllSolutions();
   long bc = s.getMeasures().getBackTrackCount();
   Assert.assertEquals(bc, bl);
 }
Exemplo n.º 2
0
 @Test(groups = "1s")
 public void testNode() {
   Solver s = modelit();
   long nl = 50;
   SearchMonitorFactory.limitNode(s, nl);
   s.findAllSolutions();
   long nc = s.getMeasures().getNodeCount();
   Assert.assertEquals(nc, nl);
 }
Exemplo n.º 3
0
 @Test(groups = "1s")
 public void testThreadTime() {
   Solver s = modelit();
   long tl = 500;
   SearchMonitorFactory.limitThreadTime(s, tl);
   s.findAllSolutions();
   float tc = s.getMeasures().getTimeCount();
   Assert.assertTrue(tl - (tl * 10 / 100) <= tc && tc <= tl + (tl * 10 / 100), tl + " vs. " + tc);
 }
Exemplo n.º 4
0
 @Test(groups = "1s")
 public void testSolution() {
   Solver s = modelit();
   long sl = 50;
   SearchMonitorFactory.limitSolution(s, sl);
   s.findAllSolutions();
   long sc = s.getMeasures().getSolutionCount();
   Assert.assertEquals(sc, sl);
 }
Exemplo n.º 5
0
 @Test(groups = "1s")
 public void testFail() {
   Solver s = modelit();
   long fl = 50;
   SearchMonitorFactory.limitFail(s, fl);
   s.findAllSolutions();
   long fc = s.getMeasures().getFailCount();
   Assert.assertEquals(fc, fl);
 }
Exemplo n.º 6
0
 @Override
 public void configureSearch() {
   solver.set(new AssignmentInterval(vars, new Cyclic(vars), new RealDomainMiddle()));
   SearchMonitorFactory.limitTime(solver, 10000);
 }