Created
August 22, 2018 02:09
-
-
Save fabito/f1adb2cc88a19dee86a0277654bae7b5 to your computer and use it in GitHub Desktop.
neyboy_env - render method
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def render(self, mode='human', close=False): | |
img = self.state.snapshot | |
if mode == 'rgb_array': | |
return img | |
elif mode == 'human': | |
from gym.envs.classic_control import rendering | |
if self.viewer is None: | |
self.viewer = rendering.SimpleImageViewer() | |
self.viewer.imshow(img) | |
return self.viewer.isopen |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment