allenai / ScienceWorld

ScienceWorld is a text-based virtual environment centered around accomplishing tasks from the standardized elementary science curriculum.
https://sciworld.apps.allenai.org/
Apache License 2.0
199 stars 24 forks source link

Does it support the step-back, that can undo an action? #52

Closed xxmlala closed 9 months ago

PeterAJansen commented 9 months ago

Hi @xxmlala

Thanks for your question. While the API doesn't directly have a function to undo an action, there's a quick work-around for undo-like behavior. Since the simulations are deterministic for a given task_id/variation_id, you can simply restart a new game with the same configuration, and rerun all of the actions the agent has taken (minus the most recent one), and this should mirror an 'undo' behavior.

I've used a similar method for pathcrawling (both in ScienceWorld and TextWorldExpress), and it works well. If you run into any issues, just let us know.

best wishes, Peter

xxmlala commented 9 months ago

Thanks for your reply!