@Test public void testGetMisplaced() { Model mo = new DefaultModel(); VM vm1 = mo.newVM(); VM vm2 = mo.newVM(); Node n1 = mo.newNode(); Node n2 = mo.newNode(); Mapping map = mo.getMapping().ready(vm1).on(n1, n2).run(n2, vm2); Instance i = new Instance(mo, Collections.emptyList(), new MinMTTR()); Gather g = new Gather(map.getAllVMs()); CGather c = new CGather(g); Assert.assertTrue(c.getMisPlacedVMs(i).isEmpty()); map.addRunningVM(vm1, n2); Assert.assertTrue(c.getMisPlacedVMs(i).isEmpty()); map.addRunningVM(vm1, n1); Assert.assertEquals(c.getMisPlacedVMs(i), map.getAllVMs()); }
@Override public Set<VM> getMisPlacedVMs(Instance i) { if (!cstr.isSatisfied(i.getModel())) { return new HashSet<>(cstr.getInvolvedVMs()); } return Collections.emptySet(); }
CGather implements ChocoConstraint { @Override public Set<VM> getMisPlacedVMs(Instance i) { if (!cstr.isSatisfied(i.getModel())) { return new HashSet<>(cstr.getInvolvedVMs()); } return Collections.emptySet(); } }
CGather implements ChocoConstraint { @Override public Set<VM> getMisPlacedVMs(Instance i) { if (!cstr.isSatisfied(i.getModel())) { return new HashSet<>(cstr.getInvolvedVMs()); } return Collections.emptySet(); } CGather(Gather g); }
CGather implements ChocoConstraint { @Override public Set<VM> getMisPlacedVMs(Instance i) { if (!cstr.isSatisfied(i.getModel())) { return new HashSet<>(cstr.getInvolvedVMs()); } return Collections.emptySet(); } CGather(Gather g); @Override boolean inject(Parameters ps, ReconfigurationProblem rp); @Override String toString(); @Override Set<VM> getMisPlacedVMs(Instance i); }
CGather implements ChocoConstraint { @Override public Set<VM> getMisPlacedVMs(Instance i) { if (!cstr.isSatisfied(i.getModel())) { return new HashSet<>(cstr.getInvolvedVMs()); } return Collections.emptySet(); } CGather(Gather g); @Override boolean inject(Parameters ps, ReconfigurationProblem rp); @Override String toString(); @Override Set<VM> getMisPlacedVMs(Instance i);  }