Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,26 @@ The tasks are listed in the table below along with their number of variations. E
| 10-1 | mendelian-genetics-known-plant | 120 |
| 10-2 | mendelian-genetics-unknown-plant | 480 |

## Simplifications
ScienceWorld supports a number of simplifications that can be applied to the environment to make it easier for agents to learn. These simplifications can be applied by passing the `--simplifications-preset` argument to the command line interface, or by passing the `simplifications` argument to the Python API.

The available simplifications are:
- `teleportAction`: Allows agents to instantly move to any location in the environment.
- `openDoors`: All doors in the environment are open by default.
- `selfWateringFlowerPots`: Automatically waters all flower pots in the environment.
- `noElectricalAction`: Disables electrical actions, making it easier for agents to learn tasks that do not require electrical actions.
- `openContainers`: All containers in the environment are open by default.

The `--simplifications-preset` argument can be set to `easy` to apply the following simplifications:
- `teleportAction`
- `openDoors`
- `selfWateringFlowerPots`
- `noElectricalAction` (for non-connectivity tasks)

> [!WARNING]
> The `easy` preset differs from what is described in the paper (see Appendix B.5). The `openContainers` is not included in that preset and should manually be added if desired.


# Baseline Agents
**DRRN:** https://github.com/cognitiveailab/drrn-scienceworld

Expand All @@ -140,3 +160,29 @@ The tasks are listed in the table below along with their number of variations. E
**CALM:** https://github.com/cognitiveailab/calm-scienceworld

**Behavior Cloning and Decision Transformer:** https://github.com/cognitiveailab/t5-scienceworld



# Developers

To compile the ScienceWorld JAR file, follow these steps:

### Prerequisites
You will need to have `Java 1.8+` SDK installed on your system (shipped with most linux distributions). E.g. on Ubuntu, you can install it with:

sudo apt-get install openjdk-21-jdk

Then, install sbt (Scala Build Tool) by running:
```bash
echo "deb https://repo.scala-sbt.org/scalasbt/debian all main" | sudo tee /etc/apt/sources.list.d/sbt.list
echo "deb https://repo.scala-sbt.org/scalasbt/debian /" | sudo tee /etc/apt/sources.list.d/sbt_old.list
curl -sL "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x2EE0EA64E40A89B84B2DF73499E82A75642AC823" | sudo tee /etc/apt/trusted.gpg.d/sbt.asc
sudo apt-get update
sudo apt-get install sbt
```

### Building the JAR
Once you have `sbt` installed, you can compile the ScienceWorld JAR file by running:
```bash
./simulator/package.sh
```
7 changes: 5 additions & 2 deletions examples/human.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,11 @@ def parse_args():
help="Number of episodes to play. Default: %(default)s")

simplification_group = parser.add_argument_group('Game simplifications')
simplification_group.add_argument("--simplifications-preset", choices=['easy'],
help="Choose a preset among: 'easy' (apply all possible simplifications).")
simplification_group.add_argument(
"--simplifications-preset", choices=['easy'],
help="Choose a preset among:\n"
"'easy' (teleportAction,openDoors,selfWateringFlowerPots,noElectricalAction)."
)
simplification_group.add_argument("--teleport", action="store_true",
help="Lets agents instantly move to any location.")
simplification_group.add_argument("--self-watering-plants", action="store_true",
Expand Down
7 changes: 5 additions & 2 deletions examples/random_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,11 @@ def parse_args():
help="Maximum number of episodes per transcript file. Default: %(default)s")

simplification_group = parser.add_argument_group('Game simplifications')
simplification_group.add_argument("--simplifications-preset", choices=['easy'],
help="Choose a preset among: 'easy' (apply all possible simplifications).")
simplification_group.add_argument(
"--simplifications-preset", choices=['easy'],
help="Choose a preset among:\n"
"'easy' (teleportAction,openDoors,selfWateringFlowerPots,noElectricalAction)."
)
simplification_group.add_argument("--teleport", action="store_true",
help="Lets agents instantly move to any location.")
simplification_group.add_argument("--self-watering-plants", action="store_true",
Expand Down
Binary file modified scienceworld/scienceworld.jar
Binary file not shown.
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
install_requires=open('requirements.txt').readlines(),
extras_require={
'webserver': open('requirements.txt').readlines() + ['pywebio'],
'dev': open('requirements-dev.txt').readlines(),
},
classifiers=[
"Programming Language :: Python :: 3",
Expand Down
2 changes: 1 addition & 1 deletion simulator/build.sbt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name := "scienceworld-scala"

version := "1.2.2"
version := "1.2.3"

scalaVersion := "2.12.9"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class SimplificationOpenContainers extends Simplification(label = SIMPLIFICATION
val allObjs = universe.getContainedObjectsAndPortalsRecursive(includeHidden = true, includePortalConnections = true)
for (obj <- allObjs) {
obj match {
case x:Portal => {
case x:EnvObject => {
if ((x.propContainer.isDefined) && (x.propContainer.get.isContainer) && (x.propContainer.get.isClosable)) { // If an object is a container that's closable
x.propContainer.get.isOpen = true // Open it
}
Expand Down
Loading