Skip to content
Snippets Groups Projects
Commit ad314632 authored by Chris MacLellan's avatar Chris MacLellan
Browse files

fixed multicolumn bug where agent can receive reward for submitting empty...

fixed multicolumn bug where agent can receive reward for submitting empty string to a field that should be empty
parent 25c47746
No related branches found
No related tags found
No related merge requests found
......@@ -34,8 +34,8 @@ class MultiColumnAdditionSymbolic:
Creates a state and sets a random problem.
"""
if logger is None:
# self.logger = DataShopLogger('MulticolumnAdditionTutor', extra_kcs=['field'])
self.logger = StubLogger()
self.logger = DataShopLogger('MulticolumnAdditionTutor', extra_kcs=['field'])
# self.logger = StubLogger()
else:
self.logger = logger
self.logger.set_student()
......@@ -309,6 +309,11 @@ class MultiColumnAdditionSymbolic:
if self.state[selection] != "":
return -1.0
# You can't send the empty string (this is an edge case that can cause
# problems.
if inputs['value'] == "":
return -1.0
if (selection == "answer_ones" and
inputs['value'] == self.correct_ones):
return 1.0
......@@ -641,7 +646,6 @@ class MultiColumnAdditionOppEnv(gym.Env):
if self.n_steps > self.max_steps:
done = True
return obs, reward, done, info
def apply_rl_op(self, op, arg1, arg2, arg3):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment