Files
Gymnasium/gym/envs/algorithmic/repeat_copy.py
Colin e84bd0ffe1 Algorithmic refactor (#383)
* Refactor/document algorithmic environments and add tests.

* test for 3 row addition

* Fix failing rollout test by reinserting quirk in reversedAddition env

* todo regarding addition3-v0

* Fix python 3 division issues

* typo fix

* Re-generate python3 rollout file to account for ReversedAddition bug fix
2016-10-21 16:06:48 -07:00

17 lines
532 B
Python

"""
Task is to copy content multiple times from the input tape to
the output tape. http://arxiv.org/abs/1511.07275
"""
import numpy as np
from gym.envs.algorithmic import algorithmic_env
class RepeatCopyEnv(algorithmic_env.TapeAlgorithmicEnv):
MIN_REWARD_SHORTFALL_FOR_PROMOTION = -.1
def __init__(self, base=5):
super(RepeatCopyEnv, self).__init__(base=base, chars=True)
self.last = 50
def target_from_input_data(self, input_data):
return input_data + list(reversed(input_data)) + input_data