use of org.btrplace.model.constraint.MaxOnline in project scheduler by btrplace.
the class CMaxOnlineTest method discreteMaxOnlineTest.
@Test
public void discreteMaxOnlineTest() throws SchedulerException {
Model model = new DefaultModel();
Node n1 = model.newNode();
Node n2 = model.newNode();
Node n3 = model.newNode();
VM vm1 = model.newVM();
VM vm2 = model.newVM();
VM vm3 = model.newVM();
Mapping map = model.getMapping().on(n1, n2, n3).run(n1, vm1).run(n2, vm2).run(n3, vm3);
MappingUtils.fill(map, model.getMapping());
Set<Node> nodes = map.getAllNodes();
MaxOnline maxon = new MaxOnline(nodes, 1);
ChocoScheduler cra = new DefaultChocoScheduler();
cra.setMaxEnd(3);
// cra.setTimeLimit(3);
ReconfigurationPlan plan = cra.solve(model, Collections.singleton(maxon));
Assert.assertTrue(maxon.isSatisfied(plan.getResult()));
}
Aggregations