{ "cells": [ { "metadata": {}, "cell_type": "markdown", "source": "# Benchmark domains and trajectories", "id": "eb9fb4a1a68e633" }, { "metadata": {}, "cell_type": "markdown", "source": "AMLGym provides several benchmark domains from previous Internaional Planning Competitions (IPCs).", "id": "1ac309b575ed4764" }, { "metadata": { "collapsed": true }, "cell_type": "code", "outputs": [], "execution_count": null, "source": "!pip install amlgym", "id": "9bb5ad965be80b96" }, { "cell_type": "code", "execution_count": null, "id": "initial_id", "metadata": { "collapsed": true }, "outputs": [], "source": [ "from amlgym.benchmarks import print_domains\n", "\n", "print_domains()" ] }, { "metadata": {}, "cell_type": "markdown", "source": "The PDDL model of each domain can be inspected:", "id": "bf47f050c2091de8" }, { "metadata": {}, "cell_type": "code", "outputs": [], "execution_count": null, "source": [ "from amlgym.benchmarks import get_domain_path\n", "\n", "domain_path = get_domain_path('blocksworld')\n", "print(domain_path)" ], "id": "fd36b0d1fc890673" }, { "metadata": {}, "cell_type": "code", "outputs": [], "execution_count": null, "source": [ "from amlgym.benchmarks import get_domain\n", "\n", "domain_pddl = get_domain('blocksworld')\n", "print(domain_pddl)" ], "id": "9f69a6f17bb858d8" }, { "metadata": {}, "cell_type": "markdown", "source": "A set of 10 trajectories is provided for each domain:", "id": "a1140b080ac0052c" }, { "metadata": {}, "cell_type": "code", "outputs": [], "execution_count": null, "source": [ "from amlgym.benchmarks import get_trajectories_path\n", "from pprint import pprint\n", "\n", "trajectory_paths = get_trajectories_path('blocksworld')\n", "pprint(trajectory_paths)" ], "id": "2248b833a8b45659" }, { "metadata": {}, "cell_type": "markdown", "source": "An example of trajectory for the `blocksworld` domain is:", "id": "a9308a44e4025670" }, { "metadata": {}, "cell_type": "code", "outputs": [], "execution_count": null, "source": [ "from amlgym.benchmarks import get_trajectories\n", "\n", "trajectory_idx = 0\n", "trajectory = get_trajectories('blocksworld')[trajectory_idx]\n", "print(trajectory)" ], "id": "e5bdac6da94e245d" }, { "metadata": {}, "cell_type": "raw", "source": "The problem used for generating the trajectory can be obtained by:", "id": "fc68d4ccab3a98b3" }, { "metadata": {}, "cell_type": "code", "outputs": [], "execution_count": null, "source": [ "from amlgym.benchmarks import get_problems_path\n", "\n", "problem_paths = get_problems_path('blocksworld')[trajectory_idx]\n", "print(problem_paths)" ], "id": "5e42c531f4094aa" } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 2 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython2", "version": "2.7.6" } }, "nbformat": 4, "nbformat_minor": 5 }