@Test public void testGetMisplaced() throws SchedulerException { Model mo = new DefaultModel(); VM vm1 = mo.newVM(); VM vm2 = mo.newVM(); VM vm3 = mo.newVM(); VM vm4 = mo.newVM(); VM vm5 = mo.newVM(); VM vm6 = mo.newVM(); Node n1 = mo.newNode(); Node n2 = mo.newNode(); Node n3 = mo.newNode(); mo.getMapping().on(n1, n2, n3) .run(n1, vm1) .run(n2, vm2, vm3) .run(n3, vm4, vm5, vm6); ShareableResource rcCPU = new ShareableResource("cpu", 1, 1); mo.attach(rcCPU); Overbook o1 = new Overbook(n1, "cpu", 1); Overbook o2 = new Overbook(n2, "cpu", 2); Overbook o3 = new Overbook(n3, "cpu", 3); COverbook co1 = new COverbook(o1); COverbook co2 = new COverbook(o2); COverbook co3 = new COverbook(o3); Instance i = new Instance(mo, Collections.emptyList(), new MinMTTR()); Assert.assertTrue(co1.getMisPlacedVMs(i).isEmpty()); Assert.assertTrue(co2.getMisPlacedVMs(i).isEmpty()); Assert.assertEquals(o3.getInvolvedVMs(), co3.getMisPlacedVMs(i)); }
@Override public Set<VM> getMisPlacedVMs(Instance i) { return Collections.emptySet(); }
COverbook implements ChocoConstraint { @Override public Set<VM> getMisPlacedVMs(Instance i) { return Collections.emptySet(); } }
COverbook implements ChocoConstraint { @Override public Set<VM> getMisPlacedVMs(Instance i) { return Collections.emptySet(); } COverbook(Overbook o); }
COverbook implements ChocoConstraint { @Override public Set<VM> getMisPlacedVMs(Instance i) { return Collections.emptySet(); } COverbook(Overbook o); @Override boolean inject(Parameters ps, ReconfigurationProblem rp); @Override Set<VM> getMisPlacedVMs(Instance i); @Override String toString(); }
COverbook implements ChocoConstraint { @Override public Set<VM> getMisPlacedVMs(Instance i) { return Collections.emptySet(); } COverbook(Overbook o); @Override boolean inject(Parameters ps, ReconfigurationProblem rp); @Override Set<VM> getMisPlacedVMs(Instance i); @Override String toString();  }