Finished solver core
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@428 72836036-5685-4462-b002-a69064685172
This commit is contained in:
parent
d223eaaa98
commit
fc07d3bca6
3 changed files with 106 additions and 25 deletions
|
@ -16,14 +16,12 @@ public class SolverTest {
|
|||
|
||||
solver.addConstraint(new LessThan<Integer>(false, y, x));
|
||||
|
||||
int lastx = 0, lasty = 0;
|
||||
while (solver.solve()) {
|
||||
lastx = x.getValue();
|
||||
lasty = y.getValue();
|
||||
solver.record();
|
||||
solver.addConstraint(new LessThanConst<Integer>(false, x, x.getValue()));
|
||||
}
|
||||
|
||||
assertEquals(2, lastx);
|
||||
assertEquals(1, lasty);
|
||||
solver.restore();
|
||||
assertEquals(2, (int)x.getValue());
|
||||
assertEquals(1, (int)y.getValue());
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue