code: public int canStay(ReconfigurationProblem rp, VM vm) {
          Mapping m = rp.getSourceModel().getMapping();
          if (m.isRunning(vm)) {
              Node n = m.getVMLocation(vm);
              int curPos = nodeMap[n.id()];
              if (actionMap[vm.id()].getDSlice().getHoster().contains(curPos)) {
                  return curPos;
              }
          }
          return -1;
      }
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