@Test public void testVMsToKill() 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(); Mapping map = mo.getMapping(); map.addOnlineNode(n1); map.addOnlineNode(n2); map.addOfflineNode(n3); map.addRunningVM(vm1, n1); map.addRunningVM(vm2, n1); map.addRunningVM(vm3, n2); map.addSleepingVM(vm4, n2); map.addReadyVM(vm5); map.addReadyVM(vm6); Mapping m = mo.getMapping(); m.addOnlineNode(n1); m.addRunningVM(vm1, n1); m.addSleepingVM(vm2, n1); m.addReadyVM(vm3); DefaultReconfigurationProblem rp = new DefaultReconfigurationProblemBuilder(mo) .setNextVMsStates(new HashSet<>(), new HashSet<>(), new HashSet<>(), m.getAllVMs()).build(); for (VMTransition a : rp.getVMActions()) { Assert.assertEquals(a.getClass(), KillVM.class); } }
@Override public List<VMTransition> getVMActions() { return vmActions; }
DefaultReconfigurationProblem implements ReconfigurationProblem { @Override public List<VMTransition> getVMActions() { return vmActions; } }
DefaultReconfigurationProblem implements ReconfigurationProblem { @Override public List<VMTransition> getVMActions() { return vmActions; } DefaultReconfigurationProblem(Model m,
                                  Parameters ps,
                                  Set<VM> ready,
                                  Set<VM> running,
                                  Set<VM> sleeping,
                                  Set<VM> killed,
                                  Set<VM> preRooted); }
DefaultReconfigurationProblem implements ReconfigurationProblem { @Override public List<VMTransition> getVMActions() { return vmActions; } DefaultReconfigurationProblem(Model m,
                                  Parameters ps,
                                  Set<VM> ready,
                                  Set<VM> running,
                                  Set<VM> sleeping,
                                  Set<VM> killed,
                                  Set<VM> preRooted); @Override ReconfigurationPlan solve(int timeLimit, boolean optimize); @Override List<ReconfigurationPlan> getComputedSolutions(); @Override @SuppressWarnings("squid:S3346") ReconfigurationPlan buildReconfigurationPlan(Solution s, Model src); @Override final VMState getFutureState(VM v); @Override VMState getSourceState(VM v); @Override NodeState getSourceState(Node n); @Override int getCurrentVMLocation(int vmIdx); @Override List<IntVar> getNbRunningVMs(); @Override final ChocoView getView(String id); @Override Collection<String> getViews(); @Override boolean addView(ChocoView v); @Override Solver getSolver(); @Override org.chocosolver.solver.Model getModel(); @Override IntVar makeHostVariable(Object... n); @Override IntVar makeCurrentHost(VM vmId, Object... n); @Override IntVar makeCurrentNode(Node nId, Object... n); @Override IntVar makeUnboundedDuration(Object... n); @Override IntVar makeDuration(int ub, int lb, Object... n); @Override final String makeVarLabel(Object... lbl); @Override IntVar fixed(int v, Object... lbl); @Override Set<VM> getManageableVMs(); @Override Logger getLogger(); @Override List<NodeTransition> getNodeActions(); @Override DurationEvaluators getDurationEvaluators(); @Override List<Node> getNodes(); @Override List<VM> getVMs(); @Override Model getSourceModel(); @Override Set<VM> getFutureRunningVMs(); @Override Set<VM> getFutureReadyVMs(); @Override Set<VM> getFutureSleepingVMs(); @Override Set<VM> getFutureKilledVMs(); @Override IntVar getStart(); @Override IntVar getEnd(); @Override int getVM(VM vm); @Override VM getVM(int idx); @Override int getNode(Node n); @Override Node getNode(int idx); @Override List<VMTransition> getVMActions(); @Override List<VMTransition> getVMActions(Collection<VM> ids); @Override VMTransition getVMAction(VM id); @Override NodeTransition getNodeAction(Node id); @Override VM cloneVM(VM vm); @Override IntVar getObjective(); @Override void setObjective(boolean b, IntVar v); @Override ResolutionPolicy getResolutionPolicy(); @Override void stop(); }
DefaultReconfigurationProblem implements ReconfigurationProblem { @Override public List<VMTransition> getVMActions() { return vmActions; } DefaultReconfigurationProblem(Model m,
                                  Parameters ps,
                                  Set<VM> ready,
                                  Set<VM> running,
                                  Set<VM> sleeping,
                                  Set<VM> killed,
                                  Set<VM> preRooted); @Override ReconfigurationPlan solve(int timeLimit, boolean optimize); @Override List<ReconfigurationPlan> getComputedSolutions(); @Override @SuppressWarnings("squid:S3346") ReconfigurationPlan buildReconfigurationPlan(Solution s, Model src); @Override final VMState getFutureState(VM v); @Override VMState getSourceState(VM v); @Override NodeState getSourceState(Node n); @Override int getCurrentVMLocation(int vmIdx); @Override List<IntVar> getNbRunningVMs(); @Override final ChocoView getView(String id); @Override Collection<String> getViews(); @Override boolean addView(ChocoView v); @Override Solver getSolver(); @Override org.chocosolver.solver.Model getModel(); @Override IntVar makeHostVariable(Object... n); @Override IntVar makeCurrentHost(VM vmId, Object... n); @Override IntVar makeCurrentNode(Node nId, Object... n); @Override IntVar makeUnboundedDuration(Object... n); @Override IntVar makeDuration(int ub, int lb, Object... n); @Override final String makeVarLabel(Object... lbl); @Override IntVar fixed(int v, Object... lbl); @Override Set<VM> getManageableVMs(); @Override Logger getLogger(); @Override List<NodeTransition> getNodeActions(); @Override DurationEvaluators getDurationEvaluators(); @Override List<Node> getNodes(); @Override List<VM> getVMs(); @Override Model getSourceModel(); @Override Set<VM> getFutureRunningVMs(); @Override Set<VM> getFutureReadyVMs(); @Override Set<VM> getFutureSleepingVMs(); @Override Set<VM> getFutureKilledVMs(); @Override IntVar getStart(); @Override IntVar getEnd(); @Override int getVM(VM vm); @Override VM getVM(int idx); @Override int getNode(Node n); @Override Node getNode(int idx); @Override List<VMTransition> getVMActions(); @Override List<VMTransition> getVMActions(Collection<VM> ids); @Override VMTransition getVMAction(VM id); @Override NodeTransition getNodeAction(Node id); @Override VM cloneVM(VM vm); @Override IntVar getObjective(); @Override void setObjective(boolean b, IntVar v); @Override ResolutionPolicy getResolutionPolicy(); @Override void stop();  }