Search in sources :

Example 16 with BoolVar

use of org.chocosolver.solver.variables.BoolVar in project scheduler by btrplace.

the class FastIFFEqTest method test6.

@Test
public void test6() {
    Model csp = new Model();
    BoolVar b = csp.boolVar(false);
    IntVar x = csp.intVar("x", 0, 3, true);
    int c = 2;
    csp.post(new FastIFFEq(b, x, c));
    Assert.assertEquals(3, csp.getSolver().findAllSolutions().size());
}
Also used : Model(org.chocosolver.solver.Model) IntVar(org.chocosolver.solver.variables.IntVar) BoolVar(org.chocosolver.solver.variables.BoolVar) Test(org.testng.annotations.Test)

Example 17 with BoolVar

use of org.chocosolver.solver.variables.BoolVar in project scheduler by btrplace.

the class FastIFFEqTest method test3.

@Test
public void test3() {
    Model csp = new Model();
    BoolVar b = csp.boolVar("b");
    IntVar x = csp.intVar("x", 0, 2, true);
    int c = 3;
    csp.post(new FastIFFEq(b, x, c));
    Assert.assertEquals(3, csp.getSolver().findAllSolutions().size());
}
Also used : Model(org.chocosolver.solver.Model) IntVar(org.chocosolver.solver.variables.IntVar) BoolVar(org.chocosolver.solver.variables.BoolVar) Test(org.testng.annotations.Test)

Example 18 with BoolVar

use of org.chocosolver.solver.variables.BoolVar in project scheduler by btrplace.

the class FastImpliesEqTest method test2.

@Test
public void test2() {
    Model s = new Model();
    BoolVar b = s.boolVar("b");
    IntVar x = s.intVar("x", 0, 3, false);
    int c = 2;
    s.post(new FastImpliesEq(b, x, c));
    Assert.assertEquals(5, s.getSolver().findAllSolutions().size());
}
Also used : Model(org.chocosolver.solver.Model) IntVar(org.chocosolver.solver.variables.IntVar) BoolVar(org.chocosolver.solver.variables.BoolVar) Test(org.testng.annotations.Test)

Example 19 with BoolVar

use of org.chocosolver.solver.variables.BoolVar in project scheduler by btrplace.

the class FastImpliesEqTest method test5.

@Test
public void test5() {
    Model s = new Model();
    BoolVar b = s.boolVar(true);
    IntVar x = s.intVar("x", 0, 3, true);
    int c = 2;
    s.post(new FastImpliesEq(b, x, c));
    Assert.assertEquals(1, s.getSolver().findAllSolutions().size());
}
Also used : Model(org.chocosolver.solver.Model) IntVar(org.chocosolver.solver.variables.IntVar) BoolVar(org.chocosolver.solver.variables.BoolVar) Test(org.testng.annotations.Test)

Example 20 with BoolVar

use of org.chocosolver.solver.variables.BoolVar in project scheduler by btrplace.

the class FastImpliesEqTest method test3.

@Test
public void test3() {
    Model s = new Model();
    BoolVar b = s.boolVar("b");
    IntVar x = s.intVar("x", 0, 2, true);
    int c = 3;
    s.post(new FastImpliesEq(b, x, c));
    Assert.assertEquals(3, s.getSolver().findAllSolutions().size());
}
Also used : Model(org.chocosolver.solver.Model) IntVar(org.chocosolver.solver.variables.IntVar) BoolVar(org.chocosolver.solver.variables.BoolVar) Test(org.testng.annotations.Test)

Aggregations

BoolVar (org.chocosolver.solver.variables.BoolVar)22 Model (org.chocosolver.solver.Model)17 IntVar (org.chocosolver.solver.variables.IntVar)17 Test (org.testng.annotations.Test)16 VM (org.btrplace.model.VM)4 Constraint (org.chocosolver.solver.constraints.Constraint)4 DefaultModel (org.btrplace.model.DefaultModel)2 Mapping (org.btrplace.model.Mapping)2 Model (org.btrplace.model.Model)2 Node (org.btrplace.model.Node)2 OptConstraint (org.btrplace.model.constraint.OptConstraint)2 SatConstraint (org.btrplace.model.constraint.SatConstraint)2 ReconfigurationPlan (org.btrplace.plan.ReconfigurationPlan)2 Slice (org.btrplace.scheduler.choco.Slice)2 VMTransition (org.btrplace.scheduler.choco.transition.VMTransition)2 ShareableResource (org.btrplace.model.view.ShareableResource)1 CMinMTTR (org.btrplace.scheduler.choco.constraint.mttr.CMinMTTR)1 KeepRunningVM (org.btrplace.scheduler.choco.transition.KeepRunningVM)1 RelocatableVM (org.btrplace.scheduler.choco.transition.RelocatableVM)1 ContradictionException (org.chocosolver.solver.exception.ContradictionException)1