From a81c3cef51697709389197bfe4076ab5bcd8a125 Mon Sep 17 00:00:00 2001 From: adai Date: Sun, 12 Feb 2023 17:41:09 -0500 Subject: [PATCH] Add NeurIPS 2022 Control and Supervised Learning agent to agent zoo (#1858) --- CHANGELOG.md | 3 ++- docs/benchmarks/agent_zoo.rst | 8 +++++++- zoo/policies/__init__.py | 16 ++++++++++++++++ .../control_and_supervised_learning/setup.cfg | 19 +++++++++++++++++++ .../control_and_supervised_learning/setup.py | 4 ++++ 5 files changed, 48 insertions(+), 2 deletions(-) create mode 100644 zoo/policies/control_and_supervised_learning/setup.cfg create mode 100644 zoo/policies/control_and_supervised_learning/setup.py diff --git a/CHANGELOG.md b/CHANGELOG.md index b47c3992f1..4040b05f8f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ Copy and pasting the git commit messages is __NOT__ enough. ## [Unreleased] ### Added +- Added a zoo agent, named Control-and-Supervised-Learning, from NeurIPS 2022 submission. This zoo agent runs in benchmark `driving_smarts==0.0`. ### Changed ### Deprecated ### Fixed @@ -21,7 +22,7 @@ Copy and pasting the git commit messages is __NOT__ enough. - Engine configuration utility that uses the following locations to allow configuration of the SMARTS engine. The engine consumes the configuration files from the following locations in the following priority: `./engine.ini`, `~/.smarts/engine.ini`, `$GLOBAL_USER/smarts/engine.ini`, and `${PYTHON_ENV}/lib/${PYTHON_VERSION}/site-packages/smarts/engine.ini`. - Added map source uri as `map_source` inside of `hiway-v1` reset info to indicate what the current map is on reset. - Added NGSIM documentation. -- Added a zoo agent, named Interaction-aware Motion Prediction, from NeurIPS2022 submission. This zoo agent runs in benchmark `driving_smarts==0.0`. +- Added a zoo agent, named Interaction-Aware Motion Prediction, from NeurIPS2022 submission. This zoo agent runs in benchmark `driving_smarts==0.0`. - Added Agent Zoo documentation in ReadTheDocs. ### Changed - Made changes in the docs to reflect `master` branch as the main development branch. diff --git a/docs/benchmarks/agent_zoo.rst b/docs/benchmarks/agent_zoo.rst index ae9bf05bc9..843fdfd7af 100644 --- a/docs/benchmarks/agent_zoo.rst +++ b/docs/benchmarks/agent_zoo.rst @@ -53,4 +53,10 @@ Available zoo agents - driving_smarts==0.0 - :attr:`~smarts.core.controllers.ActionSpaceType.TargetPose` - `code `__ - - Contributed as part of `NeurIPS 2022 Driving SMARTS `_ competition. + - Contributed as part of `NeurIPS 2022 Driving SMARTS `__ competition. + * - | zoo.policies:control-and-supervised-learning-agent-v0 + | zoo/policies/control_and_supervised_learning + - driving_smarts==0.0 + - :attr:`~smarts.core.controllers.ActionSpaceType.TargetPose` + - `code `__ + - Contributed as part of `NeurIPS 2022 Driving SMARTS `__ competition. diff --git a/zoo/policies/__init__.py b/zoo/policies/__init__.py index e38f75f182..1ad3f37682 100644 --- a/zoo/policies/__init__.py +++ b/zoo/policies/__init__.py @@ -133,3 +133,19 @@ def entry_point_iamp(**kwargs): register( locator="interaction-aware-motion-prediction-agent-v0", entry_point=entry_point_iamp ) + +def entry_point_casl(**kwargs): + pkg = "control_and_supervised_learning" + module = ".policy" + lib = _verify_installation(pkg=pkg, module=module) + + return AgentSpec( + interface=AgentInterface( + action=ActionSpaceType.TargetPose, + ), + agent_builder=lib.Policy, + ) + +register( + locator="control-and-supervised-learning-agent-v0", entry_point=entry_point_casl, +) \ No newline at end of file diff --git a/zoo/policies/control_and_supervised_learning/setup.cfg b/zoo/policies/control_and_supervised_learning/setup.cfg new file mode 100644 index 0000000000..a6278a6759 --- /dev/null +++ b/zoo/policies/control_and_supervised_learning/setup.cfg @@ -0,0 +1,19 @@ +[metadata] +name = smarts_agent_casl_stub +version = 0.1.0 +url = https://github.com/huawei-noah/SMARTS +description = SMARTS zoo agent. +long_description = Trained Control and Supervised Learning agent. See [SMARTS](https://github.com/huawei-noah/SMARTS). +long_description_content_type=text/markdown +classifiers= + Programming Language :: Python + Programming Language :: Python :: 3 :: Only + Programming Language :: Python :: 3.8 + +[options] +packages = find: +include_package_data = True +zip_safe = True +python_requires = == 3.8.* +install_requires = + smarts_agent_casl==0.1.0 diff --git a/zoo/policies/control_and_supervised_learning/setup.py b/zoo/policies/control_and_supervised_learning/setup.py new file mode 100644 index 0000000000..7f1a1763ca --- /dev/null +++ b/zoo/policies/control_and_supervised_learning/setup.py @@ -0,0 +1,4 @@ +from setuptools import setup + +if __name__ == "__main__": + setup()