@Test public void refacPolicyPlay() { MockObservationSpace observationSpace = new MockObservationSpace(); MockDQN dqn = new MockDQN(); MockRandom random = new MockRandom(new double[] { 0.7309677600860596, 0.8314409852027893, 0.2405363917350769, 0.6063451766967773, 0.6374173760414124, 0.3090505599975586, 0.5504369735717773, 0.11700659990310669 }, new int[] { 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4 }); MockMDP mdp = new MockMDP(observationSpace, 30, random); QLearningConfiguration conf = QLearningConfiguration.builder() .seed(0L) .maxEpochStep(0) .maxStep(0) .expRepMaxSize(5) .batchSize(1) .targetDqnUpdateFreq(0) .updateStart(0) .rewardFactor(1.0) .gamma(0) .errorClamp(0) .minEpsilon(0) .epsilonNbStep(0) .doubleDQN(true) .build(); MockNeuralNet nnMock = new MockNeuralNet(); IHistoryProcessor.Configuration hpConf = new IHistoryProcessor.Configuration(5, 4, 4, 4, 4, 0, 0, 2); MockRefacPolicy sut = new MockRefacPolicy(nnMock, observationSpace.getShape(), hpConf.getSkipFrame(), hpConf.getHistoryLength()); MockHistoryProcessor hp = new MockHistoryProcessor(hpConf); double totalReward = sut.play(mdp, hp); assertEquals(1, nnMock.resetCallCount); assertEquals(465.0, totalReward, 0.0001); assertEquals(1, mdp.resetCount); assertEquals(30, mdp.actions.size()); for(int i = 0; i < mdp.actions.size(); ++i) { assertEquals(0, (int)mdp.actions.get(i)); } assertEquals(0, dqn.fitParams.size()); assertEquals(0, dqn.outputParams.size()); }
@Deprecated public <O extends Encodable, AS extends ActionSpace<A>> double play(MDP<O, A, AS> mdp) { return play(mdp, (IHistoryProcessor)null); }
Policy implements INeuralNetPolicy<A> { @Deprecated public <O extends Encodable, AS extends ActionSpace<A>> double play(MDP<O, A, AS> mdp) { return play(mdp, (IHistoryProcessor)null); } }
Policy implements INeuralNetPolicy<A> { @Deprecated public <O extends Encodable, AS extends ActionSpace<A>> double play(MDP<O, A, AS> mdp) { return play(mdp, (IHistoryProcessor)null); }  }
Policy implements INeuralNetPolicy<A> { @Deprecated public <O extends Encodable, AS extends ActionSpace<A>> double play(MDP<O, A, AS> mdp) { return play(mdp, (IHistoryProcessor)null); }  abstract IOutputNeuralNet getNeuralNet(); abstract A nextAction(Observation obs); @Deprecated double play(MDP<O, A, AS> mdp); @Deprecated double play(MDP<O, A, AS> mdp, HistoryProcessor.Configuration conf); @Deprecated @Override double play(MDP<O, A, AS> mdp, IHistoryProcessor hp); void reset(); }
Policy implements INeuralNetPolicy<A> { @Deprecated public <O extends Encodable, AS extends ActionSpace<A>> double play(MDP<O, A, AS> mdp) { return play(mdp, (IHistoryProcessor)null); }  abstract IOutputNeuralNet getNeuralNet(); abstract A nextAction(Observation obs); @Deprecated double play(MDP<O, A, AS> mdp); @Deprecated double play(MDP<O, A, AS> mdp, HistoryProcessor.Configuration conf); @Deprecated @Override double play(MDP<O, A, AS> mdp, IHistoryProcessor hp); void reset();  }