private Action chooseCpgdAction(PlayerView contextView, Set<ActionType> actionTypes) throws InterruptedException {
		if (selectFuture != null && !selectFuture.isDone())
			throw new IllegalStateException("Another select task is active.");

		if (Collections.disjoint(actionTypes, BarBotCpgdSelectTask.ACTION_TYPES))
			return null;

		// 随机选择思考时间
		long startTime = System.currentTimeMillis();
		int thinkingTime = THINKING_TIME_MIN + random.nextInt(THINKING_TIME_MAX - THINKING_TIME_MIN);

		Future<Action> futureResult = ForkJoinPool.commonPool()
				.submit(new BarBotCpgdSelectTask(contextView, actionTypes));
		try {
			Action action = futureResult.get();
			long endTime = System.currentTimeMillis();
			long remainTimeMs = thinkingTime * 1000 - (endTime - startTime);
			if (remainTimeMs > 0)
				// 时间太短了，假装再想一会儿
				TimeUnit.MILLISECONDS.sleep(remainTimeMs);
			return action;
		} catch (InterruptedException e) {
			// 选择被game中断，不再继续选择了
			selectFuture.cancel(true);
			throw e;
		} catch (ExecutionException e) {
			// 选择过程出现错误
			throw new RuntimeException(e);
		} catch (CancellationException e) {
			// 应该不会在这出来
			throw new RuntimeException(e);
		}
	}