Search in sources :

Example 6 with Online

use of org.btrplace.model.constraint.Online in project scheduler by btrplace.

the class COnlineTest method testInstantiation.

@Test
public void testInstantiation() {
    Model mo = new DefaultModel();
    Node n1 = mo.newNode();
    Online on = new Online(n1);
    COnline con = new COnline(on);
    Assert.assertEquals(con.toString(), on.toString());
}
Also used : DefaultModel(org.btrplace.model.DefaultModel) Node(org.btrplace.model.Node) Model(org.btrplace.model.Model) DefaultModel(org.btrplace.model.DefaultModel) Online(org.btrplace.model.constraint.Online) Test(org.testng.annotations.Test)

Example 7 with Online

use of org.btrplace.model.constraint.Online in project scheduler by btrplace.

the class COnlineTest method testSolvableProblem.

@Test
public void testSolvableProblem() throws SchedulerException {
    Model mo = new DefaultModel();
    Node n1 = mo.newNode();
    mo.getMapping().off(n1);
    ChocoScheduler cra = new DefaultChocoScheduler();
    ReconfigurationPlan plan = cra.solve(mo, Collections.singleton(new Online(n1)));
    Assert.assertNotNull(plan);
    Model res = plan.getResult();
    Assert.assertTrue(res.getMapping().isOnline(n1));
}
Also used : DefaultModel(org.btrplace.model.DefaultModel) DefaultChocoScheduler(org.btrplace.scheduler.choco.DefaultChocoScheduler) ChocoScheduler(org.btrplace.scheduler.choco.ChocoScheduler) DefaultChocoScheduler(org.btrplace.scheduler.choco.DefaultChocoScheduler) Node(org.btrplace.model.Node) ReconfigurationPlan(org.btrplace.plan.ReconfigurationPlan) Model(org.btrplace.model.Model) DefaultModel(org.btrplace.model.DefaultModel) Online(org.btrplace.model.constraint.Online) Test(org.testng.annotations.Test)

Aggregations

Online (org.btrplace.model.constraint.Online)7 Test (org.testng.annotations.Test)7 DefaultModel (org.btrplace.model.DefaultModel)5 Model (org.btrplace.model.Model)5 Node (org.btrplace.model.Node)4 ReconfigurationPlan (org.btrplace.plan.ReconfigurationPlan)4 ChocoScheduler (org.btrplace.scheduler.choco.ChocoScheduler)3 DefaultChocoScheduler (org.btrplace.scheduler.choco.DefaultChocoScheduler)3 MaxOnline (org.btrplace.model.constraint.MaxOnline)2 SatConstraint (org.btrplace.model.constraint.SatConstraint)2 ShareableResource (org.btrplace.model.view.ShareableResource)2 TIntIntHashMap (gnu.trove.map.hash.TIntIntHashMap)1 ArrayList (java.util.ArrayList)1 HashSet (java.util.HashSet)1 Instance (org.btrplace.model.Instance)1 VM (org.btrplace.model.VM)1 MinMTTR (org.btrplace.model.constraint.MinMTTR)1 Preserve (org.btrplace.model.constraint.Preserve)1 Ready (org.btrplace.model.constraint.Ready)1 Running (org.btrplace.model.constraint.Running)1