@Override
  public void onTurnEnded(TurnEndedEvent event) {
    IRobotSnapshot[] robots = event.getTurnSnapshot().getRobots();

    IRobotSnapshot robotA = robots[0];
    IRobotSnapshot robotB = robots[1];

    // get distance between two robots
    double distance = MathUtility.getDistance(robotA.getX(), robotA.getY(),
                                              robotB.getX(), robotB.getY());

    // if robots are within the preferred distance
    if (Math.abs(RedShift.getPreferredDistance() - distance) < RedShift.getDistanceBuffer()) {
      turnsAtPreferredDistance++;
    }
    else {
      turnsNotAtPreferredDistance++;
    }

    // robotA is RedShift
    if (robotA.getName().startsWith("tkt.RedShift")) {
      // if the other robot is alive
      if (robotB.getState().isAlive()
          // if RedShift has not hit a wall or robot and it is not moving
          && robotA.getState() == RobotState.ACTIVE && robotA.getVelocity() == 0.0) {
        this.stoppedMoving = true;
      }
    }
    // robotB is RedShift
    else {
      // if the other robot is alive
      if (robotA.getState().isAlive() && robotB.getVelocity() == 0.0
          // if RedShift has not hit a wall or robot and it is not moving
          && robotA.getState() == RobotState.ACTIVE && robotA.getVelocity() == 0.0) {
        this.stoppedMoving = true;
      }
    }
  }