Skip to content

Commit

Permalink
Add CurrentStep reward test
Browse files Browse the repository at this point in the history
  • Loading branch information
MadsSR committed Apr 11, 2024
1 parent f8cb888 commit 55e943d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/tests/utils/test_reward_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,16 @@ def test_weights(self):
1 / 5,
)

reward = ConstantReward(weight=ConstantWeightCurrentStep, max_episode_steps=10)
reward.reset(table_state)
for _ in range(1, 3):
reward.get_reward(table_state, table_state, self.empty_action)

self.assertEqual(
reward.get_reward(table_state, table_state, self.empty_action),
1 / 3,
)


if __name__ == "__main__":
unittest.main()

0 comments on commit 55e943d

Please sign in to comment.