Skip to content

Commit b78a093

Browse files
committed
fixed reward
1 parent 70dbae8 commit b78a093

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

urnai/agents/rewards/vizdoom.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@ def __init__(self, method):
4141
def get_reward(self, obs, reward, done):
4242
r = 0
4343

44-
if method == VizDoomHealthGatheringReward.METHOD_CUMULATIVE:
44+
if self.method == VizDoomHealthGatheringReward.METHOD_CUMULATIVE:
4545
r += obs.game_variables[VizDoomHealthGatheringReward.HEALTH]
46-
elif method == VizDoomHealthGatheringReward.METHOD_DIFFERENCE:
46+
elif self.method == VizDoomHealthGatheringReward.METHOD_DIFFERENCE:
4747
r += obs.game_variables[VizDoomHealthGatheringReward.HEALTH] - self.prev_health
4848
self.prev_health = obs.game_variables[VizDoomHealthGatheringReward.HEALTH]
49-
elif method == VizDoomHealthGatheringReward.METHOD_POSITIVE_ONLY:
49+
elif self.method == VizDoomHealthGatheringReward.METHOD_POSITIVE_ONLY:
5050
r += obs.game_variables[VizDoomHealthGatheringReward.HEALTH] - self.prev_health
5151
self.prev_health = obs.game_variables[VizDoomHealthGatheringReward.HEALTH]
5252

0 commit comments

Comments
 (0)