Package solver.explanations.antidom

Examples of solver.explanations.antidom.AntiDomInterval


    }
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

    @Override
    public AntiDomain antiDomain() {
        return new AntiDomInterval(this);
    }
View Full Code Here


    @Test(groups = "1s")
    public void test02() {
        Solver solver = new Solver();
        IntVar v = VariableFactory.enumerated("A", 1, 10, solver);
        AntiDomain ad = new AntiDomInterval(v);
        for (int i = 1; i < 11; i++) {
            Assert.assertFalse(ad.get(i));
        }
        solver.getEnvironment().worldPush();
        ad.updateLowerBound(1, 4);
        ad.updateLowerBound(4, 5);
        ad.updateUpperBound(10, 7);
        Assert.assertTrue(ad.get(1));
        Assert.assertTrue(ad.get(2));
        Assert.assertTrue(ad.get(3));
        Assert.assertTrue(ad.get(4));
        Assert.assertFalse(ad.get(5));
        Assert.assertFalse(ad.get(6));
        Assert.assertFalse(ad.get(7));
        Assert.assertTrue(ad.get(8));
        Assert.assertTrue(ad.get(9));
        Assert.assertTrue(ad.get(10));
        solver.getEnvironment().worldPush();
        DisposableValueIterator values = ad.getValueIterator();
        while (values.hasNext()) {
            Assert.assertTrue(ad.get(values.next()));
        }
        solver.getEnvironment().worldPop();
        Assert.assertTrue(ad.get(1));
        Assert.assertTrue(ad.get(2));
        Assert.assertTrue(ad.get(3));
        Assert.assertTrue(ad.get(4));
        Assert.assertFalse(ad.get(5));
        Assert.assertFalse(ad.get(6));
        Assert.assertFalse(ad.get(7));
        Assert.assertTrue(ad.get(8));
        Assert.assertTrue(ad.get(9));
        Assert.assertTrue(ad.get(10));
        solver.getEnvironment().worldPop();
        for (int i = 1; i < 11; i++) {
            Assert.assertFalse(ad.get(i));
        }
    }
View Full Code Here

TOP

Related Classes of solver.explanations.antidom.AntiDomInterval

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.