示例#1
0
 @Test(groups = "1s")
 public void testTime() {
   Solver s = modelit();
   long tl = 500;
   SearchMonitorFactory.limitTime(s, tl);
   s.findAllSolutions();
   float tc = s.getMeasures().getTimeCount();
   Assert.assertTrue(tl - (tl * 5 / 100) <= tc && tc <= tl + (tl * 5 / 100), tl + " vs. " + tc);
 }
示例#2
0
 @Override
 public void configureSearch() {
   solver.set(new AssignmentInterval(vars, new Cyclic(vars), new RealDomainMiddle()));
   SearchMonitorFactory.limitTime(solver, 10000);
 }