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

Using Cleanup World #64

Open
devvramesh opened this issue Nov 11, 2022 · 0 comments
Open

Using Cleanup World #64

devvramesh opened this issue Nov 11, 2022 · 0 comments

Comments

@devvramesh
Copy link

devvramesh commented Nov 11, 2022

Hello. I'm looking to implement Cleanup World, but I don't see any examples. Could you point me in a direction for its use?

I tried implementing an example of CleanupWorld, and I got the following error: TypeError: (simple_rl): Reproduction of results not implemented for CleanUpMDP

Here is the code that I used:
`
#!/usr/bin/env python

#Python imports.
import sys

#Other imports.
import srl_example_setup
from simple_rl.agents import QLearningAgent, RandomAgent
from simple_rl.tasks import CleanUpMDP, CleanUpRoom, CleanUpTask, CleanUpDoor, CleanUpBlock
from simple_rl.run_experiments import run_agents_on_mdp

def main(open_plot=True):

task = CleanUpTask("green", "red")
room1 = CleanUpRoom("room1", [(x, y) for x in range(5) for y in range(3)], "blue")
block1 = CleanUpBlock("block1", 1, 1, color="green")
block2 = CleanUpBlock("block2", 2, 4, color="purple")
block3 = CleanUpBlock("block3", 8, 1, color="orange")
room2 = CleanUpRoom("room2", [(x, y) for x in range(5, 10) for y in range(3)], color="red")
room3 = CleanUpRoom("room3", [(x, y) for x in range(0, 10) for y in range(3, 6)], color="yellow")
rooms = [room1, room2, room3]
blocks = [block1, block2, block3]
doors = [CleanUpDoor(4, 0), CleanUpDoor(3, 2)]
mdp = CleanUpMDP(task, rooms=rooms, doors=doors, blocks=blocks)
# mdp.visualize_interaction()

# Make agents.
ql_agent = QLearningAgent(actions=mdp.get_actions())
rand_agent = RandomAgent(actions=mdp.get_actions())

# Run experiment and make plot.
run_agents_on_mdp([ql_agent, rand_agent], mdp, instances=10, episodes=50, steps=10, open_plot=open_plot)

if name == "main":
main(open_plot=not sys.argv[-1] == "no_plot")
`

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