Package solver.explanations.antidom

Examples of solver.explanations.antidom.AntiDomBitset


    public void addMonitor(IVariableMonitor monitor) {
    }

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


        var.explain(VariableState.DOM, e);
    }

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

    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


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


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

    @Test(groups = "1s")
    public void test01() {
        Solver solver = new Solver();
        IntVar v = VariableFactory.enumerated("A", 1, 5, solver);
        AntiDomain ad = new AntiDomBitset(v);
        Assert.assertFalse(ad.get(1));
        Assert.assertFalse(ad.get(2));
        Assert.assertFalse(ad.get(3));
        Assert.assertFalse(ad.get(4));
        Assert.assertFalse(ad.get(5));
        solver.getEnvironment().worldPush();
        ad.add(1);
        ad.add(5);
        Assert.assertTrue(ad.get(1));
        Assert.assertFalse(ad.get(2));
        Assert.assertFalse(ad.get(3));
        Assert.assertFalse(ad.get(4));
        Assert.assertTrue(ad.get(5));
        solver.getEnvironment().worldPush();
        ad.add(3);
        DisposableValueIterator values = ad.getValueIterator();
        while (values.hasNext()) {
            Assert.assertTrue(ad.get(values.next()));
        }
        Assert.assertTrue(ad.get(1));
        Assert.assertFalse(ad.get(2));
        Assert.assertTrue(ad.get(3));
        Assert.assertFalse(ad.get(4));
        Assert.assertTrue(ad.get(5));
        solver.getEnvironment().worldPop();
        Assert.assertTrue(ad.get(1));
        Assert.assertFalse(ad.get(2));
        Assert.assertFalse(ad.get(3));
        Assert.assertFalse(ad.get(4));
        Assert.assertTrue(ad.get(5));
        solver.getEnvironment().worldPop();
        Assert.assertFalse(ad.get(1));
        Assert.assertFalse(ad.get(2));
        Assert.assertFalse(ad.get(3));
        Assert.assertFalse(ad.get(4));
        Assert.assertFalse(ad.get(5));
    }
View Full Code Here

TOP

Related Classes of solver.explanations.antidom.AntiDomBitset

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.