Skip to content

Commit 9331cc3

Browse files
committed
Eating
Added food consumption to local_gym.py (Field function)
1 parent c31b585 commit 9331cc3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

explorationlib/local_gym.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,8 @@ def check_targets(self):
375375
# Coin flip
376376
if self.np_random.rand() <= self.p_target:
377377
self.reward = value
378+
#eat the food
379+
self.values[ind] = 0.0
378380
else:
379381
self.reward = 0.0
380382

@@ -1387,6 +1389,7 @@ def uniform_targets(N, shape, prng=None):
13871389

13881390
return targets
13891391

1392+
# come back and clean up the variable naming later
13901393
def uniform_patch_targets(N, shape, radius, N_per_patch, prng=None):
13911394
prng = _init_prng(prng)
13921395

0 commit comments

Comments
 (0)