int chooseAction(int state) { if (_rand.nextDouble() < epsilon) return _rand.nextInt(nActions); return bestAction(state); }