in support/retro_contest/__init__.py [0:0]
def step(self, ac):
done = False
totrew = 0
for i in range(self.n):
# First step after reset, use action
if self.curac is None:
self.curac = ac
# First substep, delay with probability=stickprob
elif i == 0:
if self.rng.rand() > self.stickprob:
self.curac = ac
# Second substep, new action definitely kicks in
elif i == 1:
self.curac = ac
ob, rew, done, info = self.env.step(self.curac)
totrew += rew
if done:
break
return ob, totrew, done, info