@Test public void when_callingHandleEpisodeEnd_expect_experienceHandlerSetFinalObservationCalled() { INDArray observationData = Nd4j.rand(1, 1); when(experienceHandlerMock.isTrainingBatchReady()).thenReturn(false); sut.handleEpisodeEnd(new Observation(observationData)); ArgumentCaptor<Observation> observationCaptor = ArgumentCaptor.forClass(Observation.class); verify(experienceHandlerMock, times(1)).setFinalObservation(observationCaptor.capture()); assertEquals(observationData.getDouble(0, 0), observationCaptor.getValue().getData().getDouble(0, 0), 0.00001); verify(updateRuleMock, never()).update(any(List.class)); }
@Override public void handleEpisodeEnd(Observation finalObservation) { experienceHandler.setFinalObservation(finalObservation); if(experienceHandler.isTrainingBatchReady()) { handleBatch(); } }
LearningBehavior implements ILearningBehavior<ACTION> { @Override public void handleEpisodeEnd(Observation finalObservation) { experienceHandler.setFinalObservation(finalObservation); if(experienceHandler.isTrainingBatchReady()) { handleBatch(); } } }
LearningBehavior implements ILearningBehavior<ACTION> { @Override public void handleEpisodeEnd(Observation finalObservation) { experienceHandler.setFinalObservation(finalObservation); if(experienceHandler.isTrainingBatchReady()) { handleBatch(); } }  }
LearningBehavior implements ILearningBehavior<ACTION> { @Override public void handleEpisodeEnd(Observation finalObservation) { experienceHandler.setFinalObservation(finalObservation); if(experienceHandler.isTrainingBatchReady()) { handleBatch(); } }  @Override void handleEpisodeStart(); @Override void handleNewExperience(Observation observation, ACTION action, double reward, boolean isTerminal); @Override void handleEpisodeEnd(Observation finalObservation); void notifyBeforeStep(); }
LearningBehavior implements ILearningBehavior<ACTION> { @Override public void handleEpisodeEnd(Observation finalObservation) { experienceHandler.setFinalObservation(finalObservation); if(experienceHandler.isTrainingBatchReady()) { handleBatch(); } }  @Override void handleEpisodeStart(); @Override void handleNewExperience(Observation observation, ACTION action, double reward, boolean isTerminal); @Override void handleEpisodeEnd(Observation finalObservation); void notifyBeforeStep();  }