Skip to content

Commit

Permalink
Merge pull request #564 from planningfellowship2024/docs-pr-260123
Browse files Browse the repository at this point in the history
Docs Pull Request - 260123
  • Loading branch information
alvalentini authored Jan 29, 2024
2 parents b7bdd2d + ccfea4a commit 2dd252b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 15 deletions.
4 changes: 2 additions & 2 deletions docs/interoperability.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ In order to make the library immediately usable for people having existing code
PDDL/MAPDDL/HDDL reader and writer
----------------------------------

The library offers a comprehensive and well-tested parser for PDDL 2.1 level 3 (i.e. up to temporal planning without continuous change). The parser can be invoked as shown in the example below and can be used either to parse a whole planning instance (i.e. a domain and a problem), or just to porsche the domain file, resulting in an incomplete ``Problem`` object that can be completed using the UP API as shown below. This latter use-case allows to model the action schemata using PDDL and then formulate the problem(s) using the UP (possibly using data available at runtime for doing so).
The library offers a comprehensive and well-tested parser for PDDL 2.1 level 3 (i.e. up to temporal planning without continuous change). The parser can be invoked as shown in the example below and can be used either to parse a whole planning instance (i.e. a domain and a problem), or just to parse the domain file, resulting in an incomplete ``Problem`` object that can be completed using the UP API as shown below. This latter use-case allows to model the action schemata using PDDL and then formulate the problem(s) using the UP (possibly using data available at runtime for doing so).

.. literalinclude:: ./code_snippets/pddl_interop.py
:caption: PDDLReader example
:lines: 12-16
:lines: 2,11-16

.. literalinclude:: ./code_snippets/pddl_interop.py
:caption: PDDLReader with domain file and problem populated using UP
Expand Down
24 changes: 11 additions & 13 deletions docs/notebooks/03-temporal-planning.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -391,9 +391,7 @@
"]\n",
"\n",
"goals = [\n",
"]\n",
"\n",
"\n"
"]\n"
]
}
],
Expand Down Expand Up @@ -426,15 +424,15 @@
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[96m\u001b[1mNOTE: To disable printing of planning engine credits, add this line to your code: `up.shortcuts.get_environment().credits_stream = None`\n",
"\u001b[0m\u001b[96m *** Credits ***\n",
"\u001b[0m\u001b[96m * In operation mode `OneshotPlanner` at line 1 of `/tmp/ipykernel_153164/3087807287.py`, \u001b[0m\u001b[96myou are using the following planning engine:\n",
"\u001b[0m\u001b[96m * Engine name: Tamer\n",
"\u001B[96m\u001B[1mNOTE: To disable printing of planning engine credits, add this line to your code: `up.shortcuts.get_environment().credits_stream = None`\n",
"\u001B[0m\u001B[96m *** Credits ***\n",
"\u001B[0m\u001B[96m * In operation mode `OneshotPlanner` at line 1 of `/tmp/ipykernel_153164/3087807287.py`, \u001B[0m\u001B[96myou are using the following planning engine:\n",
"\u001B[0m\u001B[96m * Engine name: Tamer\n",
" * Developers: FBK Tamer Development Team\n",
"\u001b[0m\u001b[96m * Description: \u001b[0m\u001b[96mTamer offers the capability to generate a plan for classical, numerical and temporal problems.\n",
" * For those kind of problems tamer also offers the possibility of validating a submitted plan.\u001b[0m\u001b[96m\n",
"\u001b[0m\u001b[96m\n",
"\u001b[0mTamer returned:\n",
"\u001B[0m\u001B[96m * Description: \u001B[0m\u001B[96mTamer offers the capability to generate a plan for classical, numerical and temporal problems.\n",
" * For those kind of problems tamer also offers the possibility of validating a submitted plan.\u001B[0m\u001B[96m\n",
"\u001B[0m\u001B[96m\n",
"\u001B[0mTamer returned:\n",
"0.0: light_match(m1) [6.0]\n",
"0.01: mend_fuse(f1) [5.0]\n",
"6.01: light_match(m2) [6.0]\n",
Expand All @@ -449,9 +447,9 @@
" result = planner.solve(problem)\n",
" plan = result.plan\n",
" if plan is not None:\n",
" print(\"%s returned:\" % planner.name)\n",
" print(f\"{planner.name} returned:\")\n",
" for start, action, duration in plan.timed_actions:\n",
" print(\"%s: %s [%s]\" % (float(start), action, float(duration)))\n",
" print(f\"{float(start)}: {action} [{float(duration)}]\")\n",
" else:\n",
" print(\"No plan found.\")"
]
Expand Down

0 comments on commit 2dd252b

Please sign in to comment.