コード例 #1
0
  @Test(groups = "1s", timeOut = 60000)
  public void testFalse() {
    Model model = new Model();

    IntVar var = model.intVar(12);
    SetVar setVar = model.setVar(new int[] {10}, new int[] {1, 2, 3, 4, 5, 6, 7, 8, 9, 10});
    model.member(var, setVar).post();

    assertEquals(model.getSolver().isSatisfied(), ESat.FALSE);
    assertFalse(model.getSolver().solve());
  }
コード例 #2
0
  @Test(groups = "1s", timeOut = 60000)
  public void testTrue() {
    Model model = new Model();

    int var = 10;
    SetVar setVar = model.setVar(new int[] {10}, new int[] {1, 2, 3, 4, 5, 6, 7, 8, 9, 10});
    model.member(var, setVar).post();

    assertEquals(model.getSolver().isSatisfied(), ESat.TRUE);
    checkSolutions(model, setVar, var);
  }
コード例 #3
0
  @Test(groups = "1s", timeOut = 60000)
  public void testNominal() {
    Model model = new Model();

    IntVar var = model.intVar(10);
    SetVar setVar = model.setVar(new int[] {}, new int[] {1, 2, 3, 4, 5, 6, 7, 8, 9, 10});
    model.member(var, setVar).post();

    assertEquals(model.getSolver().isSatisfied(), ESat.UNDEFINED);
    checkSolutions(model, setVar, var.getValue());
  }