Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Visualize Env #159

Open
meghbhalerao opened this issue Mar 3, 2025 · 0 comments
Open

Visualize Env #159

meghbhalerao opened this issue Mar 3, 2025 · 0 comments

Comments

@meghbhalerao
Copy link

Hi, is there any simple way to visualize the state of the environment by doing something like env.render(), I tried env.render() but it says that render is not defined for the env object. I only ask this since environments following the gym api generally have a render method, right?
The following is the example code that I am trying to run -

mdp = OvercookedGridworld.from_layout_name("asymmetric_advantages_tomato")

env = OvercookedEnv.from_mdp(mdp, horizon=400)
# for a certain number of timesteps, run random actions for both of the agents
num_time_steps = 200

env.reset()

for i in range(num_time_steps):
    # sample random action
    joint_action = random_joint_action()
    # step the env with that action
    state, rewards, dones, info = env.step(joint_action)
    env.render()

This gives an error -
AttributeError: 'OvercookedEnv' object has no attribute 'render'

I mean I know this is an obvious error, but I am curious to know as to why doesn't the env have a render method?

Thanks again for the great environment and package!

Megh Bhalerao

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant