Skip to content
/ rlang Public

A Declarative Language for Expressing Partial World Knowledge to Reinforcement Learning Agents

Notifications You must be signed in to change notification settings

brownirl/rlang

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

709 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RLang v0.2.5

Getting Started

Requires Python 3.7 and Antlr 4.9.2 or 4.9.3

  • If you're on Mac, first run brew install swig.
  • Install from the wheel located in rlang/rlang/dist with python -m pip install rlang/rlang/dist/rlang-0.2.5-py3-none-any.whl.
  • If you want to run the Gridworld experiment, clone this simple_rl fork and pip-install it. pip install path/to/downloaded/simple_rl/. (if you're developing, install it with the -e flag for convenience)

Directory structure

  • examples/: example RLang programs and RLang-informed agents.
  • antlr/: contains all antlr-related stuff. core RLang development mostly happens here.
  • sphinx/: contains all documentation generation stuff
  • rlang/: directory that contains the rlang package
    • rlang/: the actual rlang package
      • agents/: contains implementations of RLang-enabled agents
      • language/: contains the python files for lexing/parsing/listening. Most of these files are generated by Antlr4.
      • grounding/: contains all the RLang groundings.
    • docs/
    • tests/
    • examples/

How to run tests

  • In the rlang/rlang/tests/ directory run pytest -s listener_test/listener_test.py.

Building the Lexer and Parser with Antlr4

  • Run mvn compile from the root directory to run Antlr4.
  • Clean with mvn clean, though it should do it automatically in each build cycle.
  • Run tests with mvn test.
  • Check out antlr/README.md and antlr/pom.xml for more info on grammar development.

Building the documentation with Sphinx

  • You can easily generate html files by running make clean and make multiversion from sphinx/
  • If you add or remove a module, delete the corresponding file in sphinx/source/ and then within sphinx/ run export SPHINX_APIDOC_OPTIONS=members,show-inheritance and then sphinx-apidoc -t templates/ -o source/ ../rlang/rlang ../rlang/rlang/language.

Building the PyPi package

  • In the rlang/rlang/ directory run python -m build, which will put builds into rlang/rlang/dist/.
  • You can upload these to PyPi or TestPyPi:
    • For TestPyPi: python -m twine upload --repository testpypi dist/*
      • Username should be __token__ and password should be the API key, starts with pypi-.

About

A Declarative Language for Expressing Partial World Knowledge to Reinforcement Learning Agents

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 5