@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); }
@Override public void configureSearch() { solver.set(new AssignmentInterval(vars, new Cyclic(vars), new RealDomainMiddle())); SearchMonitorFactory.limitTime(solver, 10000); }