Skip to content

tuero/craftworld_cpp_v2

Repository files navigation

craftworld_cpp

A modified C++ implementation of the Craftworld environment from Modular Multitask Reinforcement Learning with Policy Sketches. Andreas, J., Klein, D. & Levine, S.. (2017). Modular Multitask Reinforcement Learning with Policy Sketches. Proceedings of the 34th International Conference on Machine Learning, in Proceedings of Machine Learning Research.

Include to Your Project: CMake

VCPKG

craftworld is not part of the official registry for vcpkg, but is supported in my personal registry here. To add tuero/vcpkg-registry as a git registry to your vcpkg project:

"registries": [
...
{
    "kind": "git",
    "repository": "https://github.com/tuero/vcpkg-registry",
    "reference": "master",
    "baseline": "<COMMIT_SHA>",
    "packages": ["craftworld"]
}
]
...

where <COMMIT_SHA> is the 40-character git commit sha in the registry's repository (you can find this by clicking on the latest commit here and looking at the URL.

Then in your project cmake:

cmake_minimum_required(VERSION 3.25)
project(my_project LANGUAGES CXX)

find_package(craftworld CONFIG REQUIRED)
add_executable(main main.cpp)
target_link_libraries(main PRIVATE craftworld::craftworld)

FetchContent

include(FetchContent)
# ...
FetchContent_Declare(craftworld
    GIT_REPOSITORY https://github.com/tuero/craftworld_cpp_v2.git
    GIT_TAG master
)

# make available
FetchContent_MakeAvailable(craftworld)
link_libraries(craftworld)

Git Submodules

# assumes project is cloned into external/craftworld_cpp
add_subdirectory(external/craftworld_cpp)
link_libraries(craftworld)

Installing Python Bindings

git clone https://github.com/tuero/craftworld_cpp_v2.git
pip install ./craftworld_cpp_v2

If you get a GLIBCXX_3.4.XX not found error at runtime, then you most likely have an older libstdc++ in your virtual environment lib/ which is taking presidence over your system version. Either correct your $PATH, or update your virtual environment libstdc++.

For example, if using anaconda

conda install conda-forge::libstdcxx-ng

Generate Levels

The levelset generator will generate a curriculum of levels to gather the gem ring: make a bronze pick, make an iron pick, and collect the gem ring.

cd scripts
python generate_levelset.py --export_path=EXPORT_PATH --map_size=14 --num_train=50000 --num_test=1000 --num_grass=2

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages