code: public static boolean canStay(ReconfigurationProblem rp, VM vm) {
          Mapping m = rp.getSourceModel().getMapping();
          if (m.isRunning(vm)) {
              int curPos = rp.getNode(m.getVMLocation(vm));
              return rp.getVMAction(vm).getDSlice().getHoster().contains(curPos);
          }
          return false;
      }
docs: Check if a VM can stay on its current node.
  
  @param rp the reconfiguration problem.
  @param vm the VM
  @return {@code true} iff the VM can stay