Last active
April 26, 2022 09:52
-
-
Save Paulescu/e105db173b581adc0b63a9593ac10e5a to your computer and use it in GitHub Desktop.
This file contains 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
# create environment | |
import gym | |
env = gym.make('LunarLander-v2') | |
# create random agent | |
class RandomAgent: | |
def __init__(self, env): | |
self.env = env | |
def act(self, state) -> int: | |
""" | |
No input arguments to this function. | |
The agent does not consider the state of the environment when deciding | |
what to do next. | |
""" | |
return self.env.action_space.sample() | |
agent = RandomAgent(env) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment