public void run() {
			try {
				// Record the current time.
				long time = System.currentTimeMillis();

				// Activate brain.
				Move move;
				try {
					move = brain.getMove(getBoard().clone());
				} catch (RuntimeException e) {
					Core.LOGGER.log(Level.WARNING, brain.getName()
							+ " threw an unchecked Exception", e);
					showError(brain.getName() + " threw an error",
							"An error occurred while " + brain.getName()
									+ " was computing its\nmove. "
									+ "Please select a different brain for "
									+ getBoard().getTurn() + ".");
					return;
				}

				// Check whether move is valid.
				if (move == null || !move.isLegal(getBoard())) {
					if (move == null) {
						Core.LOGGER.log(Level.WARNING, brain.getName()
								+ " returned a null move.");
					} else {
						Core.LOGGER.log(Level.WARNING, brain.getName()
								+ " returned illegal move " + move + ".");
					}
					showError(brain.getName() + " suggested illegal move",
							brain.getName()
									+ " suggested a move that is illegal in "
									+ "the current\nsituation. Please "
									+ "select a different brain for "
									+ getBoard().getTurn() + ".");
					return;
				}

				// Wait if necessary.
				long wait = minimumThinkTime
						- (System.currentTimeMillis() - time);
				if (wait > 0) {
					Thread.sleep(wait);
				}

				// Move if it is still our turn.
				synchronized (BrainController.this) {
					if (thinkerMove == controllerMove) {
						move(move);
					}
				}
			} catch (InterruptedException e) {
				// We were cancelled.
				return;
			} finally {
				synchronized (BrainController.this) {
					if (thinker == Thread.currentThread()) {
						thinker = null;
					}
				}
			}
		}