Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RL4J - Added a unit test to help refac QLearningDiscrete.trainStep() #8065



Copy link

commented Jul 30, 2019

Signed-off-by: unknown

What changes were proposed in this pull request?

In this PR, I add a unit test that will help me refac QLearningDiscrete.trainStep().

Summary of changes:

  • Added QLearningDiscreteTest
  • Moved MockEncodable, MockObservationSpace, MockMDP from AsyncThreadTest into their own file.
  • Adjusted AsyncThreadTest reward value due to MockMDP.step() now returning an increasing reward value.
  • Added MockDQN, MockExpReplay
  • Changed MockHistoryProcessor to be able to keep track of call count and copied the implementation of the real HistoryProcessor for getHistory()

How was this patch tested?

unit test

Quick checklist

The following checklist helps ensure your PR is complete:

  • Eclipse Contributor Agreement signed, and signed commits - see IP Requirements page for details
  • Reviewed the Contributing Guidelines and followed the steps within.
  • Created tests for any significant new code additions.
  • Relevant tests for your changes are passing.
Added a unit test to help refac QLearningDiscrete.trainStep()
Signed-off-by: unknown <>

@aboulang2002 aboulang2002 changed the title Added a unit test to help refac QLearningDiscrete.trainStep() RL4J - Added a unit test to help refac QLearningDiscrete.trainStep() Jul 30, 2019

Changed expReplay setter to package private
Signed-off-by: Alexandre Boulanger <>
Copy link

left a comment


@AlexDBlack AlexDBlack merged commit b083c22 into eclipse:master Aug 2, 2019

1 check passed

eclipsefdn/eca The author(s) of the pull request is covered by necessary legal agreements in order to proceed!

@aboulang2002 aboulang2002 deleted the aboulang2002:ab2002_refac_tests_qlearningdiscrete branch Aug 2, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
3 participants
You can’t perform that action at this time.