Package aima.core.search.csp

Examples of aima.core.search.csp.CSP.addConstraint()


  }

  @Test
  public void testConstraintNetwork() {
    CSP csp = new CSP(variables);
    csp.addConstraint(C1);
    csp.addConstraint(C2);
    Assert.assertNotNull(csp.getConstraints());
    Assert.assertEquals(2, csp.getConstraints().size());
    Assert.assertNotNull(csp.getConstraints(X));
    Assert.assertEquals(2, csp.getConstraints(X).size());
View Full Code Here


  @Test
  public void testConstraintNetwork() {
    CSP csp = new CSP(variables);
    csp.addConstraint(C1);
    csp.addConstraint(C2);
    Assert.assertNotNull(csp.getConstraints());
    Assert.assertEquals(2, csp.getConstraints().size());
    Assert.assertNotNull(csp.getConstraints(X));
    Assert.assertEquals(2, csp.getConstraints(X).size());
    Assert.assertNotNull(csp.getConstraints(Y));
View Full Code Here

  public void testDomainChanges() {
    Domain colors2 = new Domain(colors.asList());
    Assert.assertEquals(colors, colors2);

    CSP csp = new CSP(variables);
    csp.addConstraint(C1);
    Assert.assertNotNull(csp.getDomain(X));
    Assert.assertEquals(0, csp.getDomain(X).size());
    Assert.assertNotNull(csp.getConstraints(X));

    csp.setDomain(X, colors);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.