@Override public String toString() { String s = getClass().getSimpleName(); s += "\n" + Utils.indent("minValue:" + minValue); s += "\n" + Utils.indent("maxValue:" + maxValue); s += "\n" + Utils.indent("distribution:" + distribution); return s; }
@Override public int[] act(final double returns[], final int num) { int[] chosen = null; if (num > returns.length) { chosen = new int[returns.length]; } else { chosen = new int[num]; } final ArrayList<Double> values = new ArrayList<Double>(); final ArrayList<Integer> indices = new ArrayList<Integer>(); for (int i = 0; i < returns.length; i++) { values.add(returns[i]); indices.add(i); } int index = -1; for (int i = 0; i < chosen.length; i++) { index = choosing.internalAct(Utils.toArray(values)); chosen[i] = indices.get(index).intValue(); // remove the chosen action and its return values.remove(index); indices.remove(index); } choosing.updateEpsilon(); return chosen; }
@Override public String toString() { String s = super.toString(); s += "\n" + Utils.indent(choosing.toString()); return s; }