32        Test that epsilon only accepts probability values. 
   35        for e 
in (0.0, 0.25, 0.12345, 1.0, 1, 0):
 
   37            self.assertEqual(e, agent.epsilon,
 
   38                             msg=
'Agent did not store epsilon property.')
 
   40        for e 
in (-0.01, 100, 1.1, 
'0.5', (0.0, 0.5, 0.25)):
 
   41            with self.assertRaises(Exception, msg=
'Agent did not reject invalid epsilon inputs.'):
 
 
   46        Test that the update works correctly. 
   48        The agent uses a weighted average, so use known values to ensure correct calculation. 
   51        rewards = numpy.array(range(15, 26))
 
   52        expected_results = numpy.array(
 
   53            [15, 15.5, 16, 16.5, 17, 17.5, 18, 18.5, 19, 19.5, 20])
 
   54        for i 
in range(expected_results.size):
 
   56            self.
agent.update(action=0, reward=rewards[i])
 
   57            self.assertEqual(self.
agent.table[0], expected_results[i])