From a177c78642ff3c2993f6c225f91dccf0857cd99e Mon Sep 17 00:00:00 2001 From: Kaiyu Zheng <7720184+zkytony@users.noreply.github.com> Date: Fri, 26 Jan 2024 18:31:21 -0500 Subject: [PATCH] Docs update (#46) * docs update * docs --- .../api/pomdp_py.problems.lasertag.rst | 10 + .../pomdp_py.problems.light_dark.agent.rst | 21 + .../pomdp_py.problems.light_dark.domain.rst | 37 + .../api/pomdp_py.problems.light_dark.env.rst | 37 + .../pomdp_py.problems.light_dark.models.rst | 29 + .../api/pomdp_py.problems.light_dark.rst | 40 + .../api/pomdp_py.problems.load_unload.rst | 21 + .../api/pomdp_py.problems.maze.domain.rst | 37 + .../api/pomdp_py.problems.maze.env.rst} | 11 +- ...mdp_py.problems.maze.models.components.rst | 21 + .../api/pomdp_py.problems.maze.models.rst | 18 + .../api/pomdp_py.problems.maze.rst | 20 + ..._py.problems.multi_object_search.agent.rst | 29 + ...py.problems.multi_object_search.domain.rst | 37 + ...dp_py.problems.multi_object_search.env.rst | 29 + ....multi_object_search.models.components.rst | 29 + ...py.problems.multi_object_search.models.rst | 53 + .../pomdp_py.problems.multi_object_search.rst | 40 + ...pomdp_py.problems.rocksample.cythonize.rst | 53 + .../api/pomdp_py.problems.rocksample.rst | 37 + docs/_sphinx_src/api/pomdp_py.problems.rst | 25 + .../api/pomdp_py.problems.tag.agent.rst | 21 + .../api/pomdp_py.problems.tag.domain.rst | 37 + .../api/pomdp_py.problems.tag.env.rst | 29 + ...omdp_py.problems.tag.models.components.rst | 29 + .../api/pomdp_py.problems.tag.models.rst | 53 + .../_sphinx_src/api/pomdp_py.problems.tag.rst | 56 + .../api/pomdp_py.problems.tiger.cythonize.rst | 53 + .../api/pomdp_py.problems.tiger.rst | 37 + docs/_sphinx_src/building_docs.rst | 14 +- .../_sphinx_src/examples.external_solvers.rst | 8 +- docs/_sphinx_src/examples.mos.rst | 24 +- docs/_sphinx_src/examples.tiger.rst | 16 +- docs/_sphinx_src/existing_domains.rst | 14 +- docs/_sphinx_src/installation.rst | 20 +- docs/_sphinx_src/problems/modules.rst | 7 - .../problems/pomdp_problems.lasertag.rst | 10 - .../pomdp_problems.light_dark.agent.rst | 22 - .../pomdp_problems.light_dark.domain.rst | 35 - .../pomdp_problems.light_dark.env.rst | 30 - .../pomdp_problems.light_dark.models.rst | 30 - .../problems/pomdp_problems.light_dark.rst | 39 - .../problems/pomdp_problems.load_unload.rst | 17 - .../problems/pomdp_problems.maze.domain.rst | 38 - .../problems/pomdp_problems.maze.env.rst | 22 - .../pomdp_problems.maze.models.components.rst | 22 - .../problems/pomdp_problems.maze.models.rst | 17 - .../problems/pomdp_problems.maze.rst | 7 - ...mdp_problems.multi_object_search.agent.rst | 18 - ...dp_problems.multi_object_search.domain.rst | 26 - ...pomdp_problems.multi_object_search.env.rst | 18 - ....multi_object_search.models.components.rst | 30 - ...dp_problems.multi_object_search.models.rst | 34 - .../pomdp_problems.multi_object_search.rst | 51 - .../pomdp_problems.rocksample.cythonize.rst | 46 - .../problems/pomdp_problems.rocksample.rst | 44 - docs/_sphinx_src/problems/pomdp_problems.rst | 12 - .../problems/pomdp_problems.tag.domain.rst | 38 - .../problems/pomdp_problems.tag.env.rst | 30 - .../pomdp_problems.tag.models.components.rst | 30 - .../problems/pomdp_problems.tag.models.rst | 53 - .../problems/pomdp_problems.tag.rst | 51 - .../pomdp_problems.tiger.cythonize.rst | 46 - .../problems/pomdp_problems.tiger.rst | 35 - docs/html/_modules/index.html | 108 +- .../light_dark/domain/action.html | 181 - .../light_dark/domain/observation.html | 188 - .../light_dark/domain/state.html | 179 - .../pomdp_problems/light_dark/env/visual.html | 290 - .../light_dark/models/observation_model.html | 245 - .../light_dark/models/transition_model.html | 217 - .../light_dark/problem_discrete.html | 146 - .../load_unload/load_unload.html | 424 - .../multi_object_search/agent/agent.html | 203 - .../multi_object_search/env/visual.html | 458 - .../multi_object_search/problem.html | 449 - .../_modules/pomdp_problems/tag/env/env.html | 196 - .../pomdp_problems/tag/env/visual.html | 383 - .../pomdp_problems/tag/experiment.html | 185 - .../_modules/pomdp_problems/tag/problem.html | 312 - .../pomdp_py/algorithms/bsp/blqr.html | 244 +- .../pomdp_py/algorithms/visual/visual.html | 275 - .../problems}/light_dark/env/env.html | 82 +- .../problems}/maze/domain/observation.html | 84 +- .../problems}/maze/domain/state.html | 79 +- .../problems}/maze/env/env.html | 67 +- .../multi_object_search/agent/agent.html | 212 + .../multi_object_search/agent/belief.html | 141 +- .../multi_object_search/domain/action.html | 202 +- .../domain/observation.html | 139 +- .../multi_object_search/domain/state.html | 153 +- .../multi_object_search/env/env.html | 211 +- .../multi_object_search/example_worlds.html | 97 +- .../models/components/grid_map.html | 106 +- .../models/components/sensor.html | 258 +- .../models/observation_model.html | 260 +- .../models/policy_model.html | 115 +- .../models/reward_model.html | 131 +- .../models/transition_model.html | 264 +- .../rocksample/rocksample_problem.html | 409 +- .../problems}/tag/agent/agent.html | 187 +- .../problems}/tag/domain/action.html | 79 +- .../problems}/tag/domain/observation.html | 69 +- .../problems}/tag/domain/state.html | 85 +- .../tag/models/components/grid_map.html | 116 +- .../tag/models/components/motion_policy.html | 156 +- .../tag/models/observation_model.html | 94 +- .../problems}/tag/models/policy_model.html | 94 +- .../problems}/tag/models/reward_model.html | 82 +- .../tag/models/transition_model.html | 144 +- .../problems}/tiger/tiger_problem.html | 349 +- .../representations/belief/histogram.html | 93 +- docs/html/_modules/pomdp_py/utils/colors.html | 106 +- .../_modules/pomdp_py/utils/debugging.html | 418 +- .../pomdp_py/utils/interfaces/conversion.html | 204 +- .../pomdp_py/utils/interfaces/simple_rl.html | 219 - .../pomdp_py/utils/interfaces/solvers.html | 145 +- docs/html/_modules/pomdp_py/utils/math.html | 214 +- docs/html/_modules/pomdp_py/utils/misc.html | 90 +- .../_modules/pomdp_py/utils/plotting.html | 206 - .../_modules/pomdp_py/utils/templates.html | 274 +- .../_modules/pomdp_py/utils/test_utils.html | 160 - docs/html/_modules/pomdp_py/utils/typ.html | 183 +- docs/html/_modules/pomdp_py/utils/util.html | 398 - .../_modules/pomdp_py/visual/search_tree.html | 285 - .../api/pomdp_py.problems.lasertag.rst.txt | 10 + ...pomdp_py.problems.light_dark.agent.rst.txt | 21 + ...omdp_py.problems.light_dark.domain.rst.txt | 37 + .../pomdp_py.problems.light_dark.env.rst.txt | 37 + ...omdp_py.problems.light_dark.models.rst.txt | 29 + .../api/pomdp_py.problems.light_dark.rst.txt | 40 + .../api/pomdp_py.problems.load_unload.rst.txt | 21 + .../api/pomdp_py.problems.maze.domain.rst.txt | 37 + .../api/pomdp_py.problems.maze.env.rst.txt} | 11 +- ...py.problems.maze.models.components.rst.txt | 21 + .../api/pomdp_py.problems.maze.models.rst.txt | 18 + .../api/pomdp_py.problems.maze.rst.txt | 20 + ...problems.multi_object_search.agent.rst.txt | 29 + ...roblems.multi_object_search.domain.rst.txt | 37 + ...y.problems.multi_object_search.env.rst.txt | 29 + ...ti_object_search.models.components.rst.txt | 29 + ...roblems.multi_object_search.models.rst.txt | 53 + ...dp_py.problems.multi_object_search.rst.txt | 40 + ...p_py.problems.rocksample.cythonize.rst.txt | 53 + .../api/pomdp_py.problems.rocksample.rst.txt | 37 + .../_sources/api/pomdp_py.problems.rst.txt | 25 + .../api/pomdp_py.problems.tag.agent.rst.txt | 21 + .../api/pomdp_py.problems.tag.domain.rst.txt | 37 + .../api/pomdp_py.problems.tag.env.rst.txt | 29 + ..._py.problems.tag.models.components.rst.txt | 29 + .../api/pomdp_py.problems.tag.models.rst.txt | 53 + .../api/pomdp_py.problems.tag.rst.txt | 56 + .../pomdp_py.problems.tiger.cythonize.rst.txt | 53 + .../api/pomdp_py.problems.tiger.rst.txt | 37 + docs/html/_sources/api/utilsss.rst.txt | 15 - docs/html/_sources/building_docs.rst.txt | 14 +- docs/html/_sources/changelog.rst.txt | 143 - .../_sources/example.action_prior.rst.txt | 35 - .../examples.external_solvers.rst.txt | 8 +- docs/html/_sources/examples.mos.rst.txt | 24 +- docs/html/_sources/examples.tiger.rst.txt | 16 +- docs/html/_sources/existing_domains.rst.txt | 14 +- docs/html/_sources/installation.rst.txt | 20 +- docs/html/_sources/problems/modules.rst.txt | 7 - .../problems/pomdp_problems.lasertag.rst.txt | 10 - .../pomdp_problems.light_dark.agent.rst.txt | 22 - .../pomdp_problems.light_dark.domain.rst.txt | 35 - .../pomdp_problems.light_dark.env.rst.txt | 30 - .../pomdp_problems.light_dark.models.rst.txt | 30 - .../pomdp_problems.light_dark.rst.txt | 39 - .../pomdp_problems.load_unload.rst.txt | 17 - .../pomdp_problems.maze.domain.rst.txt | 38 - .../problems/pomdp_problems.maze.env.rst.txt | 22 - ...dp_problems.maze.models.components.rst.txt | 22 - .../pomdp_problems.maze.models.rst.txt | 17 - .../problems/pomdp_problems.maze.rst.txt | 7 - ...problems.multi_object_search.agent.rst.txt | 18 - ...roblems.multi_object_search.domain.rst.txt | 26 - ...p_problems.multi_object_search.env.rst.txt | 18 - ...ti_object_search.models.components.rst.txt | 30 - ...roblems.multi_object_search.models.rst.txt | 34 - ...pomdp_problems.multi_object_search.rst.txt | 51 - ...omdp_problems.rocksample.cythonize.rst.txt | 46 - .../pomdp_problems.rocksample.rst.txt | 44 - .../_sources/problems/pomdp_problems.rst.txt | 12 - .../pomdp_problems.tag.domain.rst.txt | 38 - .../problems/pomdp_problems.tag.env.rst.txt | 30 - ...mdp_problems.tag.models.components.rst.txt | 30 - .../pomdp_problems.tag.models.rst.txt | 53 - .../problems/pomdp_problems.tag.rst.txt | 51 - .../pomdp_problems.tiger.cythonize.rst.txt | 46 - .../problems/pomdp_problems.tiger.rst.txt | 35 - docs/html/_static/alabaster.css | 23 +- docs/html/_static/basic.css | 6 +- docs/html/_static/documentation_options.js | 5 +- docs/html/_static/jquery-3.5.1.js | 10872 ---------------- docs/html/_static/jquery.js | 2 - docs/html/_static/pygments.css | 3 +- docs/html/_static/searchtools.js | 26 +- docs/html/_static/sphinx_highlight.js | 16 +- docs/html/_static/underscore-1.13.1.js | 2042 --- docs/html/_static/underscore.js | 6 - docs/html/api/modules.html | 43 +- docs/html/api/pomdp_py.algorithms.bsp.html | 46 +- docs/html/api/pomdp_py.algorithms.html | 143 +- docs/html/api/pomdp_py.algorithms.visual.html | 35 +- docs/html/api/pomdp_py.framework.html | 250 +- docs/html/api/pomdp_py.html | 44 +- docs/html/api/pomdp_py.problems.html | 465 + .../pomdp_py.problems.lasertag.html} | 42 +- .../pomdp_py.problems.light_dark.agent.html} | 62 +- .../pomdp_py.problems.light_dark.domain.html | 171 + .../api/pomdp_py.problems.light_dark.env.html | 196 + .../api/pomdp_py.problems.light_dark.html | 211 + .../pomdp_py.problems.light_dark.models.html | 167 + .../pomdp_py.problems.load_unload.html} | 51 +- .../api/pomdp_py.problems.maze.domain.html | 192 + .../pomdp_py.problems.maze.env.html} | 58 +- docs/html/api/pomdp_py.problems.maze.html | 217 + ...dp_py.problems.maze.models.components.html | 163 + .../pomdp_py.problems.maze.models.html} | 53 +- ...py.problems.multi_object_search.agent.html | 246 + ...y.problems.multi_object_search.domain.html | 466 + ...p_py.problems.multi_object_search.env.html | 321 + ...pomdp_py.problems.multi_object_search.html | 360 + ...multi_object_search.models.components.html | 328 + ...y.problems.multi_object_search.models.html | 602 + ...omdp_py.problems.rocksample.cythonize.html | 2128 +++ .../api/pomdp_py.problems.rocksample.html | 911 ++ .../html/api/pomdp_py.problems.tag.agent.html | 219 + .../api/pomdp_py.problems.tag.domain.html | 210 + docs/html/api/pomdp_py.problems.tag.env.html | 167 + docs/html/api/pomdp_py.problems.tag.html | 273 + ...mdp_py.problems.tag.models.components.html | 232 + .../api/pomdp_py.problems.tag.models.html | 435 + .../pomdp_py.problems.tiger.cythonize.html | 1896 +++ docs/html/api/pomdp_py.problems.tiger.html | 713 + .../api/pomdp_py.representations.belief.html | 42 +- ...pomdp_py.representations.distribution.html | 106 +- docs/html/api/pomdp_py.representations.html | 28 +- docs/html/api/pomdp_py.utils.debugging.html | 104 +- docs/html/api/pomdp_py.utils.html | 390 +- docs/html/api/pomdp_py.utils.interfaces.html | 33 +- docs/html/api/pomdp_py.visual.html | 57 +- docs/html/api/utilsss.html | 180 - docs/html/building_docs.html | 50 +- docs/html/changelog.html | 360 - docs/html/design_principles.html | 30 +- docs/html/example.action_prior.html | 176 - docs/html/examples.action_prior.html | 34 +- docs/html/examples.external_solvers.html | 72 +- docs/html/examples.html | 32 +- docs/html/examples.mos.html | 44 +- docs/html/examples.tiger.html | 56 +- docs/html/existing_domains.html | 43 +- docs/html/existing_solvers.html | 30 +- docs/html/extensions.html | 28 +- docs/html/genindex.html | 1545 +-- docs/html/index.html | 57 +- docs/html/installation.html | 61 +- docs/html/modules.html | 28 +- docs/html/objects.inv | Bin 7261 -> 6466 bytes docs/html/other_libraries.html | 28 +- docs/html/problems/modules.html | 309 - docs/html/problems/pomdp_problems.html | 209 - .../pomdp_problems.light_dark.agent.html | 184 - .../pomdp_problems.light_dark.domain.html | 254 - .../pomdp_problems.light_dark.env.html | 250 - .../problems/pomdp_problems.light_dark.html | 297 - .../pomdp_problems.light_dark.models.html | 351 - .../problems/pomdp_problems.load_unload.html | 513 - .../problems/pomdp_problems.maze.domain.html | 192 - ...dp_problems.multi_object_search.agent.html | 238 - ...p_problems.multi_object_search.domain.html | 478 - ...omdp_problems.multi_object_search.env.html | 454 - .../pomdp_problems.multi_object_search.html | 454 - ...multi_object_search.models.components.html | 328 - ...p_problems.multi_object_search.models.html | 568 - .../pomdp_problems.rocksample.cythonize.html | 685 - .../problems/pomdp_problems.rocksample.html | 1178 -- .../problems/pomdp_problems.tag.agent.html | 240 - .../problems/pomdp_problems.tag.domain.html | 231 - .../html/problems/pomdp_problems.tag.env.html | 329 - docs/html/problems/pomdp_problems.tag.html | 380 - .../pomdp_problems.tag.models.components.html | 253 - .../problems/pomdp_problems.tag.models.html | 456 - .../pomdp_problems.tiger.cythonize.html | 627 - docs/html/problems/pomdp_problems.tiger.html | 568 - docs/html/py-modindex.html | 277 +- docs/html/search.html | 27 +- docs/html/searchindex.js | 2 +- docs/html/simple_rl_integration.html | 33 +- 292 files changed, 19061 insertions(+), 36177 deletions(-) create mode 100644 docs/_sphinx_src/api/pomdp_py.problems.lasertag.rst create mode 100644 docs/_sphinx_src/api/pomdp_py.problems.light_dark.agent.rst create mode 100644 docs/_sphinx_src/api/pomdp_py.problems.light_dark.domain.rst create mode 100644 docs/_sphinx_src/api/pomdp_py.problems.light_dark.env.rst create mode 100644 docs/_sphinx_src/api/pomdp_py.problems.light_dark.models.rst create mode 100644 docs/_sphinx_src/api/pomdp_py.problems.light_dark.rst create mode 100644 docs/_sphinx_src/api/pomdp_py.problems.load_unload.rst create mode 100644 docs/_sphinx_src/api/pomdp_py.problems.maze.domain.rst rename docs/{html/_sources/problems/pomdp_problems.tag.agent.rst.txt => _sphinx_src/api/pomdp_py.problems.maze.env.rst} (50%) create mode 100644 docs/_sphinx_src/api/pomdp_py.problems.maze.models.components.rst create mode 100644 docs/_sphinx_src/api/pomdp_py.problems.maze.models.rst create mode 100644 docs/_sphinx_src/api/pomdp_py.problems.maze.rst create mode 100644 docs/_sphinx_src/api/pomdp_py.problems.multi_object_search.agent.rst create mode 100644 docs/_sphinx_src/api/pomdp_py.problems.multi_object_search.domain.rst create mode 100644 docs/_sphinx_src/api/pomdp_py.problems.multi_object_search.env.rst create mode 100644 docs/_sphinx_src/api/pomdp_py.problems.multi_object_search.models.components.rst create mode 100644 docs/_sphinx_src/api/pomdp_py.problems.multi_object_search.models.rst create mode 100644 docs/_sphinx_src/api/pomdp_py.problems.multi_object_search.rst create mode 100644 docs/_sphinx_src/api/pomdp_py.problems.rocksample.cythonize.rst create mode 100644 docs/_sphinx_src/api/pomdp_py.problems.rocksample.rst create mode 100644 docs/_sphinx_src/api/pomdp_py.problems.rst create mode 100644 docs/_sphinx_src/api/pomdp_py.problems.tag.agent.rst create mode 100644 docs/_sphinx_src/api/pomdp_py.problems.tag.domain.rst create mode 100644 docs/_sphinx_src/api/pomdp_py.problems.tag.env.rst create mode 100644 docs/_sphinx_src/api/pomdp_py.problems.tag.models.components.rst create mode 100644 docs/_sphinx_src/api/pomdp_py.problems.tag.models.rst create mode 100644 docs/_sphinx_src/api/pomdp_py.problems.tag.rst create mode 100644 docs/_sphinx_src/api/pomdp_py.problems.tiger.cythonize.rst create mode 100644 docs/_sphinx_src/api/pomdp_py.problems.tiger.rst delete mode 100644 docs/_sphinx_src/problems/modules.rst delete mode 100644 docs/_sphinx_src/problems/pomdp_problems.lasertag.rst delete mode 100644 docs/_sphinx_src/problems/pomdp_problems.light_dark.agent.rst delete mode 100644 docs/_sphinx_src/problems/pomdp_problems.light_dark.domain.rst delete mode 100644 docs/_sphinx_src/problems/pomdp_problems.light_dark.env.rst delete mode 100644 docs/_sphinx_src/problems/pomdp_problems.light_dark.models.rst delete mode 100644 docs/_sphinx_src/problems/pomdp_problems.light_dark.rst delete mode 100644 docs/_sphinx_src/problems/pomdp_problems.load_unload.rst delete mode 100644 docs/_sphinx_src/problems/pomdp_problems.maze.domain.rst delete mode 100644 docs/_sphinx_src/problems/pomdp_problems.maze.env.rst delete mode 100644 docs/_sphinx_src/problems/pomdp_problems.maze.models.components.rst delete mode 100644 docs/_sphinx_src/problems/pomdp_problems.maze.models.rst delete mode 100644 docs/_sphinx_src/problems/pomdp_problems.maze.rst delete mode 100644 docs/_sphinx_src/problems/pomdp_problems.multi_object_search.agent.rst delete mode 100644 docs/_sphinx_src/problems/pomdp_problems.multi_object_search.domain.rst delete mode 100644 docs/_sphinx_src/problems/pomdp_problems.multi_object_search.env.rst delete mode 100644 docs/_sphinx_src/problems/pomdp_problems.multi_object_search.models.components.rst delete mode 100644 docs/_sphinx_src/problems/pomdp_problems.multi_object_search.models.rst delete mode 100644 docs/_sphinx_src/problems/pomdp_problems.multi_object_search.rst delete mode 100644 docs/_sphinx_src/problems/pomdp_problems.rocksample.cythonize.rst delete mode 100644 docs/_sphinx_src/problems/pomdp_problems.rocksample.rst delete mode 100644 docs/_sphinx_src/problems/pomdp_problems.rst delete mode 100644 docs/_sphinx_src/problems/pomdp_problems.tag.domain.rst delete mode 100644 docs/_sphinx_src/problems/pomdp_problems.tag.env.rst delete mode 100644 docs/_sphinx_src/problems/pomdp_problems.tag.models.components.rst delete mode 100644 docs/_sphinx_src/problems/pomdp_problems.tag.models.rst delete mode 100644 docs/_sphinx_src/problems/pomdp_problems.tag.rst delete mode 100644 docs/_sphinx_src/problems/pomdp_problems.tiger.cythonize.rst delete mode 100644 docs/_sphinx_src/problems/pomdp_problems.tiger.rst delete mode 100644 docs/html/_modules/pomdp_problems/light_dark/domain/action.html delete mode 100644 docs/html/_modules/pomdp_problems/light_dark/domain/observation.html delete mode 100644 docs/html/_modules/pomdp_problems/light_dark/domain/state.html delete mode 100644 docs/html/_modules/pomdp_problems/light_dark/env/visual.html delete mode 100644 docs/html/_modules/pomdp_problems/light_dark/models/observation_model.html delete mode 100644 docs/html/_modules/pomdp_problems/light_dark/models/transition_model.html delete mode 100644 docs/html/_modules/pomdp_problems/light_dark/problem_discrete.html delete mode 100644 docs/html/_modules/pomdp_problems/load_unload/load_unload.html delete mode 100644 docs/html/_modules/pomdp_problems/multi_object_search/agent/agent.html delete mode 100644 docs/html/_modules/pomdp_problems/multi_object_search/env/visual.html delete mode 100644 docs/html/_modules/pomdp_problems/multi_object_search/problem.html delete mode 100644 docs/html/_modules/pomdp_problems/tag/env/env.html delete mode 100644 docs/html/_modules/pomdp_problems/tag/env/visual.html delete mode 100644 docs/html/_modules/pomdp_problems/tag/experiment.html delete mode 100644 docs/html/_modules/pomdp_problems/tag/problem.html delete mode 100644 docs/html/_modules/pomdp_py/algorithms/visual/visual.html rename docs/html/_modules/{pomdp_problems => pomdp_py/problems}/light_dark/env/env.html (63%) rename docs/html/_modules/{pomdp_problems => pomdp_py/problems}/maze/domain/observation.html (58%) rename docs/html/_modules/{pomdp_problems => pomdp_py/problems}/maze/domain/state.html (69%) rename docs/html/_modules/{pomdp_problems => pomdp_py/problems}/maze/env/env.html (52%) create mode 100644 docs/html/_modules/pomdp_py/problems/multi_object_search/agent/agent.html rename docs/html/_modules/{pomdp_problems => pomdp_py/problems}/multi_object_search/agent/belief.html (76%) rename docs/html/_modules/{pomdp_problems => pomdp_py/problems}/multi_object_search/domain/action.html (56%) rename docs/html/_modules/{pomdp_problems => pomdp_py/problems}/multi_object_search/domain/observation.html (58%) rename docs/html/_modules/{pomdp_problems => pomdp_py/problems}/multi_object_search/domain/state.html (50%) rename docs/html/_modules/{pomdp_problems => pomdp_py/problems}/multi_object_search/env/env.html (72%) rename docs/html/_modules/{pomdp_problems => pomdp_py/problems}/multi_object_search/example_worlds.html (74%) rename docs/html/_modules/{pomdp_problems => pomdp_py/problems}/multi_object_search/models/components/grid_map.html (59%) rename docs/html/_modules/{pomdp_problems => pomdp_py/problems}/multi_object_search/models/components/sensor.html (56%) rename docs/html/_modules/{pomdp_problems => pomdp_py/problems}/multi_object_search/models/observation_model.html (63%) rename docs/html/_modules/{pomdp_problems => pomdp_py/problems}/multi_object_search/models/policy_model.html (52%) rename docs/html/_modules/{pomdp_problems => pomdp_py/problems}/multi_object_search/models/reward_model.html (56%) rename docs/html/_modules/{pomdp_problems => pomdp_py/problems}/multi_object_search/models/transition_model.html (55%) rename docs/html/_modules/{pomdp_problems => pomdp_py/problems}/rocksample/rocksample_problem.html (69%) rename docs/html/_modules/{pomdp_problems => pomdp_py/problems}/tag/agent/agent.html (59%) rename docs/html/_modules/{pomdp_problems => pomdp_py/problems}/tag/domain/action.html (55%) rename docs/html/_modules/{pomdp_problems => pomdp_py/problems}/tag/domain/observation.html (61%) rename docs/html/_modules/{pomdp_problems => pomdp_py/problems}/tag/domain/state.html (61%) rename docs/html/_modules/{pomdp_problems => pomdp_py/problems}/tag/models/components/grid_map.html (54%) rename docs/html/_modules/{pomdp_problems => pomdp_py/problems}/tag/models/components/motion_policy.html (54%) rename docs/html/_modules/{pomdp_problems => pomdp_py/problems}/tag/models/observation_model.html (55%) rename docs/html/_modules/{pomdp_problems => pomdp_py/problems}/tag/models/policy_model.html (52%) rename docs/html/_modules/{pomdp_problems => pomdp_py/problems}/tag/models/reward_model.html (59%) rename docs/html/_modules/{pomdp_problems => pomdp_py/problems}/tag/models/transition_model.html (56%) rename docs/html/_modules/{pomdp_problems => pomdp_py/problems}/tiger/tiger_problem.html (61%) delete mode 100644 docs/html/_modules/pomdp_py/utils/interfaces/simple_rl.html delete mode 100644 docs/html/_modules/pomdp_py/utils/plotting.html delete mode 100644 docs/html/_modules/pomdp_py/utils/test_utils.html delete mode 100644 docs/html/_modules/pomdp_py/utils/util.html delete mode 100644 docs/html/_modules/pomdp_py/visual/search_tree.html create mode 100644 docs/html/_sources/api/pomdp_py.problems.lasertag.rst.txt create mode 100644 docs/html/_sources/api/pomdp_py.problems.light_dark.agent.rst.txt create mode 100644 docs/html/_sources/api/pomdp_py.problems.light_dark.domain.rst.txt create mode 100644 docs/html/_sources/api/pomdp_py.problems.light_dark.env.rst.txt create mode 100644 docs/html/_sources/api/pomdp_py.problems.light_dark.models.rst.txt create mode 100644 docs/html/_sources/api/pomdp_py.problems.light_dark.rst.txt create mode 100644 docs/html/_sources/api/pomdp_py.problems.load_unload.rst.txt create mode 100644 docs/html/_sources/api/pomdp_py.problems.maze.domain.rst.txt rename docs/{_sphinx_src/problems/pomdp_problems.tag.agent.rst => html/_sources/api/pomdp_py.problems.maze.env.rst.txt} (50%) create mode 100644 docs/html/_sources/api/pomdp_py.problems.maze.models.components.rst.txt create mode 100644 docs/html/_sources/api/pomdp_py.problems.maze.models.rst.txt create mode 100644 docs/html/_sources/api/pomdp_py.problems.maze.rst.txt create mode 100644 docs/html/_sources/api/pomdp_py.problems.multi_object_search.agent.rst.txt create mode 100644 docs/html/_sources/api/pomdp_py.problems.multi_object_search.domain.rst.txt create mode 100644 docs/html/_sources/api/pomdp_py.problems.multi_object_search.env.rst.txt create mode 100644 docs/html/_sources/api/pomdp_py.problems.multi_object_search.models.components.rst.txt create mode 100644 docs/html/_sources/api/pomdp_py.problems.multi_object_search.models.rst.txt create mode 100644 docs/html/_sources/api/pomdp_py.problems.multi_object_search.rst.txt create mode 100644 docs/html/_sources/api/pomdp_py.problems.rocksample.cythonize.rst.txt create mode 100644 docs/html/_sources/api/pomdp_py.problems.rocksample.rst.txt create mode 100644 docs/html/_sources/api/pomdp_py.problems.rst.txt create mode 100644 docs/html/_sources/api/pomdp_py.problems.tag.agent.rst.txt create mode 100644 docs/html/_sources/api/pomdp_py.problems.tag.domain.rst.txt create mode 100644 docs/html/_sources/api/pomdp_py.problems.tag.env.rst.txt create mode 100644 docs/html/_sources/api/pomdp_py.problems.tag.models.components.rst.txt create mode 100644 docs/html/_sources/api/pomdp_py.problems.tag.models.rst.txt create mode 100644 docs/html/_sources/api/pomdp_py.problems.tag.rst.txt create mode 100644 docs/html/_sources/api/pomdp_py.problems.tiger.cythonize.rst.txt create mode 100644 docs/html/_sources/api/pomdp_py.problems.tiger.rst.txt delete mode 100644 docs/html/_sources/api/utilsss.rst.txt delete mode 100644 docs/html/_sources/changelog.rst.txt delete mode 100644 docs/html/_sources/example.action_prior.rst.txt delete mode 100644 docs/html/_sources/problems/modules.rst.txt delete mode 100644 docs/html/_sources/problems/pomdp_problems.lasertag.rst.txt delete mode 100644 docs/html/_sources/problems/pomdp_problems.light_dark.agent.rst.txt delete mode 100644 docs/html/_sources/problems/pomdp_problems.light_dark.domain.rst.txt delete mode 100644 docs/html/_sources/problems/pomdp_problems.light_dark.env.rst.txt delete mode 100644 docs/html/_sources/problems/pomdp_problems.light_dark.models.rst.txt delete mode 100644 docs/html/_sources/problems/pomdp_problems.light_dark.rst.txt delete mode 100644 docs/html/_sources/problems/pomdp_problems.load_unload.rst.txt delete mode 100644 docs/html/_sources/problems/pomdp_problems.maze.domain.rst.txt delete mode 100644 docs/html/_sources/problems/pomdp_problems.maze.env.rst.txt delete mode 100644 docs/html/_sources/problems/pomdp_problems.maze.models.components.rst.txt delete mode 100644 docs/html/_sources/problems/pomdp_problems.maze.models.rst.txt delete mode 100644 docs/html/_sources/problems/pomdp_problems.maze.rst.txt delete mode 100644 docs/html/_sources/problems/pomdp_problems.multi_object_search.agent.rst.txt delete mode 100644 docs/html/_sources/problems/pomdp_problems.multi_object_search.domain.rst.txt delete mode 100644 docs/html/_sources/problems/pomdp_problems.multi_object_search.env.rst.txt delete mode 100644 docs/html/_sources/problems/pomdp_problems.multi_object_search.models.components.rst.txt delete mode 100644 docs/html/_sources/problems/pomdp_problems.multi_object_search.models.rst.txt delete mode 100644 docs/html/_sources/problems/pomdp_problems.multi_object_search.rst.txt delete mode 100644 docs/html/_sources/problems/pomdp_problems.rocksample.cythonize.rst.txt delete mode 100644 docs/html/_sources/problems/pomdp_problems.rocksample.rst.txt delete mode 100644 docs/html/_sources/problems/pomdp_problems.rst.txt delete mode 100644 docs/html/_sources/problems/pomdp_problems.tag.domain.rst.txt delete mode 100644 docs/html/_sources/problems/pomdp_problems.tag.env.rst.txt delete mode 100644 docs/html/_sources/problems/pomdp_problems.tag.models.components.rst.txt delete mode 100644 docs/html/_sources/problems/pomdp_problems.tag.models.rst.txt delete mode 100644 docs/html/_sources/problems/pomdp_problems.tag.rst.txt delete mode 100644 docs/html/_sources/problems/pomdp_problems.tiger.cythonize.rst.txt delete mode 100644 docs/html/_sources/problems/pomdp_problems.tiger.rst.txt delete mode 100644 docs/html/_static/jquery-3.5.1.js delete mode 100644 docs/html/_static/jquery.js delete mode 100644 docs/html/_static/underscore-1.13.1.js delete mode 100644 docs/html/_static/underscore.js create mode 100644 docs/html/api/pomdp_py.problems.html rename docs/html/{problems/pomdp_problems.lasertag.html => api/pomdp_py.problems.lasertag.html} (71%) rename docs/html/{problems/pomdp_problems.maze.html => api/pomdp_py.problems.light_dark.agent.html} (57%) create mode 100644 docs/html/api/pomdp_py.problems.light_dark.domain.html create mode 100644 docs/html/api/pomdp_py.problems.light_dark.env.html create mode 100644 docs/html/api/pomdp_py.problems.light_dark.html create mode 100644 docs/html/api/pomdp_py.problems.light_dark.models.html rename docs/html/{problems/pomdp_problems.maze.models.components.html => api/pomdp_py.problems.load_unload.html} (63%) create mode 100644 docs/html/api/pomdp_py.problems.maze.domain.html rename docs/html/{problems/pomdp_problems.maze.env.html => api/pomdp_py.problems.maze.env.html} (56%) create mode 100644 docs/html/api/pomdp_py.problems.maze.html create mode 100644 docs/html/api/pomdp_py.problems.maze.models.components.html rename docs/html/{problems/pomdp_problems.maze.models.html => api/pomdp_py.problems.maze.models.html} (66%) create mode 100644 docs/html/api/pomdp_py.problems.multi_object_search.agent.html create mode 100644 docs/html/api/pomdp_py.problems.multi_object_search.domain.html create mode 100644 docs/html/api/pomdp_py.problems.multi_object_search.env.html create mode 100644 docs/html/api/pomdp_py.problems.multi_object_search.html create mode 100644 docs/html/api/pomdp_py.problems.multi_object_search.models.components.html create mode 100644 docs/html/api/pomdp_py.problems.multi_object_search.models.html create mode 100644 docs/html/api/pomdp_py.problems.rocksample.cythonize.html create mode 100644 docs/html/api/pomdp_py.problems.rocksample.html create mode 100644 docs/html/api/pomdp_py.problems.tag.agent.html create mode 100644 docs/html/api/pomdp_py.problems.tag.domain.html create mode 100644 docs/html/api/pomdp_py.problems.tag.env.html create mode 100644 docs/html/api/pomdp_py.problems.tag.html create mode 100644 docs/html/api/pomdp_py.problems.tag.models.components.html create mode 100644 docs/html/api/pomdp_py.problems.tag.models.html create mode 100644 docs/html/api/pomdp_py.problems.tiger.cythonize.html create mode 100644 docs/html/api/pomdp_py.problems.tiger.html delete mode 100644 docs/html/api/utilsss.html delete mode 100644 docs/html/changelog.html delete mode 100644 docs/html/example.action_prior.html delete mode 100644 docs/html/problems/modules.html delete mode 100644 docs/html/problems/pomdp_problems.html delete mode 100644 docs/html/problems/pomdp_problems.light_dark.agent.html delete mode 100644 docs/html/problems/pomdp_problems.light_dark.domain.html delete mode 100644 docs/html/problems/pomdp_problems.light_dark.env.html delete mode 100644 docs/html/problems/pomdp_problems.light_dark.html delete mode 100644 docs/html/problems/pomdp_problems.light_dark.models.html delete mode 100644 docs/html/problems/pomdp_problems.load_unload.html delete mode 100644 docs/html/problems/pomdp_problems.maze.domain.html delete mode 100644 docs/html/problems/pomdp_problems.multi_object_search.agent.html delete mode 100644 docs/html/problems/pomdp_problems.multi_object_search.domain.html delete mode 100644 docs/html/problems/pomdp_problems.multi_object_search.env.html delete mode 100644 docs/html/problems/pomdp_problems.multi_object_search.html delete mode 100644 docs/html/problems/pomdp_problems.multi_object_search.models.components.html delete mode 100644 docs/html/problems/pomdp_problems.multi_object_search.models.html delete mode 100644 docs/html/problems/pomdp_problems.rocksample.cythonize.html delete mode 100644 docs/html/problems/pomdp_problems.rocksample.html delete mode 100644 docs/html/problems/pomdp_problems.tag.agent.html delete mode 100644 docs/html/problems/pomdp_problems.tag.domain.html delete mode 100644 docs/html/problems/pomdp_problems.tag.env.html delete mode 100644 docs/html/problems/pomdp_problems.tag.html delete mode 100644 docs/html/problems/pomdp_problems.tag.models.components.html delete mode 100644 docs/html/problems/pomdp_problems.tag.models.html delete mode 100644 docs/html/problems/pomdp_problems.tiger.cythonize.html delete mode 100644 docs/html/problems/pomdp_problems.tiger.html diff --git a/docs/_sphinx_src/api/pomdp_py.problems.lasertag.rst b/docs/_sphinx_src/api/pomdp_py.problems.lasertag.rst new file mode 100644 index 00000000..1c5004c3 --- /dev/null +++ b/docs/_sphinx_src/api/pomdp_py.problems.lasertag.rst @@ -0,0 +1,10 @@ +pomdp\_py.problems.lasertag package +=================================== + +Module contents +--------------- + +.. automodule:: pomdp_py.problems.lasertag + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/_sphinx_src/api/pomdp_py.problems.light_dark.agent.rst b/docs/_sphinx_src/api/pomdp_py.problems.light_dark.agent.rst new file mode 100644 index 00000000..45ccca7c --- /dev/null +++ b/docs/_sphinx_src/api/pomdp_py.problems.light_dark.agent.rst @@ -0,0 +1,21 @@ +pomdp\_py.problems.light\_dark.agent package +============================================ + +Submodules +---------- + +pomdp\_py.problems.light\_dark.agent.belief module +-------------------------------------------------- + +.. automodule:: pomdp_py.problems.light_dark.agent.belief + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: pomdp_py.problems.light_dark.agent + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/_sphinx_src/api/pomdp_py.problems.light_dark.domain.rst b/docs/_sphinx_src/api/pomdp_py.problems.light_dark.domain.rst new file mode 100644 index 00000000..f9085634 --- /dev/null +++ b/docs/_sphinx_src/api/pomdp_py.problems.light_dark.domain.rst @@ -0,0 +1,37 @@ +pomdp\_py.problems.light\_dark.domain package +============================================= + +Submodules +---------- + +pomdp\_py.problems.light\_dark.domain.action module +--------------------------------------------------- + +.. automodule:: pomdp_py.problems.light_dark.domain.action + :members: + :undoc-members: + :show-inheritance: + +pomdp\_py.problems.light\_dark.domain.observation module +-------------------------------------------------------- + +.. automodule:: pomdp_py.problems.light_dark.domain.observation + :members: + :undoc-members: + :show-inheritance: + +pomdp\_py.problems.light\_dark.domain.state module +-------------------------------------------------- + +.. automodule:: pomdp_py.problems.light_dark.domain.state + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: pomdp_py.problems.light_dark.domain + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/_sphinx_src/api/pomdp_py.problems.light_dark.env.rst b/docs/_sphinx_src/api/pomdp_py.problems.light_dark.env.rst new file mode 100644 index 00000000..18e4bd09 --- /dev/null +++ b/docs/_sphinx_src/api/pomdp_py.problems.light_dark.env.rst @@ -0,0 +1,37 @@ +pomdp\_py.problems.light\_dark.env package +========================================== + +Submodules +---------- + +pomdp\_py.problems.light\_dark.env.env module +--------------------------------------------- + +.. automodule:: pomdp_py.problems.light_dark.env.env + :members: + :undoc-members: + :show-inheritance: + +pomdp\_py.problems.light\_dark.env.plotting module +-------------------------------------------------- + +.. automodule:: pomdp_py.problems.light_dark.env.plotting + :members: + :undoc-members: + :show-inheritance: + +pomdp\_py.problems.light\_dark.env.visual module +------------------------------------------------ + +.. automodule:: pomdp_py.problems.light_dark.env.visual + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: pomdp_py.problems.light_dark.env + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/_sphinx_src/api/pomdp_py.problems.light_dark.models.rst b/docs/_sphinx_src/api/pomdp_py.problems.light_dark.models.rst new file mode 100644 index 00000000..022477f0 --- /dev/null +++ b/docs/_sphinx_src/api/pomdp_py.problems.light_dark.models.rst @@ -0,0 +1,29 @@ +pomdp\_py.problems.light\_dark.models package +============================================= + +Submodules +---------- + +pomdp\_py.problems.light\_dark.models.observation\_model module +--------------------------------------------------------------- + +.. automodule:: pomdp_py.problems.light_dark.models.observation_model + :members: + :undoc-members: + :show-inheritance: + +pomdp\_py.problems.light\_dark.models.transition\_model module +-------------------------------------------------------------- + +.. automodule:: pomdp_py.problems.light_dark.models.transition_model + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: pomdp_py.problems.light_dark.models + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/_sphinx_src/api/pomdp_py.problems.light_dark.rst b/docs/_sphinx_src/api/pomdp_py.problems.light_dark.rst new file mode 100644 index 00000000..3dc382ef --- /dev/null +++ b/docs/_sphinx_src/api/pomdp_py.problems.light_dark.rst @@ -0,0 +1,40 @@ +pomdp\_py.problems.light\_dark package +====================================== + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + pomdp_py.problems.light_dark.agent + pomdp_py.problems.light_dark.domain + pomdp_py.problems.light_dark.env + pomdp_py.problems.light_dark.models + +Submodules +---------- + +pomdp\_py.problems.light\_dark.problem\_discrete module +------------------------------------------------------- + +.. automodule:: pomdp_py.problems.light_dark.problem_discrete + :members: + :undoc-members: + :show-inheritance: + +pomdp\_py.problems.light\_dark.test module +------------------------------------------ + +.. automodule:: pomdp_py.problems.light_dark.test + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: pomdp_py.problems.light_dark + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/_sphinx_src/api/pomdp_py.problems.load_unload.rst b/docs/_sphinx_src/api/pomdp_py.problems.load_unload.rst new file mode 100644 index 00000000..0c600479 --- /dev/null +++ b/docs/_sphinx_src/api/pomdp_py.problems.load_unload.rst @@ -0,0 +1,21 @@ +pomdp\_py.problems.load\_unload package +======================================= + +Submodules +---------- + +pomdp\_py.problems.load\_unload.load\_unload module +--------------------------------------------------- + +.. automodule:: pomdp_py.problems.load_unload.load_unload + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: pomdp_py.problems.load_unload + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/_sphinx_src/api/pomdp_py.problems.maze.domain.rst b/docs/_sphinx_src/api/pomdp_py.problems.maze.domain.rst new file mode 100644 index 00000000..0b5cc6fe --- /dev/null +++ b/docs/_sphinx_src/api/pomdp_py.problems.maze.domain.rst @@ -0,0 +1,37 @@ +pomdp\_py.problems.maze.domain package +====================================== + +Submodules +---------- + +pomdp\_py.problems.maze.domain.action module +-------------------------------------------- + +.. automodule:: pomdp_py.problems.maze.domain.action + :members: + :undoc-members: + :show-inheritance: + +pomdp\_py.problems.maze.domain.observation module +------------------------------------------------- + +.. automodule:: pomdp_py.problems.maze.domain.observation + :members: + :undoc-members: + :show-inheritance: + +pomdp\_py.problems.maze.domain.state module +------------------------------------------- + +.. automodule:: pomdp_py.problems.maze.domain.state + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: pomdp_py.problems.maze.domain + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/html/_sources/problems/pomdp_problems.tag.agent.rst.txt b/docs/_sphinx_src/api/pomdp_py.problems.maze.env.rst similarity index 50% rename from docs/html/_sources/problems/pomdp_problems.tag.agent.rst.txt rename to docs/_sphinx_src/api/pomdp_py.problems.maze.env.rst index 16fb132a..84cc2e27 100644 --- a/docs/html/_sources/problems/pomdp_problems.tag.agent.rst.txt +++ b/docs/_sphinx_src/api/pomdp_py.problems.maze.env.rst @@ -1,22 +1,21 @@ -pomdp\_problems.tag.agent package -================================= +pomdp\_py.problems.maze.env package +=================================== Submodules ---------- -pomdp\_problems.tag.agent.agent module +pomdp\_py.problems.maze.env.env module -------------------------------------- -.. automodule:: pomdp_problems.tag.agent.agent +.. automodule:: pomdp_py.problems.maze.env.env :members: :undoc-members: :show-inheritance: - Module contents --------------- -.. automodule:: pomdp_problems.tag.agent +.. automodule:: pomdp_py.problems.maze.env :members: :undoc-members: :show-inheritance: diff --git a/docs/_sphinx_src/api/pomdp_py.problems.maze.models.components.rst b/docs/_sphinx_src/api/pomdp_py.problems.maze.models.components.rst new file mode 100644 index 00000000..07b37582 --- /dev/null +++ b/docs/_sphinx_src/api/pomdp_py.problems.maze.models.components.rst @@ -0,0 +1,21 @@ +pomdp\_py.problems.maze.models.components package +================================================= + +Submodules +---------- + +pomdp\_py.problems.maze.models.components.map module +---------------------------------------------------- + +.. automodule:: pomdp_py.problems.maze.models.components.map + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: pomdp_py.problems.maze.models.components + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/_sphinx_src/api/pomdp_py.problems.maze.models.rst b/docs/_sphinx_src/api/pomdp_py.problems.maze.models.rst new file mode 100644 index 00000000..421150f2 --- /dev/null +++ b/docs/_sphinx_src/api/pomdp_py.problems.maze.models.rst @@ -0,0 +1,18 @@ +pomdp\_py.problems.maze.models package +====================================== + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + pomdp_py.problems.maze.models.components + +Module contents +--------------- + +.. automodule:: pomdp_py.problems.maze.models + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/_sphinx_src/api/pomdp_py.problems.maze.rst b/docs/_sphinx_src/api/pomdp_py.problems.maze.rst new file mode 100644 index 00000000..b30ee522 --- /dev/null +++ b/docs/_sphinx_src/api/pomdp_py.problems.maze.rst @@ -0,0 +1,20 @@ +pomdp\_py.problems.maze package +=============================== + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + pomdp_py.problems.maze.domain + pomdp_py.problems.maze.env + pomdp_py.problems.maze.models + +Module contents +--------------- + +.. automodule:: pomdp_py.problems.maze + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/_sphinx_src/api/pomdp_py.problems.multi_object_search.agent.rst b/docs/_sphinx_src/api/pomdp_py.problems.multi_object_search.agent.rst new file mode 100644 index 00000000..353bef2c --- /dev/null +++ b/docs/_sphinx_src/api/pomdp_py.problems.multi_object_search.agent.rst @@ -0,0 +1,29 @@ +pomdp\_py.problems.multi\_object\_search.agent package +====================================================== + +Submodules +---------- + +pomdp\_py.problems.multi\_object\_search.agent.agent module +----------------------------------------------------------- + +.. automodule:: pomdp_py.problems.multi_object_search.agent.agent + :members: + :undoc-members: + :show-inheritance: + +pomdp\_py.problems.multi\_object\_search.agent.belief module +------------------------------------------------------------ + +.. automodule:: pomdp_py.problems.multi_object_search.agent.belief + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: pomdp_py.problems.multi_object_search.agent + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/_sphinx_src/api/pomdp_py.problems.multi_object_search.domain.rst b/docs/_sphinx_src/api/pomdp_py.problems.multi_object_search.domain.rst new file mode 100644 index 00000000..1fca83d1 --- /dev/null +++ b/docs/_sphinx_src/api/pomdp_py.problems.multi_object_search.domain.rst @@ -0,0 +1,37 @@ +pomdp\_py.problems.multi\_object\_search.domain package +======================================================= + +Submodules +---------- + +pomdp\_py.problems.multi\_object\_search.domain.action module +------------------------------------------------------------- + +.. automodule:: pomdp_py.problems.multi_object_search.domain.action + :members: + :undoc-members: + :show-inheritance: + +pomdp\_py.problems.multi\_object\_search.domain.observation module +------------------------------------------------------------------ + +.. automodule:: pomdp_py.problems.multi_object_search.domain.observation + :members: + :undoc-members: + :show-inheritance: + +pomdp\_py.problems.multi\_object\_search.domain.state module +------------------------------------------------------------ + +.. automodule:: pomdp_py.problems.multi_object_search.domain.state + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: pomdp_py.problems.multi_object_search.domain + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/_sphinx_src/api/pomdp_py.problems.multi_object_search.env.rst b/docs/_sphinx_src/api/pomdp_py.problems.multi_object_search.env.rst new file mode 100644 index 00000000..e03506f0 --- /dev/null +++ b/docs/_sphinx_src/api/pomdp_py.problems.multi_object_search.env.rst @@ -0,0 +1,29 @@ +pomdp\_py.problems.multi\_object\_search.env package +==================================================== + +Submodules +---------- + +pomdp\_py.problems.multi\_object\_search.env.env module +------------------------------------------------------- + +.. automodule:: pomdp_py.problems.multi_object_search.env.env + :members: + :undoc-members: + :show-inheritance: + +pomdp\_py.problems.multi\_object\_search.env.visual module +---------------------------------------------------------- + +.. automodule:: pomdp_py.problems.multi_object_search.env.visual + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: pomdp_py.problems.multi_object_search.env + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/_sphinx_src/api/pomdp_py.problems.multi_object_search.models.components.rst b/docs/_sphinx_src/api/pomdp_py.problems.multi_object_search.models.components.rst new file mode 100644 index 00000000..aa2b1488 --- /dev/null +++ b/docs/_sphinx_src/api/pomdp_py.problems.multi_object_search.models.components.rst @@ -0,0 +1,29 @@ +pomdp\_py.problems.multi\_object\_search.models.components package +================================================================== + +Submodules +---------- + +pomdp\_py.problems.multi\_object\_search.models.components.grid\_map module +--------------------------------------------------------------------------- + +.. automodule:: pomdp_py.problems.multi_object_search.models.components.grid_map + :members: + :undoc-members: + :show-inheritance: + +pomdp\_py.problems.multi\_object\_search.models.components.sensor module +------------------------------------------------------------------------ + +.. automodule:: pomdp_py.problems.multi_object_search.models.components.sensor + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: pomdp_py.problems.multi_object_search.models.components + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/_sphinx_src/api/pomdp_py.problems.multi_object_search.models.rst b/docs/_sphinx_src/api/pomdp_py.problems.multi_object_search.models.rst new file mode 100644 index 00000000..b66be864 --- /dev/null +++ b/docs/_sphinx_src/api/pomdp_py.problems.multi_object_search.models.rst @@ -0,0 +1,53 @@ +pomdp\_py.problems.multi\_object\_search.models package +======================================================= + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + pomdp_py.problems.multi_object_search.models.components + +Submodules +---------- + +pomdp\_py.problems.multi\_object\_search.models.observation\_model module +------------------------------------------------------------------------- + +.. automodule:: pomdp_py.problems.multi_object_search.models.observation_model + :members: + :undoc-members: + :show-inheritance: + +pomdp\_py.problems.multi\_object\_search.models.policy\_model module +-------------------------------------------------------------------- + +.. automodule:: pomdp_py.problems.multi_object_search.models.policy_model + :members: + :undoc-members: + :show-inheritance: + +pomdp\_py.problems.multi\_object\_search.models.reward\_model module +-------------------------------------------------------------------- + +.. automodule:: pomdp_py.problems.multi_object_search.models.reward_model + :members: + :undoc-members: + :show-inheritance: + +pomdp\_py.problems.multi\_object\_search.models.transition\_model module +------------------------------------------------------------------------ + +.. automodule:: pomdp_py.problems.multi_object_search.models.transition_model + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: pomdp_py.problems.multi_object_search.models + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/_sphinx_src/api/pomdp_py.problems.multi_object_search.rst b/docs/_sphinx_src/api/pomdp_py.problems.multi_object_search.rst new file mode 100644 index 00000000..229f9e56 --- /dev/null +++ b/docs/_sphinx_src/api/pomdp_py.problems.multi_object_search.rst @@ -0,0 +1,40 @@ +pomdp\_py.problems.multi\_object\_search package +================================================ + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + pomdp_py.problems.multi_object_search.agent + pomdp_py.problems.multi_object_search.domain + pomdp_py.problems.multi_object_search.env + pomdp_py.problems.multi_object_search.models + +Submodules +---------- + +pomdp\_py.problems.multi\_object\_search.example\_worlds module +--------------------------------------------------------------- + +.. automodule:: pomdp_py.problems.multi_object_search.example_worlds + :members: + :undoc-members: + :show-inheritance: + +pomdp\_py.problems.multi\_object\_search.problem module +------------------------------------------------------- + +.. automodule:: pomdp_py.problems.multi_object_search.problem + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: pomdp_py.problems.multi_object_search + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/_sphinx_src/api/pomdp_py.problems.rocksample.cythonize.rst b/docs/_sphinx_src/api/pomdp_py.problems.rocksample.cythonize.rst new file mode 100644 index 00000000..ef083571 --- /dev/null +++ b/docs/_sphinx_src/api/pomdp_py.problems.rocksample.cythonize.rst @@ -0,0 +1,53 @@ +pomdp\_py.problems.rocksample.cythonize package +=============================================== + +Submodules +---------- + +pomdp\_py.problems.rocksample.cythonize.rocksample\_problem module +------------------------------------------------------------------ + +.. automodule:: pomdp_py.problems.rocksample.cythonize.rocksample_problem + :members: + :undoc-members: + :show-inheritance: + +pomdp\_py.problems.rocksample.cythonize.rocksample\_problem module +------------------------------------------------------------------ + +.. automodule:: pomdp_py.problems.rocksample.cythonize.rocksample_problem + :members: + :undoc-members: + :show-inheritance: + +pomdp\_py.problems.rocksample.cythonize.rocksample\_problem module +------------------------------------------------------------------ + +.. automodule:: pomdp_py.problems.rocksample.cythonize.rocksample_problem + :members: + :undoc-members: + :show-inheritance: + +pomdp\_py.problems.rocksample.cythonize.rocksample\_problem module +------------------------------------------------------------------ + +.. automodule:: pomdp_py.problems.rocksample.cythonize.rocksample_problem + :members: + :undoc-members: + :show-inheritance: + +pomdp\_py.problems.rocksample.cythonize.run\_rocksample module +-------------------------------------------------------------- + +.. automodule:: pomdp_py.problems.rocksample.cythonize.run_rocksample + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: pomdp_py.problems.rocksample.cythonize + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/_sphinx_src/api/pomdp_py.problems.rocksample.rst b/docs/_sphinx_src/api/pomdp_py.problems.rocksample.rst new file mode 100644 index 00000000..81374a6d --- /dev/null +++ b/docs/_sphinx_src/api/pomdp_py.problems.rocksample.rst @@ -0,0 +1,37 @@ +pomdp\_py.problems.rocksample package +===================================== + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + pomdp_py.problems.rocksample.cythonize + +Submodules +---------- + +pomdp\_py.problems.rocksample.cythonize module +---------------------------------------------- + +.. automodule:: pomdp_py.problems.rocksample.cythonize + :members: + :undoc-members: + :show-inheritance: + +pomdp\_py.problems.rocksample.rocksample\_problem module +-------------------------------------------------------- + +.. automodule:: pomdp_py.problems.rocksample.rocksample_problem + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: pomdp_py.problems.rocksample + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/_sphinx_src/api/pomdp_py.problems.rst b/docs/_sphinx_src/api/pomdp_py.problems.rst new file mode 100644 index 00000000..765def69 --- /dev/null +++ b/docs/_sphinx_src/api/pomdp_py.problems.rst @@ -0,0 +1,25 @@ +pomdp\_py.problems package +========================== + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + pomdp_py.problems.lasertag + pomdp_py.problems.light_dark + pomdp_py.problems.load_unload + pomdp_py.problems.maze + pomdp_py.problems.multi_object_search + pomdp_py.problems.rocksample + pomdp_py.problems.tag + pomdp_py.problems.tiger + +Module contents +--------------- + +.. automodule:: pomdp_py.problems + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/_sphinx_src/api/pomdp_py.problems.tag.agent.rst b/docs/_sphinx_src/api/pomdp_py.problems.tag.agent.rst new file mode 100644 index 00000000..8e4c9425 --- /dev/null +++ b/docs/_sphinx_src/api/pomdp_py.problems.tag.agent.rst @@ -0,0 +1,21 @@ +pomdp\_py.problems.tag.agent package +==================================== + +Submodules +---------- + +pomdp\_py.problems.tag.agent.agent module +----------------------------------------- + +.. automodule:: pomdp_py.problems.tag.agent.agent + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: pomdp_py.problems.tag.agent + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/_sphinx_src/api/pomdp_py.problems.tag.domain.rst b/docs/_sphinx_src/api/pomdp_py.problems.tag.domain.rst new file mode 100644 index 00000000..93faeae4 --- /dev/null +++ b/docs/_sphinx_src/api/pomdp_py.problems.tag.domain.rst @@ -0,0 +1,37 @@ +pomdp\_py.problems.tag.domain package +===================================== + +Submodules +---------- + +pomdp\_py.problems.tag.domain.action module +------------------------------------------- + +.. automodule:: pomdp_py.problems.tag.domain.action + :members: + :undoc-members: + :show-inheritance: + +pomdp\_py.problems.tag.domain.observation module +------------------------------------------------ + +.. automodule:: pomdp_py.problems.tag.domain.observation + :members: + :undoc-members: + :show-inheritance: + +pomdp\_py.problems.tag.domain.state module +------------------------------------------ + +.. automodule:: pomdp_py.problems.tag.domain.state + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: pomdp_py.problems.tag.domain + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/_sphinx_src/api/pomdp_py.problems.tag.env.rst b/docs/_sphinx_src/api/pomdp_py.problems.tag.env.rst new file mode 100644 index 00000000..9527223b --- /dev/null +++ b/docs/_sphinx_src/api/pomdp_py.problems.tag.env.rst @@ -0,0 +1,29 @@ +pomdp\_py.problems.tag.env package +================================== + +Submodules +---------- + +pomdp\_py.problems.tag.env.env module +------------------------------------- + +.. automodule:: pomdp_py.problems.tag.env.env + :members: + :undoc-members: + :show-inheritance: + +pomdp\_py.problems.tag.env.visual module +---------------------------------------- + +.. automodule:: pomdp_py.problems.tag.env.visual + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: pomdp_py.problems.tag.env + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/_sphinx_src/api/pomdp_py.problems.tag.models.components.rst b/docs/_sphinx_src/api/pomdp_py.problems.tag.models.components.rst new file mode 100644 index 00000000..0e7de057 --- /dev/null +++ b/docs/_sphinx_src/api/pomdp_py.problems.tag.models.components.rst @@ -0,0 +1,29 @@ +pomdp\_py.problems.tag.models.components package +================================================ + +Submodules +---------- + +pomdp\_py.problems.tag.models.components.grid\_map module +--------------------------------------------------------- + +.. automodule:: pomdp_py.problems.tag.models.components.grid_map + :members: + :undoc-members: + :show-inheritance: + +pomdp\_py.problems.tag.models.components.motion\_policy module +-------------------------------------------------------------- + +.. automodule:: pomdp_py.problems.tag.models.components.motion_policy + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: pomdp_py.problems.tag.models.components + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/_sphinx_src/api/pomdp_py.problems.tag.models.rst b/docs/_sphinx_src/api/pomdp_py.problems.tag.models.rst new file mode 100644 index 00000000..3b658c64 --- /dev/null +++ b/docs/_sphinx_src/api/pomdp_py.problems.tag.models.rst @@ -0,0 +1,53 @@ +pomdp\_py.problems.tag.models package +===================================== + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + pomdp_py.problems.tag.models.components + +Submodules +---------- + +pomdp\_py.problems.tag.models.observation\_model module +------------------------------------------------------- + +.. automodule:: pomdp_py.problems.tag.models.observation_model + :members: + :undoc-members: + :show-inheritance: + +pomdp\_py.problems.tag.models.policy\_model module +-------------------------------------------------- + +.. automodule:: pomdp_py.problems.tag.models.policy_model + :members: + :undoc-members: + :show-inheritance: + +pomdp\_py.problems.tag.models.reward\_model module +-------------------------------------------------- + +.. automodule:: pomdp_py.problems.tag.models.reward_model + :members: + :undoc-members: + :show-inheritance: + +pomdp\_py.problems.tag.models.transition\_model module +------------------------------------------------------ + +.. automodule:: pomdp_py.problems.tag.models.transition_model + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: pomdp_py.problems.tag.models + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/_sphinx_src/api/pomdp_py.problems.tag.rst b/docs/_sphinx_src/api/pomdp_py.problems.tag.rst new file mode 100644 index 00000000..b14d7af6 --- /dev/null +++ b/docs/_sphinx_src/api/pomdp_py.problems.tag.rst @@ -0,0 +1,56 @@ +pomdp\_py.problems.tag package +============================== + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + pomdp_py.problems.tag.agent + pomdp_py.problems.tag.domain + pomdp_py.problems.tag.env + pomdp_py.problems.tag.models + +Submodules +---------- + +pomdp\_py.problems.tag.constants module +--------------------------------------- + +.. automodule:: pomdp_py.problems.tag.constants + :members: + :undoc-members: + :show-inheritance: + +pomdp\_py.problems.tag.example\_worlds module +--------------------------------------------- + +.. automodule:: pomdp_py.problems.tag.example_worlds + :members: + :undoc-members: + :show-inheritance: + +pomdp\_py.problems.tag.experiment module +---------------------------------------- + +.. automodule:: pomdp_py.problems.tag.experiment + :members: + :undoc-members: + :show-inheritance: + +pomdp\_py.problems.tag.problem module +------------------------------------- + +.. automodule:: pomdp_py.problems.tag.problem + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: pomdp_py.problems.tag + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/_sphinx_src/api/pomdp_py.problems.tiger.cythonize.rst b/docs/_sphinx_src/api/pomdp_py.problems.tiger.cythonize.rst new file mode 100644 index 00000000..eed7349e --- /dev/null +++ b/docs/_sphinx_src/api/pomdp_py.problems.tiger.cythonize.rst @@ -0,0 +1,53 @@ +pomdp\_py.problems.tiger.cythonize package +========================================== + +Submodules +---------- + +pomdp\_py.problems.tiger.cythonize.run\_tiger module +---------------------------------------------------- + +.. automodule:: pomdp_py.problems.tiger.cythonize.run_tiger + :members: + :undoc-members: + :show-inheritance: + +pomdp\_py.problems.tiger.cythonize.tiger\_problem module +-------------------------------------------------------- + +.. automodule:: pomdp_py.problems.tiger.cythonize.tiger_problem + :members: + :undoc-members: + :show-inheritance: + +pomdp\_py.problems.tiger.cythonize.tiger\_problem module +-------------------------------------------------------- + +.. automodule:: pomdp_py.problems.tiger.cythonize.tiger_problem + :members: + :undoc-members: + :show-inheritance: + +pomdp\_py.problems.tiger.cythonize.tiger\_problem module +-------------------------------------------------------- + +.. automodule:: pomdp_py.problems.tiger.cythonize.tiger_problem + :members: + :undoc-members: + :show-inheritance: + +pomdp\_py.problems.tiger.cythonize.tiger\_problem module +-------------------------------------------------------- + +.. automodule:: pomdp_py.problems.tiger.cythonize.tiger_problem + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: pomdp_py.problems.tiger.cythonize + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/_sphinx_src/api/pomdp_py.problems.tiger.rst b/docs/_sphinx_src/api/pomdp_py.problems.tiger.rst new file mode 100644 index 00000000..ada2838a --- /dev/null +++ b/docs/_sphinx_src/api/pomdp_py.problems.tiger.rst @@ -0,0 +1,37 @@ +pomdp\_py.problems.tiger package +================================ + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + pomdp_py.problems.tiger.cythonize + +Submodules +---------- + +pomdp\_py.problems.tiger.cythonize module +----------------------------------------- + +.. automodule:: pomdp_py.problems.tiger.cythonize + :members: + :undoc-members: + :show-inheritance: + +pomdp\_py.problems.tiger.tiger\_problem module +---------------------------------------------- + +.. automodule:: pomdp_py.problems.tiger.tiger_problem + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: pomdp_py.problems.tiger + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/_sphinx_src/building_docs.rst b/docs/_sphinx_src/building_docs.rst index 3a41ff0a..9367fd1c 100644 --- a/docs/_sphinx_src/building_docs.rst +++ b/docs/_sphinx_src/building_docs.rst @@ -4,7 +4,7 @@ Building Documentations Documentations are based on `Sphinx `_. Here we explain steps to build documentations from source, that is, to generate the documentation web pages. -There are two packages: `pomdp_py` and `pomdp_problems`. Their documentations are built separately. +There are two packages: `pomdp_py` and `pomdp_py.problems`. Their documentations are built separately. Building docs for `pomdp_py` ---------------------------- @@ -34,7 +34,7 @@ Building docs for `pomdp_py` This outputs to :code:`pomdp-py/docs/html` -Building docs for `pomdp_problems` +Building docs for `pomdp_py.problems` ---------------------------------- @@ -44,7 +44,7 @@ Building docs for `pomdp_problems` 2. Building docs for `pomdp_py`. Run :code:`sphinx-apidoc`:: - sphinx-apidoc -o problems/ ../../pomdp_problems + sphinx-apidoc -o problems/ ../../pomdp_py.problems 3. Generate web pages:: @@ -52,15 +52,15 @@ Building docs for `pomdp_problems` This outputs to :code:`pomdp-py/docs/html` -Note that when creating the documentation for a problem under :code:`pomdp_problems`, +Note that when creating the documentation for a problem under :code:`pomdp_py.problems`, you may want to re-use the README file on github for the documentation. To do that, -first create a read-me file at :code:`pomdp_problems//README.rst` with desirable +first create a read-me file at :code:`pomdp_py.problems//README.rst` with desirable content that describes the problem. Then, include this read-me file at the top of the -generated :code:`pomdp_problems..rst`, like so: +generated :code:`pomdp_py.problems..rst`, like so: .. code-block:: - .. include:: ../../../pomdp_problems//README.rst + .. include:: ../../../pomdp_py.problems//README.rst Note on Changelog diff --git a/docs/_sphinx_src/examples.external_solvers.rst b/docs/_sphinx_src/examples.external_solvers.rst index 1db92bc6..e677b2c3 100644 --- a/docs/_sphinx_src/examples.external_solvers.rst +++ b/docs/_sphinx_src/examples.external_solvers.rst @@ -28,12 +28,12 @@ If a pomdp_py :py:mod:`~pomdp_py.framework.basics.Agent` has enumerable state :m Example ~~~~~~~ -Let's use the existing :py:mod:`~pomdp_problems.tiger.tiger_problem.Tiger` problem as an example. +Let's use the existing :py:mod:`~pomdp_py.problems.tiger.tiger_problem.Tiger` problem as an example. First we create an instance of the Tiger problem: .. code-block:: python - from pomdp_problems.tiger.tiger_problem import TigerProblem, TigerState + from pomdp_py.problems.tiger.tiger_problem import TigerProblem, TigerState init_state = "tiger-left" tiger = TigerProblem(0.15, TigerState(init_state), pomdp_py.Histogram({TigerState("tiger-left"): 0.5, @@ -112,7 +112,7 @@ That means setting :code:`return_policy_graph` to False (optional). import pomdp_py from pomdp_py import vi_pruning - from pomdp_problems.tiger.tiger_problem import TigerProblem, TigerState + from pomdp_py.problems.tiger.tiger_problem import TigerProblem, TigerState # Initialize problem init_state = "tiger-left" @@ -239,7 +239,7 @@ to point to this path: import pomdp_py from pomdp_py import sarsop - from pomdp_problems.tiger.tiger_problem import TigerProblem, TigerState + from pomdp_py.problems.tiger.tiger_problem import TigerProblem, TigerState # Initialize problem init_state = "tiger-left" diff --git a/docs/_sphinx_src/examples.mos.rst b/docs/_sphinx_src/examples.mos.rst index c0840f5b..6db8695a 100644 --- a/docs/_sphinx_src/examples.mos.rst +++ b/docs/_sphinx_src/examples.mos.rst @@ -2,7 +2,7 @@ Multi-Object Search (MOS) ************************* The purpose of this example is to **introduce the conventions** when building a project that involves a more complicated POMDP whose components better be separated for maintenance and readability purposes. -We will first introduce this task at relatively high level, then introduce the conventions of the project structure. The conventions can help you organize your project, make the code more readable, and share components between different POMDPs. +We will first introduce this task at relatively high level, then introduce the conventions of the project structure. The conventions can help you organize your project, make the code more readable, and share components between different POMDPs. * :ref:`overview` * :ref:`conventions` @@ -61,10 +61,10 @@ The package structure (for our MOS implementation) is as follows: │   ├── observation.py │   └── __init__.py ├── models - │   ├── transition_model.py + │   ├── transition_model.py │   ├── observation_model.py - │   ├── reward_model.py - │   ├── policy_model.py + │   ├── reward_model.py + │   ├── policy_model.py │   ├── components │   │   ├── grid_map.py │   │   └── sensor.py @@ -78,14 +78,14 @@ The package structure (for our MOS implementation) is as follows: │   ├── visual.py │   └── __init__.py ├── problem.py - ├── example_worlds.py + ├── example_worlds.py └── __init__.py The recommendation is to separate code for `domain`, `models`, `agent` and `environment`, and have simple generic filenames. As in the above package tree, files such as :code:`state.py` or :code:`transition_model.py` are self-evident in their role. The :code:`problem.py` file is where the -:py:mod:`~pomdp_problems.multi_object_search.problem.MosOOPOMDP` class is defined, and +:py:mod:`~pomdp_py.problems.multi_object_search.problem.MosOOPOMDP` class is defined, and where the logic of `action-feedback loop` is implemented (see :doc:`examples.tiger` for more detail). @@ -99,17 +99,15 @@ To try out the MOS example problem: .. code-block:: shell - $ python -m pomdp_problems.multi_object_search.problem + $ python -m pomdp_py.problems.multi_object_search.problem A gridworld with randomly placed obstacles, targets and robot initial pose is generated; The robot is equipped with either a disk-shape sensor or a laser sensor `[source] <_modules/problems/multi_object_search/problem.html#unittest>`_. A command-line interface is not yet provided; Check :py:mod:`~problems.multi_object_search.env.env.interpret`, -:py:mod:`~pomdp_problems.multi_object_search.env.env.equip_sensors`, -:py:mod:`~pomdp_problems.multi_object_search.env.env.make_laser_sensor`, -:py:mod:`~pomdp_problems.multi_object_search.env.env.make_proximity_sensor` +:py:mod:`~pomdp_py.problems.multi_object_search.env.env.equip_sensors`, +:py:mod:`~pomdp_py.problems.multi_object_search.env.env.make_laser_sensor`, +:py:mod:`~pomdp_py.problems.multi_object_search.env.env.make_proximity_sensor` as well as previously linked source code for details about how to create your custom instance of the problem. - + .. bibliography:: refs.bib :filter: docname in docnames :style: unsrt - - diff --git a/docs/_sphinx_src/examples.tiger.rst b/docs/_sphinx_src/examples.tiger.rst index e978cafc..51d5cb81 100644 --- a/docs/_sphinx_src/examples.tiger.rst +++ b/docs/_sphinx_src/examples.tiger.rst @@ -70,7 +70,7 @@ equivalent as defining three classes that inherit self.name = name # ... __hash__, __eq__ should be implemented -`[source] <_modules/pomdp_problems/tiger/tiger_problem.html#State>`_ +`[source] <_modules/pomdp_py/problems/tiger/tiger_problem.html#State>`_ .. _define-the-models: @@ -125,7 +125,7 @@ We begin with the :py:mod:`~pomdp_py.framework.basics.ObservationModel`. In Tige space (e.g. value iteration)""" return [Observation(s) for s in {"tiger-left", "tiger-right"}] -`[source] <_modules/pomdp_problems/tiger/tiger_problem.html#ObservationModel>`_ +`[source] <_modules/pomdp_py/problems/tiger/tiger_problem.html#ObservationModel>`_ The :py:mod:`~pomdp_py.framework.basics.TransitionModel` is deterministic. Similarly, we implement the :code:`sample` and :code:`probability` functions in the interface for this generative model: @@ -157,7 +157,7 @@ The :py:mod:`~pomdp_py.framework.basics.TransitionModel` is deterministic. Simil observation space (e.g. value iteration)""" return [State(s) for s in {"tiger-left", "tiger-right"}] -`[source] <_modules/pomdp_problems/tiger/tiger_problem.html#TransitionModel>`_ +`[source] <_modules/pomdp_py/problems/tiger/tiger_problem.html#TransitionModel>`_ Since the Tiger domain is small, the transition and observation probabilities can be easily specified by a table (a dictionary in Python), which is similar to specifying POMDPs using POMDP file formats. However, pomdp_py allows more flexible way of implementing these models which can be intractable to enumerate (e.g. continuous). @@ -199,7 +199,7 @@ it becomes important. def get_all_actions(self, state=None, history=None): return PolicyModel.ACTIONS -`[source] <_modules/pomdp_problems/tiger/tiger_problem.html#PolicyModel>`_ +`[source] <_modules/pomdp_py/problems/tiger/tiger_problem.html#PolicyModel>`_ Note that the :code:`sample` function is not used directly during planning with POMCP or POUCT; Instead, the rollout policy's sampling process is defined @@ -256,7 +256,7 @@ it as follows. The interface for reward model does allow stochastic rewards. # deterministic return self._reward_func(state, action) -`[source] <_modules/pomdp_problems/tiger/tiger_problem.html#RewardModel>`_ +`[source] <_modules/pomdp_py/problems/tiger/tiger_problem.html#RewardModel>`_ Define the POMDP @@ -283,7 +283,7 @@ This class is mostly just for code organization and is entirely optional. RewardModel()) super().__init__(agent, env, name="TigerProblem") -`[source] <_modules/pomdp_problems/tiger/tiger_problem.html#TigerProblem>`_ +`[source] <_modules/pomdp_py/problems/tiger/tiger_problem.html#TigerProblem>`_ Notice that :code:`init_true_state` and :code:`init_belief` need to be provided. The process of creating them is described in more detail in the next section. @@ -330,7 +330,7 @@ Then, we can create an instance of the Tiger problem with the standard noise of tiger_problem = TigerProblem(0.15, init_true_state, init_belief) -`[source] <_modules/pomdp_problems/tiger/tiger_problem.html#main>`_ +`[source] <_modules/pomdp_py/problems/tiger/tiger_problem.html#main>`_ .. _solve: @@ -428,7 +428,7 @@ For the Tiger problem, we implemented this procedure as follows: tiger_problem.agent.transition_model) tiger_problem.agent.set_belief(new_belief) -`[source] <_modules/pomdp_problems/tiger/tiger_problem.html#test_planner>`_ +`[source] <_modules/pomdp_py/problems/tiger/tiger_problem.html#test_planner>`_ .. _summary: diff --git a/docs/_sphinx_src/existing_domains.rst b/docs/_sphinx_src/existing_domains.rst index 1ebbb81e..84148ed6 100644 --- a/docs/_sphinx_src/existing_domains.rst +++ b/docs/_sphinx_src/existing_domains.rst @@ -6,16 +6,16 @@ Several domains have been implemented: .. autosummary:: :nosignatures: - pomdp_problems.multi_object_search.problem - pomdp_problems.tiger.tiger_problem - pomdp_problems.rocksample.rocksample_problem - pomdp_problems.tag - pomdp_problems.load_unload + pomdp_py.problems.multi_object_search.problem + pomdp_py.problems.tiger.tiger_problem + pomdp_py.problems.rocksample.rocksample_problem + pomdp_py.problems.tag + pomdp_py.problems.load_unload Some problems that we hope to implement are below. There are even more examples `here `_. Contribution is welcomed. -* :doc:`problems/pomdp_problems.light_dark` -* :doc:`problems/pomdp_problems.maze` +* :doc:`problems/pomdp_py.problems.light_dark` +* :doc:`problems/pomdp_py.problems.maze` In addition, the interfaces in `pomdp_py` are general enough to be extended to e.g. learning, multi-agent POMDPs; see :doc:`extensions`. `Contributions are always welcomed!` diff --git a/docs/_sphinx_src/installation.rst b/docs/_sphinx_src/installation.rst index e35f9b11..e2edbe5b 100644 --- a/docs/_sphinx_src/installation.rst +++ b/docs/_sphinx_src/installation.rst @@ -47,14 +47,11 @@ See `this wiki page > Observation: tiger-left ... - There will be plots that visualize the MCTS trees displayed, like below (could be more messy): + +2. Optionally, verify that **RockSample**, and **Multi-Object Search** problems work. This requires installing additional dependencies:: + + pip install pomdp-py[problems] + python -m pomdp_py -r rocksample + python -m pomdp_py -r mos For the **RockSample** problem, you should see something like:: @@ -103,7 +105,7 @@ Test things out and the agent (a green circle) starts acting:: - $ python -m pomdp_problems.multi_object_search.problem + $ python -m pomdp_py.problems.multi_object_search.problem pygame 1.9.6 Hello from the pygame community. https://www.pygame.org/contribute.html ==== Step 1 ==== @@ -122,7 +124,7 @@ Test things out __num_sims__: 506 ... -2. You can additionally run some tests (assuming you are at the root directory of the repository). +3. You can additionally run some tests (assuming you are at the root directory of the repository). Note that some tests requires installing external software (`pomdp-solve `_ and `sarsop `_). diff --git a/docs/_sphinx_src/problems/modules.rst b/docs/_sphinx_src/problems/modules.rst deleted file mode 100644 index 3acb107e..00000000 --- a/docs/_sphinx_src/problems/modules.rst +++ /dev/null @@ -1,7 +0,0 @@ -pomdp_problems -============== - -.. toctree:: - :maxdepth: 4 - - pomdp_problems diff --git a/docs/_sphinx_src/problems/pomdp_problems.lasertag.rst b/docs/_sphinx_src/problems/pomdp_problems.lasertag.rst deleted file mode 100644 index 65f432ab..00000000 --- a/docs/_sphinx_src/problems/pomdp_problems.lasertag.rst +++ /dev/null @@ -1,10 +0,0 @@ -pomdp\_problems.lasertag package -================================ - -Module contents ---------------- - -.. automodule:: pomdp_problems.lasertag - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/_sphinx_src/problems/pomdp_problems.light_dark.agent.rst b/docs/_sphinx_src/problems/pomdp_problems.light_dark.agent.rst deleted file mode 100644 index 901baa17..00000000 --- a/docs/_sphinx_src/problems/pomdp_problems.light_dark.agent.rst +++ /dev/null @@ -1,22 +0,0 @@ -pomdp\_problems.light\_dark.agent package -========================================= - -Submodules ----------- - -pomdp\_problems.light\_dark.agent.belief module ------------------------------------------------ - -.. automodule:: pomdp_problems.light_dark.agent.belief - :members: - :undoc-members: - :show-inheritance: - - -Module contents ---------------- - -.. automodule:: pomdp_problems.light_dark.agent - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/_sphinx_src/problems/pomdp_problems.light_dark.domain.rst b/docs/_sphinx_src/problems/pomdp_problems.light_dark.domain.rst deleted file mode 100644 index 7efd5a29..00000000 --- a/docs/_sphinx_src/problems/pomdp_problems.light_dark.domain.rst +++ /dev/null @@ -1,35 +0,0 @@ -Submodules ----------- - -pomdp\_problems.light\_dark.domain.action module ------------------------------------------------- - -.. automodule:: pomdp_problems.light_dark.domain.action - :members: - :undoc-members: - :show-inheritance: - -pomdp\_problems.light\_dark.domain.observation module ------------------------------------------------------ - -.. automodule:: pomdp_problems.light_dark.domain.observation - :members: - :undoc-members: - :show-inheritance: - -pomdp\_problems.light\_dark.domain.state module ------------------------------------------------ - -.. automodule:: pomdp_problems.light_dark.domain.state - :members: - :undoc-members: - :show-inheritance: - - -Module contents ---------------- - -.. automodule:: pomdp_problems.light_dark.domain - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/_sphinx_src/problems/pomdp_problems.light_dark.env.rst b/docs/_sphinx_src/problems/pomdp_problems.light_dark.env.rst deleted file mode 100644 index 2ccf3ff1..00000000 --- a/docs/_sphinx_src/problems/pomdp_problems.light_dark.env.rst +++ /dev/null @@ -1,30 +0,0 @@ -pomdp\_problems.light\_dark.env package -======================================= - -Submodules ----------- - -pomdp\_problems.light\_dark.env.env module ------------------------------------------- - -.. automodule:: pomdp_problems.light_dark.env.env - :members: - :undoc-members: - :show-inheritance: - -pomdp\_problems.light\_dark.env.visual module ---------------------------------------------- - -.. automodule:: pomdp_problems.light_dark.env.visual - :members: - :undoc-members: - :show-inheritance: - - -Module contents ---------------- - -.. automodule:: pomdp_problems.light_dark.env - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/_sphinx_src/problems/pomdp_problems.light_dark.models.rst b/docs/_sphinx_src/problems/pomdp_problems.light_dark.models.rst deleted file mode 100644 index 12431c52..00000000 --- a/docs/_sphinx_src/problems/pomdp_problems.light_dark.models.rst +++ /dev/null @@ -1,30 +0,0 @@ -pomdp\_problems.light\_dark.models package -========================================== - -Submodules ----------- - -pomdp\_problems.light\_dark.models.observation\_model module ------------------------------------------------------------- - -.. automodule:: pomdp_problems.light_dark.models.observation_model - :members: - :undoc-members: - :show-inheritance: - -pomdp\_problems.light\_dark.models.transition\_model module ------------------------------------------------------------ - -.. automodule:: pomdp_problems.light_dark.models.transition_model - :members: - :undoc-members: - :show-inheritance: - - -Module contents ---------------- - -.. automodule:: pomdp_problems.light_dark.models - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/_sphinx_src/problems/pomdp_problems.light_dark.rst b/docs/_sphinx_src/problems/pomdp_problems.light_dark.rst deleted file mode 100644 index 2f58ba6d..00000000 --- a/docs/_sphinx_src/problems/pomdp_problems.light_dark.rst +++ /dev/null @@ -1,39 +0,0 @@ -.. include:: ../../../pomdp_problems/light_dark/README.rst - -Subpackages ------------ - -.. toctree:: - - pomdp_problems.light_dark.agent - pomdp_problems.light_dark.domain - pomdp_problems.light_dark.env - pomdp_problems.light_dark.models - -Submodules ----------- - -pomdp\_problems.light\_dark.problem\_discrete module ----------------------------------------------------- - -.. automodule:: pomdp_problems.light_dark.problem_discrete - :members: - :undoc-members: - :show-inheritance: - -pomdp\_problems.light\_dark.test module ---------------------------------------- - -.. automodule:: pomdp_problems.light_dark.test - :members: - :undoc-members: - :show-inheritance: - - -Module contents ---------------- - -.. automodule:: pomdp_problems.light_dark - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/_sphinx_src/problems/pomdp_problems.load_unload.rst b/docs/_sphinx_src/problems/pomdp_problems.load_unload.rst deleted file mode 100644 index 915f368b..00000000 --- a/docs/_sphinx_src/problems/pomdp_problems.load_unload.rst +++ /dev/null @@ -1,17 +0,0 @@ -.. automodule:: pomdp_problems.load_unload - :members: - :undoc-members: - :show-inheritance: - -.. include:: ../../../pomdp_problems/load_unload/README.rst - -Submodules ----------- - -pomdp\_problems.load\_unload.load\_unload module ------------------------------------------------- - -.. automodule:: pomdp_problems.load_unload.load_unload - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/_sphinx_src/problems/pomdp_problems.maze.domain.rst b/docs/_sphinx_src/problems/pomdp_problems.maze.domain.rst deleted file mode 100644 index d3dfc167..00000000 --- a/docs/_sphinx_src/problems/pomdp_problems.maze.domain.rst +++ /dev/null @@ -1,38 +0,0 @@ -pomdp\_problems.maze.domain package -=================================== - -Submodules ----------- - -pomdp\_problems.maze.domain.action module ------------------------------------------ - -.. automodule:: pomdp_problems.maze.domain.action - :members: - :undoc-members: - :show-inheritance: - -pomdp\_problems.maze.domain.observation module ----------------------------------------------- - -.. automodule:: pomdp_problems.maze.domain.observation - :members: - :undoc-members: - :show-inheritance: - -pomdp\_problems.maze.domain.state module ----------------------------------------- - -.. automodule:: pomdp_problems.maze.domain.state - :members: - :undoc-members: - :show-inheritance: - - -Module contents ---------------- - -.. automodule:: pomdp_problems.maze.domain - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/_sphinx_src/problems/pomdp_problems.maze.env.rst b/docs/_sphinx_src/problems/pomdp_problems.maze.env.rst deleted file mode 100644 index a4bfa0e0..00000000 --- a/docs/_sphinx_src/problems/pomdp_problems.maze.env.rst +++ /dev/null @@ -1,22 +0,0 @@ -pomdp\_problems.maze.env package -================================ - -Submodules ----------- - -pomdp\_problems.maze.env.env module ------------------------------------ - -.. automodule:: pomdp_problems.maze.env.env - :members: - :undoc-members: - :show-inheritance: - - -Module contents ---------------- - -.. automodule:: pomdp_problems.maze.env - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/_sphinx_src/problems/pomdp_problems.maze.models.components.rst b/docs/_sphinx_src/problems/pomdp_problems.maze.models.components.rst deleted file mode 100644 index 2f869013..00000000 --- a/docs/_sphinx_src/problems/pomdp_problems.maze.models.components.rst +++ /dev/null @@ -1,22 +0,0 @@ -pomdp\_problems.maze.models.components package -============================================== - -Submodules ----------- - -pomdp\_problems.maze.models.components.map module -------------------------------------------------- - -.. automodule:: pomdp_problems.maze.models.components.map - :members: - :undoc-members: - :show-inheritance: - - -Module contents ---------------- - -.. automodule:: pomdp_problems.maze.models.components - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/_sphinx_src/problems/pomdp_problems.maze.models.rst b/docs/_sphinx_src/problems/pomdp_problems.maze.models.rst deleted file mode 100644 index 49625adc..00000000 --- a/docs/_sphinx_src/problems/pomdp_problems.maze.models.rst +++ /dev/null @@ -1,17 +0,0 @@ -pomdp\_problems.maze.models package -=================================== - -Subpackages ------------ - -.. toctree:: - - pomdp_problems.maze.models.components - -Module contents ---------------- - -.. automodule:: pomdp_problems.maze.models - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/_sphinx_src/problems/pomdp_problems.maze.rst b/docs/_sphinx_src/problems/pomdp_problems.maze.rst deleted file mode 100644 index 03ba6bf6..00000000 --- a/docs/_sphinx_src/problems/pomdp_problems.maze.rst +++ /dev/null @@ -1,7 +0,0 @@ -pomdp_problems.maze package -=========================== - -.. automodule:: pomdp_problems.maze - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/_sphinx_src/problems/pomdp_problems.multi_object_search.agent.rst b/docs/_sphinx_src/problems/pomdp_problems.multi_object_search.agent.rst deleted file mode 100644 index 8fb9b53f..00000000 --- a/docs/_sphinx_src/problems/pomdp_problems.multi_object_search.agent.rst +++ /dev/null @@ -1,18 +0,0 @@ -pomdp_problems.multi\_object\_search.agent package -================================================== - -pomdp_problems.multi\_object\_search.agent.agent module -------------------------------------------------------- - -.. automodule:: pomdp_problems.multi_object_search.agent.agent - :members: - :undoc-members: - :show-inheritance: - -pomdp_problems.multi\_object\_search.agent.belief module --------------------------------------------------------- - -.. automodule:: pomdp_problems.multi_object_search.agent.belief - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/_sphinx_src/problems/pomdp_problems.multi_object_search.domain.rst b/docs/_sphinx_src/problems/pomdp_problems.multi_object_search.domain.rst deleted file mode 100644 index ae5d672f..00000000 --- a/docs/_sphinx_src/problems/pomdp_problems.multi_object_search.domain.rst +++ /dev/null @@ -1,26 +0,0 @@ -pomdp_problems.multi\_object\_search.domain package -=================================================== - -pomdp_problems.multi\_object\_search.domain.action module ---------------------------------------------------------- - -.. automodule:: pomdp_problems.multi_object_search.domain.action - :members: - :undoc-members: - :show-inheritance: - -pomdp_problems.multi\_object\_search.domain.observation module --------------------------------------------------------------- - -.. automodule:: pomdp_problems.multi_object_search.domain.observation - :members: - :undoc-members: - :show-inheritance: - -pomdp_problems.multi\_object\_search.domain.state module --------------------------------------------------------- - -.. automodule:: pomdp_problems.multi_object_search.domain.state - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/_sphinx_src/problems/pomdp_problems.multi_object_search.env.rst b/docs/_sphinx_src/problems/pomdp_problems.multi_object_search.env.rst deleted file mode 100644 index 575bc73f..00000000 --- a/docs/_sphinx_src/problems/pomdp_problems.multi_object_search.env.rst +++ /dev/null @@ -1,18 +0,0 @@ -pomdp_problems.multi\_object\_search.env package -================================================ - -pomdp_problems.multi\_object\_search.env.env module ---------------------------------------------------- - -.. automodule:: pomdp_problems.multi_object_search.env.env - :members: - :undoc-members: - :show-inheritance: - -pomdp_problems.multi\_object\_search.env.visual module ------------------------------------------------------- - -.. automodule:: pomdp_problems.multi_object_search.env.visual - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/_sphinx_src/problems/pomdp_problems.multi_object_search.models.components.rst b/docs/_sphinx_src/problems/pomdp_problems.multi_object_search.models.components.rst deleted file mode 100644 index b41c17c6..00000000 --- a/docs/_sphinx_src/problems/pomdp_problems.multi_object_search.models.components.rst +++ /dev/null @@ -1,30 +0,0 @@ -pomdp\_problems.multi\_object\_search.models.components package -=============================================================== - -Submodules ----------- - -pomdp\_problems.multi\_object\_search.models.components.grid\_map module ------------------------------------------------------------------------- - -.. automodule:: pomdp_problems.multi_object_search.models.components.grid_map - :members: - :undoc-members: - :show-inheritance: - -pomdp\_problems.multi\_object\_search.models.components.sensor module ---------------------------------------------------------------------- - -.. automodule:: pomdp_problems.multi_object_search.models.components.sensor - :members: - :undoc-members: - :show-inheritance: - - -Module contents ---------------- - -.. automodule:: pomdp_problems.multi_object_search.models.components - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/_sphinx_src/problems/pomdp_problems.multi_object_search.models.rst b/docs/_sphinx_src/problems/pomdp_problems.multi_object_search.models.rst deleted file mode 100644 index 1ef367ca..00000000 --- a/docs/_sphinx_src/problems/pomdp_problems.multi_object_search.models.rst +++ /dev/null @@ -1,34 +0,0 @@ -pomdp_problems.multi\_object\_search.models package -=================================================== - -pomdp_problems.multi\_object\_search.models.observation\_model module ---------------------------------------------------------------------- - -.. automodule:: pomdp_problems.multi_object_search.models.observation_model - :members: - :undoc-members: - :show-inheritance: - -pomdp_problems.multi\_object\_search.models.policy\_model module ----------------------------------------------------------------- - -.. automodule:: pomdp_problems.multi_object_search.models.policy_model - :members: - :undoc-members: - :show-inheritance: - -pomdp_problems.multi\_object\_search.models.reward\_model module ----------------------------------------------------------------- - -.. automodule:: pomdp_problems.multi_object_search.models.reward_model - :members: - :undoc-members: - :show-inheritance: - -pomdp_problems.multi\_object\_search.models.transition\_model module --------------------------------------------------------------------- - -.. automodule:: pomdp_problems.multi_object_search.models.transition_model - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/_sphinx_src/problems/pomdp_problems.multi_object_search.rst b/docs/_sphinx_src/problems/pomdp_problems.multi_object_search.rst deleted file mode 100644 index 621a49f4..00000000 --- a/docs/_sphinx_src/problems/pomdp_problems.multi_object_search.rst +++ /dev/null @@ -1,51 +0,0 @@ -Multi-Object Search (MOS) Task -****************************** - -This task is based on the Multi-Object Search (MOS) task described in the -following paper - -`Multi-Object Search using Object-Oriented POMDPs `_ (ICRA 2019) - -In this implementation, we consider a different (simpler) motion action scheme, -instead of based on topological graph and room connectivity. - -.. autosummary:: - :nosignatures: - - ~pomdp_problems.multi_object_search.problem - ~pomdp_problems.multi_object_search.example_worlds - ~pomdp_problems.multi_object_search.env.env - ~pomdp_problems.multi_object_search.domain - ~pomdp_problems.multi_object_search.domain.state - ~pomdp_problems.multi_object_search.domain.action - ~pomdp_problems.multi_object_search.domain.observation - ~pomdp_problems.multi_object_search.models - ~pomdp_problems.multi_object_search.models.transition_model - ~pomdp_problems.multi_object_search.models.observation_model - ~pomdp_problems.multi_object_search.models.reward_model - ~pomdp_problems.multi_object_search.models.policy_model - ~pomdp_problems.multi_object_search.models.components.sensor - ~pomdp_problems.multi_object_search.models.components.grid_map - - -pomdp_problems.multi\_object\_search.problem module ---------------------------------------------------- - -.. automodule:: pomdp_problems.multi_object_search.problem - :members: - :undoc-members: - :show-inheritance: - -pomdp_problems.multi\_object\_search.example\_worlds module ------------------------------------------------------------ - -.. automodule:: pomdp_problems.multi_object_search.example_worlds - :members: - :undoc-members: - :show-inheritance: - -.. toctree:: - - pomdp_problems.multi_object_search.env - pomdp_problems.multi_object_search.domain - pomdp_problems.multi_object_search.models diff --git a/docs/_sphinx_src/problems/pomdp_problems.rocksample.cythonize.rst b/docs/_sphinx_src/problems/pomdp_problems.rocksample.cythonize.rst deleted file mode 100644 index b89e609b..00000000 --- a/docs/_sphinx_src/problems/pomdp_problems.rocksample.cythonize.rst +++ /dev/null @@ -1,46 +0,0 @@ -pomdp\_problems.rocksample.cythonize package -============================================ - -Submodules ----------- - -pomdp\_problems.rocksample.cythonize.rocksample\_problem.cpython\-37m\-x86\_64\-linux\-gnu module -------------------------------------------------------------------------------------------------- - -.. automodule:: pomdp_problems.rocksample.cythonize.rocksample_problem.cpython-37m-x86_64-linux-gnu - :members: - :undoc-members: - :show-inheritance: - -pomdp\_problems.rocksample.cythonize.rocksample\_problem.cpython\-38\-x86\_64\-linux\-gnu module ------------------------------------------------------------------------------------------------- - -.. automodule:: pomdp_problems.rocksample.cythonize.rocksample_problem.cpython-38-x86_64-linux-gnu - :members: - :undoc-members: - :show-inheritance: - -pomdp\_problems.rocksample.cythonize.rocksample\_problem module ---------------------------------------------------------------- - -.. automodule:: pomdp_problems.rocksample.cythonize.rocksample_problem - :members: - :undoc-members: - :show-inheritance: - -pomdp\_problems.rocksample.cythonize.run\_rocksample module ------------------------------------------------------------ - -.. automodule:: pomdp_problems.rocksample.cythonize.run_rocksample - :members: - :undoc-members: - :show-inheritance: - - -Module contents ---------------- - -.. automodule:: pomdp_problems.rocksample.cythonize - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/_sphinx_src/problems/pomdp_problems.rocksample.rst b/docs/_sphinx_src/problems/pomdp_problems.rocksample.rst deleted file mode 100644 index d9cf93dd..00000000 --- a/docs/_sphinx_src/problems/pomdp_problems.rocksample.rst +++ /dev/null @@ -1,44 +0,0 @@ -.. include:: ../../../pomdp_problems/rocksample/README.rst - -Subpackages ------------ - -.. toctree:: - - pomdp_problems.rocksample.cythonize - -Submodules ----------- - -pomdp\_problems.rocksample.cythonize.cpython\-37m\-x86\_64\-linux\-gnu module ------------------------------------------------------------------------------ - -.. automodule:: pomdp_problems.rocksample.cythonize.cpython-37m-x86_64-linux-gnu - :members: - :undoc-members: - :show-inheritance: - -pomdp\_problems.rocksample.cythonize.cpython\-38\-x86\_64\-linux\-gnu module ----------------------------------------------------------------------------- - -.. automodule:: pomdp_problems.rocksample.cythonize.cpython-38-x86_64-linux-gnu - :members: - :undoc-members: - :show-inheritance: - -pomdp\_problems.rocksample.rocksample\_problem module ------------------------------------------------------ - -.. automodule:: pomdp_problems.rocksample.rocksample_problem - :members: - :undoc-members: - :show-inheritance: - - -Module contents ---------------- - -.. automodule:: pomdp_problems.rocksample - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/_sphinx_src/problems/pomdp_problems.rst b/docs/_sphinx_src/problems/pomdp_problems.rst deleted file mode 100644 index 096599ed..00000000 --- a/docs/_sphinx_src/problems/pomdp_problems.rst +++ /dev/null @@ -1,12 +0,0 @@ -pomdp_problems package -====================== - -.. toctree:: - :maxdepth: 2 - - pomdp_problems.multi_object_search - pomdp_problems.rocksample - pomdp_problems.tiger - pomdp_problems.light_dark - pomdp_problems.load_unload - pomdp_problems.tag diff --git a/docs/_sphinx_src/problems/pomdp_problems.tag.domain.rst b/docs/_sphinx_src/problems/pomdp_problems.tag.domain.rst deleted file mode 100644 index 675b6a8d..00000000 --- a/docs/_sphinx_src/problems/pomdp_problems.tag.domain.rst +++ /dev/null @@ -1,38 +0,0 @@ -pomdp\_problems.tag.domain package -================================== - -Submodules ----------- - -pomdp\_problems.tag.domain.action module ----------------------------------------- - -.. automodule:: pomdp_problems.tag.domain.action - :members: - :undoc-members: - :show-inheritance: - -pomdp\_problems.tag.domain.observation module ---------------------------------------------- - -.. automodule:: pomdp_problems.tag.domain.observation - :members: - :undoc-members: - :show-inheritance: - -pomdp\_problems.tag.domain.state module ---------------------------------------- - -.. automodule:: pomdp_problems.tag.domain.state - :members: - :undoc-members: - :show-inheritance: - - -Module contents ---------------- - -.. automodule:: pomdp_problems.tag.domain - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/_sphinx_src/problems/pomdp_problems.tag.env.rst b/docs/_sphinx_src/problems/pomdp_problems.tag.env.rst deleted file mode 100644 index 57244b76..00000000 --- a/docs/_sphinx_src/problems/pomdp_problems.tag.env.rst +++ /dev/null @@ -1,30 +0,0 @@ -pomdp\_problems.tag.env package -=============================== - -Submodules ----------- - -pomdp\_problems.tag.env.env module ----------------------------------- - -.. automodule:: pomdp_problems.tag.env.env - :members: - :undoc-members: - :show-inheritance: - -pomdp\_problems.tag.env.visual module -------------------------------------- - -.. automodule:: pomdp_problems.tag.env.visual - :members: - :undoc-members: - :show-inheritance: - - -Module contents ---------------- - -.. automodule:: pomdp_problems.tag.env - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/_sphinx_src/problems/pomdp_problems.tag.models.components.rst b/docs/_sphinx_src/problems/pomdp_problems.tag.models.components.rst deleted file mode 100644 index fd480039..00000000 --- a/docs/_sphinx_src/problems/pomdp_problems.tag.models.components.rst +++ /dev/null @@ -1,30 +0,0 @@ -pomdp\_problems.tag.models.components package -============================================= - -Submodules ----------- - -pomdp\_problems.tag.models.components.grid\_map module ------------------------------------------------------- - -.. automodule:: pomdp_problems.tag.models.components.grid_map - :members: - :undoc-members: - :show-inheritance: - -pomdp\_problems.tag.models.components.motion\_policy module ------------------------------------------------------------ - -.. automodule:: pomdp_problems.tag.models.components.motion_policy - :members: - :undoc-members: - :show-inheritance: - - -Module contents ---------------- - -.. automodule:: pomdp_problems.tag.models.components - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/_sphinx_src/problems/pomdp_problems.tag.models.rst b/docs/_sphinx_src/problems/pomdp_problems.tag.models.rst deleted file mode 100644 index 7e02e4ea..00000000 --- a/docs/_sphinx_src/problems/pomdp_problems.tag.models.rst +++ /dev/null @@ -1,53 +0,0 @@ -pomdp\_problems.tag.models package -================================== - -Subpackages ------------ - -.. toctree:: - - pomdp_problems.tag.models.components - -Submodules ----------- - -pomdp\_problems.tag.models.observation\_model module ----------------------------------------------------- - -.. automodule:: pomdp_problems.tag.models.observation_model - :members: - :undoc-members: - :show-inheritance: - -pomdp\_problems.tag.models.policy\_model module ------------------------------------------------ - -.. automodule:: pomdp_problems.tag.models.policy_model - :members: - :undoc-members: - :show-inheritance: - -pomdp\_problems.tag.models.reward\_model module ------------------------------------------------ - -.. automodule:: pomdp_problems.tag.models.reward_model - :members: - :undoc-members: - :show-inheritance: - -pomdp\_problems.tag.models.transition\_model module ---------------------------------------------------- - -.. automodule:: pomdp_problems.tag.models.transition_model - :members: - :undoc-members: - :show-inheritance: - - -Module contents ---------------- - -.. automodule:: pomdp_problems.tag.models - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/_sphinx_src/problems/pomdp_problems.tag.rst b/docs/_sphinx_src/problems/pomdp_problems.tag.rst deleted file mode 100644 index a9b5d7b0..00000000 --- a/docs/_sphinx_src/problems/pomdp_problems.tag.rst +++ /dev/null @@ -1,51 +0,0 @@ -.. automodule:: pomdp_problems.tag - :members: - :undoc-members: - :show-inheritance: - -.. include:: ../../../pomdp_problems/tag/README.rst - -Subpackages ------------ - -.. toctree:: - - pomdp_problems.tag.agent - pomdp_problems.tag.domain - pomdp_problems.tag.env - pomdp_problems.tag.models - -Submodules ----------- - -pomdp\_problems.tag.constants module ------------------------------------- - -.. automodule:: pomdp_problems.tag.constants - :members: - :undoc-members: - :show-inheritance: - -pomdp\_problems.tag.example\_worlds module ------------------------------------------- - -.. automodule:: pomdp_problems.tag.example_worlds - :members: - :undoc-members: - :show-inheritance: - -pomdp\_problems.tag.experiment module -------------------------------------- - -.. automodule:: pomdp_problems.tag.experiment - :members: - :undoc-members: - :show-inheritance: - -pomdp\_problems.tag.problem module ----------------------------------- - -.. automodule:: pomdp_problems.tag.problem - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/_sphinx_src/problems/pomdp_problems.tiger.cythonize.rst b/docs/_sphinx_src/problems/pomdp_problems.tiger.cythonize.rst deleted file mode 100644 index a5b774b2..00000000 --- a/docs/_sphinx_src/problems/pomdp_problems.tiger.cythonize.rst +++ /dev/null @@ -1,46 +0,0 @@ -pomdp\_problems.tiger.cythonize package -======================================= - -Submodules ----------- - -pomdp\_problems.tiger.cythonize.run\_tiger module -------------------------------------------------- - -.. automodule:: pomdp_problems.tiger.cythonize.run_tiger - :members: - :undoc-members: - :show-inheritance: - -pomdp\_problems.tiger.cythonize.tiger\_problem.cpython\-37m\-x86\_64\-linux\-gnu module ---------------------------------------------------------------------------------------- - -.. automodule:: pomdp_problems.tiger.cythonize.tiger_problem.cpython-37m-x86_64-linux-gnu - :members: - :undoc-members: - :show-inheritance: - -pomdp\_problems.tiger.cythonize.tiger\_problem.cpython\-38\-x86\_64\-linux\-gnu module --------------------------------------------------------------------------------------- - -.. automodule:: pomdp_problems.tiger.cythonize.tiger_problem.cpython-38-x86_64-linux-gnu - :members: - :undoc-members: - :show-inheritance: - -pomdp\_problems.tiger.cythonize.tiger\_problem module ------------------------------------------------------ - -.. automodule:: pomdp_problems.tiger.cythonize.tiger_problem - :members: - :undoc-members: - :show-inheritance: - - -Module contents ---------------- - -.. automodule:: pomdp_problems.tiger.cythonize - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/_sphinx_src/problems/pomdp_problems.tiger.rst b/docs/_sphinx_src/problems/pomdp_problems.tiger.rst deleted file mode 100644 index 1bcbabe1..00000000 --- a/docs/_sphinx_src/problems/pomdp_problems.tiger.rst +++ /dev/null @@ -1,35 +0,0 @@ -.. include:: ../../../pomdp_problems/tiger/README.rst - -Subpackages ------------ - -.. toctree:: - - pomdp_problems.tiger.cythonize - -Submodules ----------- - -pomdp\_problems.tiger.cythonize.cpython\-37m\-x86\_64\-linux\-gnu module ------------------------------------------------------------------------- - -.. automodule:: pomdp_problems.tiger.cythonize.cpython-37m-x86_64-linux-gnu - :members: - :undoc-members: - :show-inheritance: - -pomdp\_problems.tiger.cythonize.cpython\-38\-x86\_64\-linux\-gnu module ------------------------------------------------------------------------ - -.. automodule:: pomdp_problems.tiger.cythonize.cpython-38-x86_64-linux-gnu - :members: - :undoc-members: - :show-inheritance: - -pomdp\_problems.tiger.tiger\_problem module -------------------------------------------- - -.. automodule:: pomdp_problems.tiger.tiger_problem - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/html/_modules/index.html b/docs/html/_modules/index.html index 069d6c43..40ce5a40 100644 --- a/docs/html/_modules/index.html +++ b/docs/html/_modules/index.html @@ -1,23 +1,24 @@ - + - Overview: module code — pomdp_py 1.3.3 documentation - - - + Overview: module code — pomdp_py 1.3.4 documentation + + + - + + + -
@@ -26,14 +27,14 @@
-

A framework to build and solve POMDP problems (v1.3.3).

+

A framework to build and solve POMDP problems (v1.3.4).

@@ -54,12 +55,10 @@

Navigation

  • Examples
  • Design Principles
  • Existing POMDP Solvers
  • -
  • What's New?
  • API References

    @@ -113,52 +112,7 @@

    Donate/support

    All modules for which code is available

    -
    @@ -192,11 +174,11 @@

    All modules for which code is available

    diff --git a/docs/html/_modules/pomdp_problems/light_dark/domain/action.html b/docs/html/_modules/pomdp_problems/light_dark/domain/action.html deleted file mode 100644 index 6736bcaf..00000000 --- a/docs/html/_modules/pomdp_problems/light_dark/domain/action.html +++ /dev/null @@ -1,181 +0,0 @@ - - - - - - - - pomdp_problems.light_dark.domain.action — pomdp_py 1.3.1 documentation - - - - - - - - - - - - - - - - -
    - - -
    -
    - - -
    - -

    Source code for pomdp_problems.light_dark.domain.action

    -"""Defines the Action for the continuous light-dark domain;
    -
    -Origin: Belief space planning assuming maximum likelihood observations
    -
    -Action space: 
    -
    -    :math:`U\subseteq\mathbb{R}^2`. Quote from the paper: "The robot is
    -        modeled as a first-order system such that the robot velocity is determined
    -        by the control actions, :math:`u\in\mathbb{R}^2`.
    -"""
    -import pomdp_py
    -
    -
    [docs]class Action(pomdp_py.Action): - """The action is a vector of velocities""" - def __init__(self, control): - """ - Initializes a state in light dark domain. - - Args: - control (tuple): velocity - """ - if len(control) != 2: - raise ValueError("Action control must be a vector of length 2") - self.control = control - - def __hash__(self): - return hash(self.control) - - def __eq__(self, other): - if isinstance(other, Action): - return self.control == other.control - else: - return False - - def __str__(self): - return self.__repr__() - - def __repr__(self): - return "Action(%s)" % (str(self.control))
    - -
    - -
    - -
    -
    -
    -
    - - - - - - - \ No newline at end of file diff --git a/docs/html/_modules/pomdp_problems/light_dark/domain/observation.html b/docs/html/_modules/pomdp_problems/light_dark/domain/observation.html deleted file mode 100644 index f2c0acae..00000000 --- a/docs/html/_modules/pomdp_problems/light_dark/domain/observation.html +++ /dev/null @@ -1,188 +0,0 @@ - - - - - - - - pomdp_problems.light_dark.domain.observation — pomdp_py 1.3.1 documentation - - - - - - - - - - - - - - - - -
    - - -
    -
    - - -
    - -

    Source code for pomdp_problems.light_dark.domain.observation

    -import pomdp_py
    -
    -
    [docs]class Observation(pomdp_py.Observation): - """Defines the Observation for the continuous light-dark domain; - - Observation space: - - :math:`\Omega\subseteq\mathbb{R}^2` the observation of the robot is - an estimate of the robot position :math:`g(x_t)\in\Omega`. - - """ - # the number of decimals to round up an observation when it is discrete. - PRECISION=2 - - def __init__(self, position, discrete=False): - """ - Initializes a observation in light dark domain. - - Args: - position (tuple): position of the robot. - """ - self._discrete = discrete - if len(position) != 2: - raise ValueError("Observation position must be a vector of length 2") - if self._discrete: - self.position = position - else: - self.position = (round(position[0], Observation.PRECISION), - round(position[1], Observation.PRECISION)) - -
    [docs] def discretize(self): - return Observation(self.position, discrete=True)
    - - def __hash__(self): - return hash(self.position) - - def __eq__(self, other): - if isinstance(other, Observation): - return self.position == other.position - else: - return False - - def __str__(self): - return self.__repr__() - - def __repr__(self): - return "Observation(%s)" % (str(self.position))
    -
    - -
    - -
    -
    -
    -
    - - - - - - - \ No newline at end of file diff --git a/docs/html/_modules/pomdp_problems/light_dark/domain/state.html b/docs/html/_modules/pomdp_problems/light_dark/domain/state.html deleted file mode 100644 index 06ebaee9..00000000 --- a/docs/html/_modules/pomdp_problems/light_dark/domain/state.html +++ /dev/null @@ -1,179 +0,0 @@ - - - - - - - - pomdp_problems.light_dark.domain.state — pomdp_py 1.3.1 documentation - - - - - - - - - - - - - - - - -
    - - -
    -
    - - -
    - -

    Source code for pomdp_problems.light_dark.domain.state

    -"""Defines the State for the continuous light-dark domain;
    -
    -Origin: Belief space planning assuming maximum likelihood observations
    -
    -State space: 
    -
    -    :math:`X\subseteq\mathbb{R}^2` the state of the robot
    -"""
    -import pomdp_py
    -import numpy as np
    -
    -
    [docs]class State(pomdp_py.State): - """The state of the problem is just the robot position""" - def __init__(self, position): - """ - Initializes a state in light dark domain. - - Args: - position (tuple): position of the robot. - """ - if len(position) != 2: - raise ValueError("State position must be a vector of length 2") - self.position = position - - def __hash__(self): - return hash(self.position) - - def __eq__(self, other): - if isinstance(other, State): - return self.position == other.position - else: - return False - - def __str__(self): - return self.__repr__() - - def __repr__(self): - return "State(%s)" % (str(self.position))
    -
    - -
    - -
    -
    -
    -
    - - - - - - - \ No newline at end of file diff --git a/docs/html/_modules/pomdp_problems/light_dark/env/visual.html b/docs/html/_modules/pomdp_problems/light_dark/env/visual.html deleted file mode 100644 index 8b51f49a..00000000 --- a/docs/html/_modules/pomdp_problems/light_dark/env/visual.html +++ /dev/null @@ -1,290 +0,0 @@ - - - - - - - - pomdp_problems.light_dark.env.visual — pomdp_py 1.3.1 documentation - - - - - - - - - - - - - - - - -
    - - -
    -
    - - -
    - -

    Source code for pomdp_problems.light_dark.env.visual

    -"""Plot the light dark environment"""
    -import matplotlib.pyplot as plt
    -from matplotlib.collections import PolyCollection
    -import pomdp_problems.light_dark as ld
    -from pomdp_py.utils import plotting, colors
    -from pomdp_py.utils.misc import remap
    -
    -
    [docs]class LightDarkViz: - """This class deals with visualizing a light dark domain""" - - def __init__(self, env, x_range, y_range, res): - """ - Args: - env (LightDarkEnvironment): Environment for light dark domain. - x_range (tuple): a tuple of floats (x_min, x_max). - y_range (tuple): a tuple of floats (y_min, y_max). - res (float): specifies the size of each rectangular strip to draw; - As in the paper, the light is at a location on the x axis. - """ - self._env = env - self._res = res - self._x_range = x_range - self._y_range = y_range - fig = plt.gcf() - self._ax = fig.add_subplot(1,1,1) - self._goal_pos = None - self._m_0 = None # initial belief pose - - # For tracking the path; list of robot position tuples - self._log_paths = {} - -
    [docs] def log_position(self, position, path=0): - if path not in self._log_paths: - self._log_paths[path] = [] - self._log_paths[path].append(position)
    - -
    [docs] def set_goal(self, goal_pos): - self._goal_pos = goal_pos
    - -
    [docs] def set_initial_belief_pos(self, m_0): - self._m_0 = m_0
    - -
    [docs] def plot(self, - path_colors={0: [(0,0,0), (0,0,254)]}, - path_styles={0: "--"}, - path_widths={0: 1}): - self._plot_gradient() - self._plot_path(path_colors, path_styles, path_widths) - self._plot_robot() - self._plot_goal() - self._plot_initial_belief_pos()
    - - def _plot_robot(self): - cur_pos = self._env.state.position - plotting.plot_circle(self._ax, cur_pos, - 0.25, # tentative - color="black", fill=False, - linewidth=1, edgecolor="black", - zorder=3) - - def _plot_initial_belief_pos(self): - if self._m_0 is not None: - plotting.plot_circle(self._ax, self._m_0, - 0.25, # tentative - color="black", fill=False, - linewidth=1, edgecolor="black", - zorder=3) - - def _plot_goal(self): - if self._goal_pos is not None: - plotting.plot_circle(self._ax, - self._goal_pos, - 0.25, # tentative - linewidth=1, edgecolor="blue", - zorder=3) - - def _plot_path(self, colors, styles, linewidths): - """Plot robot path""" - # Plot line segments - for path in self._log_paths: - if path not in colors: - path_color = [(0,0,0)] * len(self._log_paths[path]) - else: - if len(colors[path]) == 2: - c1, c2 = colors[path] - path_color = colors.linear_color_gradient(c1, c2, - len(self._log_paths[path]), - normalize=True) - else: - path_color = [colors[path]] * len(self._log_paths[path]) - - if path not in styles: - path_style = "--" - else: - path_style = styles[path] - - if path not in linewidths: - path_width = 1 - else: - path_width = linewidths[path] - - for i in range(1, len(self._log_paths[path])): - p1 = self._log_paths[path][i-1] - p2 = self._log_paths[path][i] - try: - plotting.plot_line(self._ax, p1, p2, color=path_color[i], - linestyle=path_style, zorder=2, linewidth=path_width) - except Exception: - import pdb; pdb.set_trace() - - def _plot_gradient(self): - """display the light dark domain.""" - xmin, xmax = self._x_range - ymin, ymax = self._y_range - # Note that higher brightness has lower brightness value - hi_brightness = self._env.const - lo_brightness = max(0.5 * (self._env.light - xmin)**2 + self._env.const, - 0.5 * (self._env.light - xmax)**2 + self._env.const) - # Plot a bunch of rectangular strips along the x axis - # Check out: https://stackoverflow.com/questions/10550477 - x = xmin - verts = [] - colors = [] - while x < xmax: - x_next = x + self._res - verts.append([(x, ymin), (x_next, ymin), (x_next, ymax), (x, ymax)]) - # compute brightness based on equation in the paper - brightness = 0.5 * (self._env.light - x)**2 + self._env.const - # map brightness to a grayscale color - grayscale = int(round(remap(brightness, hi_brightness, lo_brightness, 255, 0))) - grayscale_hex = colors.rgb_to_hex((grayscale, grayscale, grayscale)) - colors.append(grayscale_hex) - x = x_next - plotting.plot_polygons(verts, colors, ax=self._ax) - self._ax.set_xlim(xmin, xmax) - self._ax.set_ylim(ymin, ymax)
    - -if __name__ == "__main__": - env = ld.LightDarkEnvironment(ld.State((0.5, 2.5)), # init state - (1.5, -1), # goal pose - 5, # light - 1) # const - viz = LightDarkViz(env, (-1, 7), (-2, 4), 0.1) - viz.log_position((5,2)) - viz.log_position((5,0)) - viz.log_position((4,-1)) - viz.plot() - - plt.show() -
    - -
    - -
    -
    -
    -
    - - - - - - - \ No newline at end of file diff --git a/docs/html/_modules/pomdp_problems/light_dark/models/observation_model.html b/docs/html/_modules/pomdp_problems/light_dark/models/observation_model.html deleted file mode 100644 index 2d54a7cc..00000000 --- a/docs/html/_modules/pomdp_problems/light_dark/models/observation_model.html +++ /dev/null @@ -1,245 +0,0 @@ - - - - - - - - pomdp_problems.light_dark.models.observation_model — pomdp_py 1.3.1 documentation - - - - - - - - - - - - - - - - -
    - - -
    -
    - - -
    - -

    Source code for pomdp_problems.light_dark.models.observation_model

    -"""Defines the ObservationModel for the continuous light-dark domain;
    -
    -Origin: Belief space planning assuming maximum likelihood observations
    -
    -Quote from the paper:
    -
    -    The observation function is identity, :math:`g(x_t) = x_t+\omega`,
    -    with zero-mean Gaussian observation noise a function of state,
    -    \omega\sim\mathcal{N}(\cdot | 0, w(x))` where
    -
    -    :math:`w(x) = \frac{1}{2}(5-s_x)^2 + \text{const}`
    -
    -    (Notational change; using :math:`s_x` to refer to first element of
    -    state (i.e. robot position). The number 5 indicates the x-coordinate
    -    of the light bar as shown in the figure (Fig.1 of the paper).
    -"""
    -import pomdp_py
    -import copy
    -import numpy as np
    -from ..domain.observation import *
    -
    -
    [docs]class ObservationModel(pomdp_py.ObservationModel): - - def __init__(self, light, const): - """ - `light` and `const` are parameters in - :math:`w(x) = \frac{1}{2}(\text{light}-s_x)^2 + \text{const}` - - They should both be floats. The quantity :math:`w(x)` will - be used as the variance of the covariance matrix in the gaussian - distribution (this is how I understood the paper). - """ - self._light = light - self._const = const - - def _compute_variance(self, pos): - return 0.5 * (self._light - pos[0])**2 + self._const - -
    [docs] def noise_covariance(self, pos): - variance = self._compute_variance(pos) - return np.array([[variance, 0], - [0, variance]])
    - -
    [docs] def probability(self, observation, next_state, action): - """ - The observation is :math:`g(x_t) = x_t+\omega`. So - the probability of this observation is the probability - of :math:`\omega` which follows the Gaussian distribution. - """ - if self._discrete: - observation = observation.discretize() - variance = self._compute_variance(next_state.position) - gaussian_noise = pomdp_py.Gaussian([0,0], - [[variance, 0], - [0, variance]]) - omega = (observation.position[0] - next_state.position[0], - observation.position[1] - next_state.position[1]) - return gaussian_noise[omega]
    - -
    [docs] def sample(self, next_state, action, argmax=False): - """sample an observation.""" - # Sample a position shift according to the gaussian noise. - obs_pos = self.func(next_state.position, mpe=argmax) - return Observation(tuple(obs_pos))
    - -
    [docs] def argmax(self, next_state, action): - return self.sample(next_state, action, argmax=True)
    - -
    [docs] def func(self): - def g(xt, mpe=False): - variance = self._compute_variance(xt) - gaussian_noise = pomdp_py.Gaussian([0,0], - [[variance, 0], - [0, variance]]) - if mpe: - omega = gaussian_noise.mpe() - else: - omega = gaussian_noise.random() - return np.array([xt[0] + omega[0], - xt[1] + omega[1]]) - return g
    - -
    [docs] def jac_dx(self): - def dgdx(mt): - variance = self._compute_variance(mt) - gaussian_noise = pomdp_py.Gaussian([0,0], - [[variance, 0], - [0, variance]]) - omega = gaussian_noise.random() - # manually compute the jacobian of d(x + omega)/dx - return np.array([[omega[0], mt[1] + omega[1]], - [mt[0] + omega[0], omega[1]]]) - return dgdx
    - -
    [docs] def func_noise(self): - """Returns a function that returns a state-dependent Gaussian noise.""" - def fn(mt): - variance = self._compute_variance(mt) - gaussian_noise = pomdp_py.Gaussian([0,0], - [[variance, 0], - [0, variance]]) - return gaussian_noise - return fn
    - -
    - -
    - -
    -
    -
    -
    - - - - - - - \ No newline at end of file diff --git a/docs/html/_modules/pomdp_problems/light_dark/models/transition_model.html b/docs/html/_modules/pomdp_problems/light_dark/models/transition_model.html deleted file mode 100644 index df3ba464..00000000 --- a/docs/html/_modules/pomdp_problems/light_dark/models/transition_model.html +++ /dev/null @@ -1,217 +0,0 @@ - - - - - - - - pomdp_problems.light_dark.models.transition_model — pomdp_py 1.3.1 documentation - - - - - - - - - - - - - - - - -
    - - -
    -
    - - -
    - -

    Source code for pomdp_problems.light_dark.models.transition_model

    -"""Defines the TransitionModel for the continuous light-dark domain;
    -
    -Origin: Belief space planning assuming maximum likelihood observations
    -
    -Quote from the paper:
    -
    -    The underlying system dynamics are linear with zero process noise,
    -    :math:`f(x_t,u_t)=x_t+u`. This means the transition dynamics is
    -    deterministic.
    -"""
    -import pomdp_py
    -import copy
    -import numpy as np
    -
    -
    -
    [docs]class TransitionModel(pomdp_py.TransitionModel): - """ - The underlying deterministic system dynamics - """ - def __init__(self, epsilon=1e-9): - self._epsilon = epsilon - -
    [docs] def probability(self, next_state, state, action, **kwargs): - """ - Deterministic. - """ - expected_position = tuple(self.func(state.position, action)) - if next_state.position == expected_position: - return 1.0 - self.epsilon - else: - return self.epsilon
    - -
    [docs] def sample(self, state, action): - next_state = copy.deepcopy(state) - next_state.position = tuple(self.func(state.position, action)) - return next_state
    - -
    [docs] def argmax(self, state, action): - """Returns the most likely next state""" - return self.sample(state, action)
    - -
    [docs] def func(self): - """Returns the function of the underlying system dynamics. - The function is: (xt, ut) -> xt+1 where xt, ut, xt+1 are - all numpy arrays.""" - def f(xt, ut): - return np.array([xt[0] + ut[0], - xt[1] + ut[1]]) - return f
    - -
    [docs] def jac_dx(self): - """Returns the function of the jacobian of the system dynamics - function with respect to the state vector mt: (mt, ut) -> At""" - def dfdx(mt, ut): - # The result of computing the jacobian by hand - return np.array([[ut[0], mt[1] + ut[1]], - [mt[0] + ut[0], ut[1]]]) - return dfdx
    - -
    [docs] def jac_du(self): - """Returns the function of the jacobian of the system dynamics - function with respect to the state vector mt: (mt, ut) -> Bt""" - def dfdu(mt, ut): - # The result of computing the jacobian by hand - return np.array([[mt[0], mt[1] + ut[1]], - [mt[0] + ut[0], mt[1]]]) - return dfdu
    - -
    [docs] def func_noise(self, var_sysd=1e-9): - """Returns a function that returns a state-dependent Gaussian noise.""" - def fn(mt): - gaussian_noise = pomdp_py.Gaussian([0,0], - [[var_sysd, 0], - [0, var_sysd]]) - return gaussian_noise - return fn
    -
    - -
    - -
    -
    -
    -
    - - - - - - - \ No newline at end of file diff --git a/docs/html/_modules/pomdp_problems/light_dark/problem_discrete.html b/docs/html/_modules/pomdp_problems/light_dark/problem_discrete.html deleted file mode 100644 index 707a47df..00000000 --- a/docs/html/_modules/pomdp_problems/light_dark/problem_discrete.html +++ /dev/null @@ -1,146 +0,0 @@ - - - - - - - pomdp_problems.light_dark.problem_discrete — pomdp_py 1.3.1 documentation - - - - - - - - - - - - - - - - - - -
    - - -
    -
    - - -
    - -

    Source code for pomdp_problems.light_dark.problem_discrete

    -import pomdp_py
    -
    -
    [docs]class DiscreteLightDark(pomdp_py.POMDP): - pass
    -
    - -
    - -
    -
    -
    -
    - - - - - - - \ No newline at end of file diff --git a/docs/html/_modules/pomdp_problems/load_unload/load_unload.html b/docs/html/_modules/pomdp_problems/load_unload/load_unload.html deleted file mode 100644 index 4c323633..00000000 --- a/docs/html/_modules/pomdp_problems/load_unload/load_unload.html +++ /dev/null @@ -1,424 +0,0 @@ - - - - - - - - pomdp_problems.load_unload.load_unload — pomdp_py 1.3.1 documentation - - - - - - - - - - - - - - - - -
    - - -
    -
    - - -
    - -

    Source code for pomdp_problems.load_unload.load_unload

    -"""The load unload problem. An agent is placed on a one dimensional grid world
    -and is tasked with loading itself up on the right side of the world and
    -unloading on the left. The agent can observe whether or not it is in the load or
    -unload block but can not tell its exact location of whether it is loaded or
    -unloaded. Therefore the agent must maintain belief about it's location and load
    -status.
    -
    -States are defined by the location of the agent and whether or not it is loaded
    -Actions: "move-left", "move-right"
    -Rewards:
    -    +100 for moving into the unload block while loaded
    -    -1 otherwise
    -
    -"""
    -
    -import pomdp_py
    -import random
    -import numpy as np
    -import sys
    -import copy
    -import matplotlib.pyplot as plt
    -from matplotlib.animation import FuncAnimation
    -
    -
    -EPSILON = 1e-3
    -LOAD_LOCATION = 10
    -
    -
    [docs]class LUState(pomdp_py.State): - def __init__(self, x, loaded): - if type(x) != int or x < 0: - raise ValueError("Invalid state: {}\n".format((x, loaded)) + - "x must be an integer > 0") - if type(loaded) != bool: - raise ValueError("Invalid state: {}\n".format((x, loaded)) + - "loaded must be a boolean") - if x == 0 and loaded == True: - raise ValueError("Agent can not be loaded in the 0th position") - if x == LOAD_LOCATION and loaded == False: - raise ValueError("Agent can not be unloaded in the last position") - - self.x = x - self.loaded = loaded - def __hash__(self): - return hash((self.x, self.loaded)) - def __eq__(self, other): - if isinstance(other, LUState): - return self.x == other.x and self.loaded == self.loaded - elif type(other) == tuple: - return self.x == other[0] and self.loaded == other[1] - def __str__(self): - return str((self.x, self.loaded)) - def __repr__(self): - return "State({})".format(self)
    - -
    [docs]class LUAction(pomdp_py.Action): - def __init__(self, name): - if name not in ["move-left", "move-right"]: - raise ValueError("Invalid action: %s" % name) - - self.name = name - def __hash__(self): - return hash(self.name) - def __eq__(self, other): - if isinstance(other, LUAction): - return self.name == other.name - elif type(other) == str: - return self.name == other - def __str__(self): - return self.name - def __repr__(self): - return "Action(%s)" % self.name
    - -
    [docs]class LUObservation(pomdp_py.Observation): - def __init__(self, obs): - if obs not in ["load", "unload", "middle"]: - raise ValueError("Invalid observation: {}\n".format(name) + - "Observation must be an integer > 0") - self.name = obs - def __hash__(self): - return hash(self.name) - def __eq__(self, other): - if isinstance(other, LUObservation): - return self.name == other.name - elif type(other) == str: - return self.name == other - def __str__(self): - return str(self.name) - def __repr__(self): - return "Observation(%s)" % str(self.x)
    - -# Observation model -
    [docs]class LUObservationModel(pomdp_py.ObservationModel): - """This problem is small enough for the probabilities to be directly given - externally""" -
    [docs] def probability(self, observation, next_state, action, normalized=False, **kwargs): - if observation != self.sample(next_state, action): - # return EPSILON to avoid degradation of particles - return EPSILON - else: - return 1 - EPSILON
    - -
    [docs] def sample(self, next_state, action, normalized=False, **kwargs): - if next_state.x == 0: - return LUObservation("unload") - elif next_state.x == LOAD_LOCATION: - return LUObservation("load") - else: - return LUObservation("middle")
    - -
    [docs] def argmax(self, next_state, action, normalized=False, **kwargs): - """Returns the most likely observation""" - return self.sample(next_state, action)
    - - -# Transition Model -
    [docs]class LUTransitionModel(pomdp_py.TransitionModel): - """This problem is small enough for the probabilities to be directly given - externally""" -
    [docs] def probability(self, next_state, state, action, normalized=False, **kwargs): - if next_state != self.sample(state, action): - return EPSILON - else: - return 1 - EPSILON
    - -
    [docs] def sample(self, state, action, normalized=False, **kwargs): - if ((state.x == LOAD_LOCATION and action == "move-right") or - (state.x == 0 and action == "move-left")): - # trying to make invalid move, stay in the same place - return state - - if action == "move-right": - # make sure we're always loaded in the far right cell - if state.x == LOAD_LOCATION - 1: - return LUState(state.x + 1, True) - return LUState(state.x + 1, state.loaded) - - if action == "move-left": - # make sure we're always unloaded in the first cell - if state.x == 1: - return LUState(state.x - 1, False) - return LUState(state.x - 1, state.loaded)
    - -
    [docs] def argmax(self, state, action, normalized=False, **kwargs): - """Returns the most likely next state""" - return self.sample(state, action)
    - -# Reward Model -
    [docs]class LURewardModel(pomdp_py.RewardModel): -
    [docs] def probability(self, reward, state, action, next_state, normalized=False, **kwargs): - if reward == self.sample(state, action): - return 1.0 - else: - return 0.0
    - -
    [docs] def sample(self, state, action, next_state, normalized=False, **kwargs): - # if we are unloaded things, give reward 100, otherwise give -1 - if action == "move-left" and state.loaded == True and state.x == 1: - return 100 - else: - return -1
    - -
    [docs] def argmax(self, state, action, next_state, normalized=False, **kwargs): - """Returns the most likely reward""" - return self.sample(state, action)
    - -# Policy Model -
    [docs]class LUPolicyModel(pomdp_py.RandomRollout): - """This is an extremely dumb policy model; To keep consistent - with the framework.""" - def __init__(self): - self._all_actions = {LUAction("move-right"), LUAction("move-left")} - -
    [docs] def probability(self, action, state, normalized=False, **kwargs): - raise NotImplementedError # Never used
    - -
    [docs] def sample(self, state, normalized=False, **kwargs): - return self.get_all_actions().random()
    - -
    [docs] def argmax(self, state, normalized=False, **kwargs): - """Returns the most likely reward""" - raise NotImplementedError
    - -
    [docs] def get_all_actions(self, **kwargs): - return self._all_actions
    - - -
    [docs]class LoadUnloadProblem(pomdp_py.POMDP): - - def __init__(self, init_state, init_belief): - """init_belief is a Distribution.""" - agent = pomdp_py.Agent(init_belief, - LUPolicyModel(), - LUTransitionModel(), - LUObservationModel(), - LURewardModel()) - - env = pomdp_py.Environment(init_state, - LUTransitionModel(), - LURewardModel()) - - super().__init__(agent, env, name="LoadUnloadProblem")
    - -
    [docs]def generate_random_state(): - # Flip a coin to determine if we are loaded - loaded = np.random.rand() > 0.5 - location = np.random.randint(0, LOAD_LOCATION + 1) - if location == 0: - loaded = False - if location == LOAD_LOCATION: - loaded = True - return LUState(location, loaded)
    - -
    [docs]def generate_init_belief(num_particles): - particles = [] - for _ in range(num_particles): - particles.append(generate_random_state()) - - return pomdp_py.Particles(particles)
    - -
    [docs]def test_planner(load_unload_problem, planner, nsteps=3, discount=0.95): - gamma = 1.0 - total_reward = 0 - total_discounted_reward = 0 - - fig = plt.figure() - plt.title("Load/Unload problem (Red = empty, Blue = full)") - plt.xlabel("Position") - - ax = fig.add_subplot(111) - ax.set_xlim(-1, LOAD_LOCATION+1) - ax.set_ylim(0, 2) - x, y = [], [] - scat, = ax.plot(x, y, marker="x", markersize=20, ls=" ", color="black") - - def update(t): - nonlocal gamma, total_reward, total_discounted_reward - print("==== Step %d ====" % (t+1)) - action = planner.plan(load_unload_problem.agent) - - env_reward = load_unload_problem.env.state_transition(action, execute=True) - true_state = copy.deepcopy(load_unload_problem.env.state) - - real_observation = load_unload_problem.env.provide_observation( - load_unload_problem.agent.observation_model, action) - load_unload_problem.agent.update_history(action, real_observation) - planner.update(load_unload_problem.agent, action, real_observation) - total_reward += env_reward - total_discounted_reward += env_reward * gamma - gamma *= discount - print("True state: %s" % true_state) - print("Action: %s" % str(action)) - print("Observation: %s" % str(real_observation)) - print("Reward: %s" % str(env_reward)) - print("Reward (Cumulative): %s" % str(total_reward)) - print("Reward (Cumulative Discounted): %s" % str(total_discounted_reward)) - print("Belief: %s" % str(load_unload_problem.agent.sample_belief())) - if isinstance(planner, pomdp_py.POUCT): - print("__num_sims__: %d" % planner.last_num_sims) - print("__plan_time__: %.5f" % planner.last_planning_time) - if isinstance(planner, pomdp_py.PORollout): - print("__best_reward__: %d" % planner.last_best_reward) - - new_x, new_y = [true_state.x], [1] - scat.set_data(new_x, new_y) - scat.set_color("b" if true_state.loaded else "r") - return scat, - - ani = FuncAnimation(fig, update, frames=nsteps, interval=500) - plt.show()
    - -
    [docs]def main(): - init_state = generate_random_state() - init_belief = generate_init_belief(num_particles=100) - load_unload_problem = LoadUnloadProblem(init_state, init_belief) - - print("** Testing POMCP **") - pomcp = pomdp_py.POMCP(max_depth=100, discount_factor=0.95, - num_sims=100, exploration_const=110, - rollout_policy=load_unload_problem.agent.policy_model) - test_planner(load_unload_problem, pomcp, nsteps=100)
    - -if __name__ == '__main__': - main() -
    - -
    - -
    -
    -
    -
    - - - - - - - \ No newline at end of file diff --git a/docs/html/_modules/pomdp_problems/multi_object_search/agent/agent.html b/docs/html/_modules/pomdp_problems/multi_object_search/agent/agent.html deleted file mode 100644 index 31086c62..00000000 --- a/docs/html/_modules/pomdp_problems/multi_object_search/agent/agent.html +++ /dev/null @@ -1,203 +0,0 @@ - - - - - - - - pomdp_problems.multi_object_search.agent.agent — pomdp_py 1.3.1 documentation - - - - - - - - - - - - - - - - -
    - - -
    -
    - - -
    - -

    Source code for pomdp_problems.multi_object_search.agent.agent

    -# Defines the agent. There's nothing special
    -# about the MOS agent in fact, except that
    -# it uses models defined in ..models, and
    -# makes use of the belief initialization
    -# functions in belief.py
    -import pomdp_py
    -from .belief import *
    -from ..models.transition_model import *
    -from ..models.observation_model import *
    -from ..models.reward_model import *
    -from ..models.policy_model import *
    -
    -
    [docs]class MosAgent(pomdp_py.Agent): - """One agent is one robot.""" - def __init__(self, - robot_id, - init_robot_state, # initial robot state (assuming robot state is observable perfectly) - object_ids, # target object ids - dim, # tuple (w,l) of the width (w) and length (l) of the gridworld search space. - sensor, # Sensor equipped on the robot - sigma=0.01, # parameter for observation model - epsilon=1, # parameter for observation model - belief_rep="histogram", # belief representation, either "histogram" or "particles". - prior={}, # prior belief, as defined in belief.py:initialize_belief - num_particles=100, # used if the belief representation is particles - grid_map=None): # GridMap used to avoid collision with obstacles (None if not provided) - self.robot_id = robot_id - self._object_ids = object_ids - self.sensor = sensor - - # since the robot observes its own pose perfectly, it will have 100% prior - # on this pose. - prior[robot_id] = {init_robot_state.pose: 1.0} - rth = init_robot_state.pose[2] - - # initialize belief - init_belief = initialize_belief(dim, - self.robot_id, - self._object_ids, - prior=prior, - representation=belief_rep, - robot_orientations={self.robot_id:rth}, - num_particles=num_particles) - transition_model = MosTransitionModel(dim, - {self.robot_id: self.sensor}, - self._object_ids) - observation_model = MosObservationModel(dim, - self.sensor, - self._object_ids, - sigma=sigma, - epsilon=epsilon) - reward_model = GoalRewardModel(self._object_ids, robot_id=self.robot_id) - policy_model = PolicyModel(self.robot_id, grid_map=grid_map) - super().__init__(init_belief, policy_model, - transition_model=transition_model, - observation_model=observation_model, - reward_model=reward_model) - -
    [docs] def clear_history(self): - """Custum function; clear history""" - self._history = None
    - -
    - -
    - -
    -
    -
    -
    - - - - - - - \ No newline at end of file diff --git a/docs/html/_modules/pomdp_problems/multi_object_search/env/visual.html b/docs/html/_modules/pomdp_problems/multi_object_search/env/visual.html deleted file mode 100644 index abe47ea3..00000000 --- a/docs/html/_modules/pomdp_problems/multi_object_search/env/visual.html +++ /dev/null @@ -1,458 +0,0 @@ - - - - - - - - pomdp_problems.multi_object_search.env.visual — pomdp_py 1.3.1 documentation - - - - - - - - - - - - - - - - -
    - - -
    -
    - - -
    - -

    Source code for pomdp_problems.multi_object_search.env.visual

    -# Visualization of a MOS instance using pygame
    -#
    -# Note to run this file, you need to run the following
    -# in the parent directory of multi_object_search:
    -#
    -#   python -m multi_object_search.env.visual
    -#
    -
    -import pygame
    -import cv2
    -import math
    -import numpy as np
    -import random
    -import pomdp_py.utils as util
    -from pomdp_problems.multi_object_search.env.env import *
    -from pomdp_problems.multi_object_search.domain.observation import *
    -from pomdp_problems.multi_object_search.domain.action import *
    -from pomdp_problems.multi_object_search.domain.state import *
    -from pomdp_problems.multi_object_search.example_worlds import *
    -
    -# Deterministic way to get object color
    -
    [docs]def object_color(objid, count): - color = [107, 107, 107] - if count % 3 == 0: - color[0] += 100 + (3 * (objid*5 % 11)) - color[0] = max(12, min(222, color[0])) - elif count % 3 == 1: - color[1] += 100 + (3 * (objid*5 % 11)) - color[1] = max(12, min(222, color[1])) - else: - color[2] += 100 + (3 * (objid*5 % 11)) - color[2] = max(12, min(222, color[2])) - return tuple(color)
    - -#### Visualization through pygame #### -
    [docs]class MosViz: - - def __init__(self, env, - res=30, fps=30, controllable=False): - self._env = env - - self._res = res - self._img = self._make_gridworld_image(res) - self._last_observation = {} # map from robot id to MosOOObservation - self._last_viz_observation = {} # map from robot id to MosOOObservation - self._last_action = {} # map from robot id to Action - self._last_belief = {} # map from robot id to OOBelief - - self._controllable = controllable - self._running = False - self._fps = fps - self._playtime = 0.0 - - # Generate some colors, one per target object - colors = {} - for i, objid in enumerate(env.target_objects): - colors[objid] = object_color(objid, i) - self._target_colors = colors - - def _make_gridworld_image(self, r): - # Preparing 2d array - w, l = self._env.width, self._env.length - arr2d = np.full((self._env.width, - self._env.length), 0) # free grids - state = self._env.state - for objid in state.object_states: - pose = state.object_states[objid]["pose"] - if state.object_states[objid].objclass == "robot": - arr2d[pose[0], pose[1]] = 0 # free grid - elif state.object_states[objid].objclass == "obstacle": - arr2d[pose[0], pose[1]] = 1 # obstacle - elif state.object_states[objid].objclass == "target": - arr2d[pose[0], pose[1]] = 2 # target - - # Creating image - img = np.full((w*r,l*r,3), 255, dtype=np.int32) - for x in range(w): - for y in range(l): - if arr2d[x,y] == 0: # free - cv2.rectangle(img, (y*r, x*r), (y*r+r, x*r+r), - (255, 255, 255), -1) - elif arr2d[x,y] == 1: # obstacle - cv2.rectangle(img, (y*r, x*r), (y*r+r, x*r+r), - (40, 31, 3), -1) - elif arr2d[x,y] == 2: # target - cv2.rectangle(img, (y*r, x*r), (y*r+r, x*r+r), - (255, 165, 0), -1) - cv2.rectangle(img, (y*r, x*r), (y*r+r, x*r+r), - (0, 0, 0), 1, 8) - return img - - @property - def img_width(self): - return self._img.shape[0] - - @property - def img_height(self): - return self._img.shape[1] - - @property - def last_observation(self): - return self._last_observation - -
    [docs] def update(self, robot_id, action, observation, viz_observation, belief): - """ - Update the visualization after there is new real action and observation - and updated belief. - - Args: - observation (MosOOObservation): Real observation - viz_observation (MosOOObservation): An observation used to visualize - the sensing region. - """ - self._last_action[robot_id] = action - self._last_observation[robot_id] = observation - self._last_viz_observation[robot_id] = viz_observation - self._last_belief[robot_id] = belief
    - -
    [docs] @staticmethod - def draw_robot(img, x, y, th, size, color=(255,12,12)): - radius = int(round(size / 2)) - cv2.circle(img, (y+radius, x+radius), radius, color, thickness=2) - - endpoint = (y+radius + int(round(radius*math.sin(th))), - x+radius + int(round(radius*math.cos(th)))) - cv2.line(img, (y+radius,x+radius), endpoint, color, 2)
    - -
    [docs] @staticmethod - def draw_observation(img, z, rx, ry, rth, r, size, color=(12,12,255)): - assert type(z) == MosOOObservation, "%s != MosOOObservation" % (str(type(z))) - radius = int(round(r / 2)) - for objid in z.objposes: - if z.for_obj(objid).pose != ObjectObservation.NULL: - lx, ly = z.for_obj(objid).pose - cv2.circle(img, (ly*r+radius, - lx*r+radius), size, color, thickness=-1)
    - -
    [docs] @staticmethod - def draw_belief(img, belief, r, size, target_colors): - """belief (OOBelief)""" - radius = int(round(r / 2)) - - circle_drawn = {} # map from pose to number of times drawn - - for objid in belief.object_beliefs: - if isinstance(belief.object_belief(objid).random(), RobotState): - continue - hist = belief.object_belief(objid).get_histogram() - color = target_colors[objid] - - last_val = -1 - count = 0 - for state in reversed(sorted(hist, key=hist.get)): - if state.objclass == 'target': - if last_val != -1: - color = util.lighter(color, 1-hist[state]/last_val) - if np.mean(np.array(color) / np.array([255, 255, 255])) < 0.99: - tx, ty = state['pose'] - if (tx,ty) not in circle_drawn: - circle_drawn[(tx,ty)] = 0 - circle_drawn[(tx,ty)] += 1 - - cv2.circle(img, (ty*r+radius, - tx*r+radius), size//circle_drawn[(tx,ty)], color, thickness=-1) - last_val = hist[state] - - count +=1 - if last_val <= 0: - break
    - - # PyGame interface functions -
    [docs] def on_init(self): - """pygame init""" - pygame.init() # calls pygame.font.init() - # init main screen and background - self._display_surf = pygame.display.set_mode((self.img_width, - self.img_height), - pygame.HWSURFACE) - self._background = pygame.Surface(self._display_surf.get_size()).convert() - self._clock = pygame.time.Clock() - - # Font - self._myfont = pygame.font.SysFont('Comic Sans MS', 30) - self._running = True
    - -
    [docs] def on_event(self, event): - # TODO: Keyboard control multiple robots - robot_id = list(self._env.robot_ids)[0] # Just pick the first one. - - if event.type == pygame.QUIT: - self._running = False - elif event.type == pygame.KEYDOWN: - u = None # control signal according to motion model - action = None # control input by user - - # odometry model - if event.key == pygame.K_LEFT: - action = MoveLeft - elif event.key == pygame.K_RIGHT: - action = MoveRight - elif event.key == pygame.K_UP: - action = MoveForward - elif event.key == pygame.K_DOWN: - action = MoveBackward - # euclidean axis model - elif event.key == pygame.K_a: - action = MoveWest - elif event.key == pygame.K_d: - action = MoveEast - elif event.key == pygame.K_s: - action = MoveSouth - elif event.key == pygame.K_w: - action = MoveNorth - elif event.key == pygame.K_SPACE: - action = Look - elif event.key == pygame.K_RETURN: - action = Find - - if action is None: - return - - if self._controllable: - if isinstance(action, MotionAction): - reward = self._env.state_transition(action, execute=True, robot_id=robot_id) - z = None - elif isinstance(action, LookAction) or isinstance(action, FindAction): - robot_pose = self._env.state.pose(robot_id) - z = self._env.sensors[robot_id].observe(robot_pose, - self._env.state) - self._last_observation[robot_id] = z - self._last_viz_observation[robot_id] = z - reward = self._env.state_transition(action, execute=True, robot_id=robot_id) - print("robot state: %s" % str(self._env.state.object_states[robot_id])) - print(" action: %s" % str(action.name)) - print(" observation: %s" % str(z)) - print(" reward: %s" % str(reward)) - print("------------") - return action
    - -
    [docs] def on_loop(self): - self._playtime += self._clock.tick(self._fps) / 1000.0
    - -
    [docs] def on_render(self): - # self._display_surf.blit(self._background, (0, 0)) - self.render_env(self._display_surf) - robot_id = list(self._env.robot_ids)[0] # Just pick the first one. - rx, ry, rth = self._env.state.pose(robot_id) - fps_text = "FPS: {0:.2f}".format(self._clock.get_fps()) - last_action = self._last_action.get(robot_id, None) - last_action_str = "no_action" if last_action is None else str(last_action) - pygame.display.set_caption("%s | Robot%d(%.2f,%.2f,%.2f) | %s | %s" % - (last_action_str, robot_id, rx, ry, rth*180/math.pi, - str(self._env.state.object_states[robot_id]["objects_found"]), - fps_text)) - pygame.display.flip()
    - -
    [docs] def on_cleanup(self): - pygame.quit()
    - -
    [docs] def on_execute(self): - if self.on_init() == False: - self._running = False - - while( self._running ): - for event in pygame.event.get(): - self.on_event(event) - self.on_loop() - self.on_render() - self.on_cleanup()
    - -
    [docs] def render_env(self, display_surf): - # draw robot, a circle and a vector - img = np.copy(self._img) - for i, robot_id in enumerate(self._env.robot_ids): - rx, ry, rth = self._env.state.pose(robot_id) - r = self._res # Not radius! - last_observation = self._last_observation.get(robot_id, None) - last_viz_observation = self._last_viz_observation.get(robot_id, None) - last_belief = self._last_belief.get(robot_id, None) - if last_belief is not None: - MosViz.draw_belief(img, last_belief, r, r//3, self._target_colors) - if last_viz_observation is not None: - MosViz.draw_observation(img, last_viz_observation, - rx, ry, rth, r, r//4, color=(200, 200, 12)) - if last_observation is not None: - MosViz.draw_observation(img, last_observation, - rx, ry, rth, r, r//8, color=(20, 20, 180)) - - MosViz.draw_robot(img, rx*r, ry*r, rth, r, color=(12, 255*(0.8*(i+1)), 12)) - pygame.surfarray.blit_array(display_surf, img)
    - -
    [docs]def unittest(): - # If you don't want occlusion, use this: - laserstr = make_laser_sensor(90, (1, 8), 0.5, False) - # If you want occlusion, use this - # (the difference is mainly in angle_increment; this - # is due to the discretization - discretization may - # cause "strange" behavior when checking occlusion - # but the model is actually doing the right thing.) - laserstr_occ = make_laser_sensor(360, (1, 8), 0.5, True) - # Proximity sensor - proxstr = make_proximity_sensor(1.5, False) - proxstr_occ = make_proximity_sensor(1.5, True) - - worldmap, robot = world1 - worldstr = equip_sensors(worldmap, {robot: laserstr}) - - dim, robots, objects, obstacles, sensors = interpret(worldstr) - init_state = MosOOState({**objects, **robots}) - env = MosEnvironment(dim, - init_state, sensors, - obstacles=obstacles) - viz = MosViz(env, controllable=True) - viz.on_execute()
    - -if __name__ == '__main__': - unittest() -
    - -
    - -
    -
    -
    -
    - - - - - - - \ No newline at end of file diff --git a/docs/html/_modules/pomdp_problems/multi_object_search/problem.html b/docs/html/_modules/pomdp_problems/multi_object_search/problem.html deleted file mode 100644 index 0e80716c..00000000 --- a/docs/html/_modules/pomdp_problems/multi_object_search/problem.html +++ /dev/null @@ -1,449 +0,0 @@ - - - - - - - - pomdp_problems.multi_object_search.problem — pomdp_py 1.3.1 documentation - - - - - - - - - - - - - - - - -
    - - -
    -
    - - -
    - -

    Source code for pomdp_problems.multi_object_search.problem

    -"""2D Multi-Object Search (MOS) Task.
    -Uses the domain, models, and agent/environment
    -to actually define the POMDP problem for multi-object search.
    -Then, solve it using POUCT or POMCP."""
    -import pomdp_py
    -from pomdp_problems.multi_object_search.env.env import *
    -from pomdp_problems.multi_object_search.env.visual import *
    -from pomdp_problems.multi_object_search.agent.agent import *
    -from pomdp_problems.multi_object_search.example_worlds import *
    -from pomdp_problems.multi_object_search.domain.observation import *
    -from pomdp_problems.multi_object_search.models.components.grid_map import *
    -import argparse
    -import time
    -import random
    -
    -
    [docs]class MosOOPOMDP(pomdp_py.OOPOMDP): - """ - A MosOOPOMDP is instantiated given a string description - of the search world, sensor descriptions for robots, - and the necessary parameters for the agent's models. - - Note: This is of course a simulation, where you can - generate a world and know where the target objects are - and then construct the Environment object. But in the - real robot scenario, you don't know where the objects - are. In that case, as I have done it in the past, you - could construct an Environment object and give None to - the object poses. - """ - def __init__(self, robot_id, env=None, grid_map=None, - sensors=None, sigma=0.01, epsilon=1, - belief_rep="histogram", prior={}, num_particles=100, - agent_has_map=False): - """ - Args: - robot_id (int or str): the id of the agent that will solve this MosOOPOMDP. - If it is a `str`, it will be interpreted as an integer using `interpret_robot_id` - in env/env.py. - env (MosEnvironment): the environment. - grid_map (str): Search space description. See env/env.py:interpret. An example: - rx... - .x.xT - ..... - Ignored if env is not None - sensors (dict): map from robot character to sensor string. - For example: {'r': 'laser fov=90 min_range=1 max_range=5 - angle_increment=5'} - Ignored if env is not None - agent_has_map (bool): If True, we assume the agent is given the occupancy - grid map of the world. Then, the agent can use this - map to avoid planning invalid actions (bumping into things). - But this map does not help the agent's prior belief directly. - - sigma, epsilon: observation model paramters - belief_rep (str): belief representation. Either histogram or particles. - prior (dict or str): either a dictionary as defined in agent/belief.py - or a string, either "uniform" or "informed". For "uniform", a uniform - prior will be given. For "informed", a perfect prior will be given. - num_particles (int): setting for the particle belief representation - """ - if env is None: - assert grid_map is not None and sensors is not None,\ - "Since env is not provided, you must provide string descriptions"\ - "of the world and sensors." - worldstr = equip_sensors(grid_map, sensors) - dim, robots, objects, obstacles, sensors = interpret(worldstr) - init_state = MosOOState({**objects, **robots}) - env = MosEnvironment(dim, - init_state, sensors, - obstacles=obstacles) - - # construct prior - if type(prior) == str: - if prior == "uniform": - prior = {} - elif prior == "informed": - prior = {} - for objid in env.target_objects: - groundtruth_pose = env.state.pose(objid) - prior[objid] = {groundtruth_pose: 1.0} - - # Potential extension: a multi-agent POMDP. For now, the environment - # can keep track of the states of multiple agents, but a POMDP is still - # only defined over a single agent. Perhaps, MultiAgent is just a kind - # of Agent, which will make the implementation of multi-agent POMDP cleaner. - robot_id = robot_id if type(robot_id) == int else interpret_robot_id(robot_id) - grid_map = GridMap(env.width, env.length, - {objid: env.state.pose(objid) - for objid in env.obstacles}) if agent_has_map else None - agent = MosAgent(robot_id, - env.state.object_states[robot_id], - env.target_objects, - (env.width, env.length), - env.sensors[robot_id], - sigma=sigma, - epsilon=epsilon, - belief_rep=belief_rep, - prior=prior, - num_particles=num_particles, - grid_map=grid_map) - super().__init__(agent, env, - name="MOS(%d,%d,%d)" % (env.width, env.length, len(env.target_objects)))
    - - -### Belief Update ### -
    [docs]def belief_update(agent, real_action, real_observation, next_robot_state, planner): - """Updates the agent's belief; The belief update may happen - through planner update (e.g. when planner is POMCP).""" - # Updates the planner; In case of POMCP, agent's belief is also updated. - planner.update(agent, real_action, real_observation) - - # Update agent's belief, when planner is not POMCP - if not isinstance(planner, pomdp_py.POMCP): - # Update belief for every object - for objid in agent.cur_belief.object_beliefs: - belief_obj = agent.cur_belief.object_belief(objid) - if isinstance(belief_obj, pomdp_py.Histogram): - if objid == agent.robot_id: - # Assuming the agent can observe its own state: - new_belief = pomdp_py.Histogram({next_robot_state: 1.0}) - else: - # This is doing - # B(si') = normalizer * O(oi|si',sr',a) * sum_s T(si'|s,a)*B(si) - # - # Notes: First, objects are static; Second, - # O(oi|s',a) ~= O(oi|si',sr',a) according to the definition - # of the observation model in models/observation.py. Note - # that the exact belief update rule for this OOPOMDP needs to use - # a model like O(oi|si',sr',a) because it's intractable to - # consider s' (that means all combinations of all object - # states must be iterated). Of course, there could be work - # around (out of scope) - Consider a volumetric observaiton, - # instead of the object-pose observation. That means oi is a - # set of pixels (2D) or voxels (3D). Note the real - # observation, oi, is most likely sampled from O(oi|s',a) - # because real world considers the occlusion between objects - # (due to full state s'). The problem is how to compute the - # probability of this oi given s' and a, where it's - # intractable to obtain s'. To this end, we can make a - # simplifying assumption that an object is contained within - # one pixel (or voxel); The pixel (or voxel) is labeled to - # indicate free space or object. The label of each pixel or - # voxel is certainly a result of considering the full state - # s. The occlusion can be handled nicely with the volumetric - # observation definition. Then that assumption can reduce the - # observation model from O(oi|s',a) to O(label_i|s',a) and - # it becomes easy to define O(label_i=i|s',a) and O(label_i=FREE|s',a). - # These ideas are used in my recent 3D object search work. - new_belief = pomdp_py.update_histogram_belief(belief_obj, - real_action, - real_observation.for_obj(objid), - agent.observation_model[objid], - agent.transition_model[objid], - # The agent knows the objects are static. - static_transition=objid != agent.robot_id, - oargs={"next_robot_state": next_robot_state}) - else: - raise ValueError("Unexpected program state."\ - "Are you using the appropriate belief representation?") - - agent.cur_belief.set_object_belief(objid, new_belief)
    - - -### Solve the problem with POUCT/POMCP planner ### -### This is the main online POMDP solver logic ### -
    [docs]def solve(problem, - max_depth=10, # planning horizon - discount_factor=0.99, - planning_time=1., # amount of time (s) to plan each step - exploration_const=1000, # exploration constant - visualize=True, - max_time=120, # maximum amount of time allowed to solve the problem - max_steps=500): # maximum number of planning steps the agent can take. - """ - This function terminates when: - - maximum time (max_time) reached; This time includes planning and updates - - agent has planned `max_steps` number of steps - - agent has taken n FindAction(s) where n = number of target objects. - - Args: - visualize (bool) if True, show the pygame visualization. - """ - - random_objid = random.sample(problem.env.target_objects, 1)[0] - random_object_belief = problem.agent.belief.object_beliefs[random_objid] - if isinstance(random_object_belief, pomdp_py.Histogram): - # Use POUCT - planner = pomdp_py.POUCT(max_depth=max_depth, - discount_factor=discount_factor, - planning_time=planning_time, - exploration_const=exploration_const, - rollout_policy=problem.agent.policy_model) # Random by default - elif isinstance(random_object_belief, pomdp_py.Particles): - # Use POMCP - planner = pomdp_py.POMCP(max_depth=max_depth, - discount_factor=discount_factor, - planning_time=planning_time, - exploration_const=exploration_const, - rollout_policy=problem.agent.policy_model) # Random by default - else: - raise ValueError("Unsupported object belief type %s" % str(type(random_object_belief))) - - robot_id = problem.agent.robot_id - if visualize: - viz = MosViz(problem.env, controllable=False) # controllable=False means no keyboard control. - if viz.on_init() == False: - raise Exception("Environment failed to initialize") - viz.update(robot_id, - None, - None, - None, - problem.agent.cur_belief) - viz.on_render() - - _time_used = 0 - _find_actions_count = 0 - _total_reward = 0 # total, undiscounted reward - for i in range(max_steps): - # Plan action - _start = time.time() - real_action = planner.plan(problem.agent) - _time_used += time.time() - _start - if _time_used > max_time: - break # no more time to update. - - # Execute action - reward = problem.env.state_transition(real_action, execute=True, - robot_id=robot_id) - - # Receive observation - _start = time.time() - real_observation = \ - problem.env.provide_observation(problem.agent.observation_model, real_action) - - # Updates - problem.agent.clear_history() # truncate history - problem.agent.update_history(real_action, real_observation) - belief_update(problem.agent, real_action, real_observation, - problem.env.state.object_states[robot_id], - planner) - _time_used += time.time() - _start - - # Info and render - _total_reward += reward - if isinstance(real_action, FindAction): - _find_actions_count += 1 - print("==== Step %d ====" % (i+1)) - print("Action: %s" % str(real_action)) - print("Observation: %s" % str(real_observation)) - print("Reward: %s" % str(reward)) - print("Reward (Cumulative): %s" % str(_total_reward)) - print("Find Actions Count: %d" % _find_actions_count) - if isinstance(planner, pomdp_py.POUCT): - print("__num_sims__: %d" % planner.last_num_sims) - - if visualize: - # This is used to show the sensing range; Not sampled - # according to observation model. - robot_pose = problem.env.state.object_states[robot_id].pose - viz_observation = MosOOObservation({}) - if isinstance(real_action, LookAction) or isinstance(real_action, FindAction): - viz_observation = \ - problem.env.sensors[robot_id].observe(robot_pose, - problem.env.state) - viz.update(robot_id, - real_action, - real_observation, - viz_observation, - problem.agent.cur_belief) - viz.on_loop() - viz.on_render() - - # Termination check - if set(problem.env.state.object_states[robot_id].objects_found)\ - == problem.env.target_objects: - print("Done!") - break - if _find_actions_count >= len(problem.env.target_objects): - print("FindAction limit reached.") - break - if _time_used > max_time: - print("Maximum time reached.") - break
    - -# Test -
    [docs]def unittest(): - # random world - grid_map, robot_char = random_world(10, 10, 5, 10) - laserstr = make_laser_sensor(90, (1, 4), 0.5, False) - proxstr = make_proximity_sensor(4, False) - problem = MosOOPOMDP(robot_char, # r is the robot character - sigma=0.05, # observation model parameter - epsilon=0.95, # observation model parameter - grid_map=grid_map, - sensors={robot_char: proxstr}, - prior="uniform", - agent_has_map=True) - solve(problem, - max_depth=10, - discount_factor=0.99, - planning_time=1., - exploration_const=1000, - visualize=True, - max_time=120, - max_steps=500)
    - -if __name__ == "__main__": - unittest() -
    - -
    - -
    -
    -
    -
    - - - - - - - \ No newline at end of file diff --git a/docs/html/_modules/pomdp_problems/tag/env/env.html b/docs/html/_modules/pomdp_problems/tag/env/env.html deleted file mode 100644 index f134dab7..00000000 --- a/docs/html/_modules/pomdp_problems/tag/env/env.html +++ /dev/null @@ -1,196 +0,0 @@ - - - - - - - - pomdp_problems.tag.env.env — pomdp_py 1.3.1 documentation - - - - - - - - - - - - - - - - -
    - - -
    -
    - - -
    - -

    Source code for pomdp_problems.tag.env.env

    -import pomdp_py
    -from pomdp_problems.tag.domain.state import *
    -from pomdp_problems.tag.models.transition_model import *
    -from pomdp_problems.tag.models.reward_model import *
    -from pomdp_problems.tag.models.components.motion_policy import *
    -from pomdp_problems.tag.models.components.grid_map import *
    -from pomdp_problems.multi_object_search.env.env import interpret
    -from pomdp_problems.multi_object_search.env.visual import MosViz
    -
    -
    [docs]class TagEnvironment(pomdp_py.Environment): - - def __init__(self, - init_state, - grid_map, - pr_stay=0.2, - small=1, - big=10): - self._grid_map = grid_map - target_motion_policy = TagTargetMotionPolicy(grid_map, - pr_stay) - transition_model = TagTransitionModel(grid_map, target_motion_policy) - reward_model = TagRewardModel(small=small, big=big) - super().__init__(init_state, - transition_model, - reward_model) - - @property - def width(self): - return self._grid_map.width - - @property - def length(self): - return self._grid_map.length - - @property - def grid_map(self): - return self._grid_map - -
    [docs] @classmethod - def from_str(cls, worldstr, **kwargs): - dim, robots, objects, obstacles, _ = interpret(worldstr) - assert len(robots) == 1, "Does not support multiple robots." - robot_position = robots[list(robots.keys())[0]].pose[:2] - targets = [] - obstacle_poses = set({}) - for objid in objects: - if objid not in obstacles: - targets.append(objid) - else: - obstacle_poses.add(objects[objid].pose) - assert len(targets) == 1, "Does not support multiple objects." - target_position = objects[targets[0]].pose - init_state = TagState(robot_position, target_position, False) - grid_map = GridMap(dim[0], dim[1], obstacle_poses) - return TagEnvironment(init_state, grid_map, **kwargs)
    -
    - -
    - -
    -
    -
    -
    - - - - - - - \ No newline at end of file diff --git a/docs/html/_modules/pomdp_problems/tag/env/visual.html b/docs/html/_modules/pomdp_problems/tag/env/visual.html deleted file mode 100644 index a2cabb22..00000000 --- a/docs/html/_modules/pomdp_problems/tag/env/visual.html +++ /dev/null @@ -1,383 +0,0 @@ - - - - - - - - pomdp_problems.tag.env.visual — pomdp_py 1.3.1 documentation - - - - - - - - - - - - - - - - -
    - - -
    -
    - - -
    - -

    Source code for pomdp_problems.tag.env.visual

    -"""Largely based on MosViz, except this is not an OO-POMDP"""
    -import pygame
    -import cv2
    -import math
    -import numpy as np
    -import random
    -import pomdp_py.utils as util
    -from pomdp_problems.tag.env.env import *
    -from pomdp_problems.tag.domain.observation import *
    -from pomdp_problems.tag.domain.action import *
    -from pomdp_problems.tag.domain.state import *
    -from pomdp_problems.tag.example_worlds import *
    -from pomdp_problems.tag.models.observation_model import *
    -
    -#### Visualization through pygame ####
    -
    [docs]class TagViz: - - def __init__(self, env, res=30, fps=30, controllable=False, observation_model=None): - self._env = env - - self._res = res - self._img = self._make_gridworld_image(res) - self._last_observation = None - self._last_action = None - self._last_belief = None - self._observation_model = observation_model - - self._controllable = controllable - self._running = False - self._fps = fps - self._playtime = 0.0 - - self._target_color = (200, 0, 50) - - def _make_gridworld_image(self, r): - # Preparing 2d array - w, l = self._env.width, self._env.length - arr2d = np.full((self._env.width, - self._env.length), 0) # free grids - # Creating image - img = np.full((w*r,l*r,3), 255, dtype=np.int32) - for x in range(w): - for y in range(l): - if (x,y) not in self._env.grid_map.obstacle_poses: - arr2d[x,y] == 0 # free - cv2.rectangle(img, (y*r, x*r), (y*r+r, x*r+r), - (255, 255, 255), -1) - else: - arr2d[x,y] == 1 # obstacle - cv2.rectangle(img, (y*r, x*r), (y*r+r, x*r+r), - (40, 31, 3), -1) - cv2.rectangle(img, (y*r, x*r), (y*r+r, x*r+r), - (0, 0, 0), 1, 8) - return img - - @property - def img_width(self): - return self._img.shape[0] - - @property - def img_height(self): - return self._img.shape[1] - - @property - def last_observation(self): - return self._last_observation - -
    [docs] def update(self, action, observation, belief): - """ - Update the visualization after there is new real action and observation - and updated belief. - """ - self._last_action = action - self._last_observation = observation - self._last_belief = belief
    - -
    [docs] @staticmethod - def draw_robot(img, x, y, th, size, color=(255,12,12)): - radius = int(round(size / 2)) - cv2.circle(img, (y+radius, x+radius), radius, color, thickness=6)
    - # endpoint = (y+radius + int(round(radius*math.sin(th))), - # x+radius + int(round(radius*math.cos(th)))) - # cv2.line(img, (y+radius,x+radius), endpoint, color, 2) - -
    [docs] @staticmethod - def draw_observation(img, z, rx, ry, rth, r, size, color=(12,12,255)): - assert type(z) == TagObservation, "%s != TagObservation" % (str(type(z))) - radius = int(round(r / 2)) - if z.target_position is not None: - lx, ly = z.target_position - cv2.circle(img, (ly*r+radius, - lx*r+radius), size, color, thickness=-1)
    - - - # TODO! Deprecated. -
    [docs] @staticmethod - def draw_belief(img, belief, r, size, target_color): - """belief (OOBelief)""" - radius = int(round(r / 2)) - - circle_drawn = {} # map from pose to number of times drawn - - hist = belief.get_histogram() - color = target_color - - last_val = -1 - count = 0 - for state in reversed(sorted(hist, key=hist.get)): - if last_val != -1: - color = util.lighter(color, 1-hist[state]/last_val) - if np.mean(np.array(color) / np.array([255, 255, 255])) < 0.999: - tx, ty = state.target_position - if (tx,ty) not in circle_drawn: - circle_drawn[(tx,ty)] = 0 - circle_drawn[(tx,ty)] += 1 - - cv2.circle(img, (ty*r+radius, - tx*r+radius), size//circle_drawn[(tx,ty)], color, thickness=-1) - last_val = hist[state] - - count +=1 - if last_val <= 0: - break
    - - # PyGame interface functions -
    [docs] def on_init(self): - """pygame init""" - pygame.init() # calls pygame.font.init() - # init main screen and background - self._display_surf = pygame.display.set_mode((self.img_width, - self.img_height), - pygame.HWSURFACE) - self._background = pygame.Surface(self._display_surf.get_size()).convert() - self._clock = pygame.time.Clock() - - # Font - self._myfont = pygame.font.SysFont('Comic Sans MS', 30) - self._running = True
    - -
    [docs] def on_event(self, event): - if event.type == pygame.QUIT: - self._running = False - # TODO! DEPRECATED! - elif event.type == pygame.KEYDOWN: - u = None # control signal according to motion model - action = None # control input by user - - if event.key == pygame.K_LEFT: - action = MoveWest2D - elif event.key == pygame.K_RIGHT: - action = MoveEast2D - elif event.key == pygame.K_DOWN: - action = MoveSouth2D - elif event.key == pygame.K_UP: - action = MoveNorth2D - elif event.key == pygame.K_SPACE: - action = TagAction() - - if action is None: - return - - if self._controllable: - reward = self._env.state_transition(action, execute=True) - robot_pose = self._env.state.robot_position - z = None - if self._observation_model is not None: - z = self._observation_model.sample(self._env.state, action) - self._last_observation = z - print(" state: %s" % str(self._env.state)) - print(" action: %s" % str(action.name)) - print(" observation: %s" % str(z)) - print(" reward: %s" % str(reward)) - print(" valid motions: %s" % str(self._env.grid_map.valid_motions(self._env.state.robot_position))) - print("------------") - if self._env.state.target_found: - self._running = False - return action
    - -
    [docs] def on_loop(self): - self._playtime += self._clock.tick(self._fps) / 1000.0
    - -
    [docs] def on_render(self): - # self._display_surf.blit(self._background, (0, 0)) - self.render_env(self._display_surf) - rx, ry = self._env.state.robot_position - fps_text = "FPS: {0:.2f}".format(self._clock.get_fps()) - last_action = self._last_action - last_action_str = "no_action" if last_action is None else str(last_action) - pygame.display.set_caption("%s | Robot(%.2f,%.2f,%.2f) | %s | %s" % - (last_action_str, rx, ry, 0, - str(self._env.state.target_found), - fps_text)) - pygame.display.flip()
    - -
    [docs] def on_cleanup(self): - pygame.quit()
    - -
    [docs] def on_execute(self): - if self.on_init() == False: - self._running = False - - while( self._running ): - for event in pygame.event.get(): - self.on_event(event) - self.on_loop() - self.on_render() - self.on_cleanup()
    - -
    [docs] def render_env(self, display_surf): - img = np.copy(self._img) - r = self._res # Not radius! It's resolution. - - # draw target - tx, ty = self._env.state.target_position - cv2.rectangle(img, (ty*r, tx*r), (ty*r+r, tx*r+r), - (255, 165, 0), -1) - - # draw robot - rx, ry = self._env.state.robot_position - r = self._res # Not radius! - # last_observation = self._last_observation.get(robot_id, None) - # last_viz_observation = self._last_viz_observation.get(robot_id, None) - # last_belief = self._last_belief.get(robot_id, None) - if self._last_belief is not None: - TagViz.draw_belief(img, self._last_belief, r, r//3, self._target_color) - if self._last_observation is not None: - TagViz.draw_observation(img, self._last_observation, - rx, ry, 0, r, r//8, color=(20, 20, 180)) - - TagViz.draw_robot(img, rx*r, ry*r, 0, r, color=(200, 12, 150)) - pygame.surfarray.blit_array(display_surf, img)
    - -# TODO! DEPRECATED! -
    [docs]def unittest(): - worldmap, robot = world0 - env = TagEnvironment.from_str(worldmap) - observation_model = TagObservationModel() - viz = TagViz(env, controllable=True, observation_model=observation_model) - viz.on_execute()
    - -if __name__ == '__main__': - unittest() -
    - -
    - -
    -
    -
    -
    - - - - - - - \ No newline at end of file diff --git a/docs/html/_modules/pomdp_problems/tag/experiment.html b/docs/html/_modules/pomdp_problems/tag/experiment.html deleted file mode 100644 index af3a4b83..00000000 --- a/docs/html/_modules/pomdp_problems/tag/experiment.html +++ /dev/null @@ -1,185 +0,0 @@ - - - - - - - - pomdp_problems.tag.experiment — pomdp_py 1.3.1 documentation - - - - - - - - - - - - - - - - -
    - - -
    -
    - - -
    - -

    Source code for pomdp_problems.tag.experiment

    -"""Simple experiment to get mean"""
    -
    -from pomdp_problems.tag.problem import *
    -import numpy as np
    -
    -
    [docs]def trial(worldstr, **kwargs): - grid_map = GridMap.from_str(worldstr) - free_cells = grid_map.free_cells() - init_robot_position = random.sample(free_cells, 1)[0] - init_target_position = random.sample(free_cells, 1)[0] - - problem = TagProblem(init_robot_position, - init_target_position, - grid_map, **kwargs) - discounted_reward = solve(problem, - max_depth=15, - discount_factor=0.95, - planning_time=.7, - exploration_const=10, - visualize=True, - max_time=120, - max_steps=500) - return discounted_reward
    - -
    [docs]def main(): - all_rewards = [] - try: - for i in range(100): - dr = trial(world0[0], - pr_stay=0.5, - small=1, - big=10, - prior="uniform") - all_rewards.append(dr) - finally: - print("All done!") - print("---------") - print("Average discounted reward: %.3f" % (np.mean(all_rewards))) - print("Std.dev discounted reward: %.3f" % (np.std(all_rewards)))
    - -if __name__ == "__main__": - main() - - -
    - -
    - -
    -
    -
    -
    - - - - - - - \ No newline at end of file diff --git a/docs/html/_modules/pomdp_problems/tag/problem.html b/docs/html/_modules/pomdp_problems/tag/problem.html deleted file mode 100644 index 0ee38d07..00000000 --- a/docs/html/_modules/pomdp_problems/tag/problem.html +++ /dev/null @@ -1,312 +0,0 @@ - - - - - - - - pomdp_problems.tag.problem — pomdp_py 1.3.1 documentation - - - - - - - - - - - - - - - - -
    - - -
    -
    - - -
    - -

    Source code for pomdp_problems.tag.problem

    -import pomdp_py
    -import random
    -from pomdp_problems.tag.env.env import *
    -from pomdp_problems.tag.env.visual import *
    -from pomdp_problems.tag.agent.agent import *
    -from pomdp_problems.tag.example_worlds import *
    -import time
    -
    -
    [docs]class TagProblem(pomdp_py.POMDP): - - def __init__(self, - init_robot_position, - init_target_position, - grid_map, - pr_stay=0.2, - small=1, - big=10, - prior="uniform", - belief_type="hist", - num_particles=6): - init_state = TagState(init_robot_position, - init_target_position, - False) - env = TagEnvironment(init_state, - grid_map, - pr_stay=pr_stay, - small=1, - big=10) - if prior == "uniform": - prior = {} - elif prior == "informed": - prior = {init_target_position: 1.0} - else: - raise ValueError("Unrecognized prior type: %s" % prior) - - if belief_type == "particles": - init_belief = initialize_particles_belief(grid_map, init_robot_position, - prior=prior, num_particles=num_particles) - else: - init_belief = initialize_belief(grid_map, init_robot_position, prior=prior) - agent = TagAgent(init_belief, - grid_map, - pr_stay=pr_stay, - small=1, - big=10) - super().__init__(agent, env, - name="TagProblem")
    - - -
    [docs]def solve(problem, - planner_type="pouct", - max_depth=10, # planning horizon - discount_factor=0.99, - planning_time=1., # amount of time (s) to plan each step - exploration_const=1000, # exploration constant - visualize=True, - max_time=120, # maximum amount of time allowed to solve the problem - max_steps=500): # maximum number of planning steps the agent can take. - if planner_type == "pouct": - planner = pomdp_py.POUCT(max_depth=max_depth, - discount_factor=discount_factor, - planning_time=planning_time, - exploration_const=exploration_const, - rollout_policy=problem.agent.policy_model) - else: - planner = pomdp_py.POMCP(max_depth=max_depth, - discount_factor=discount_factor, - planning_time=planning_time, - exploration_const=exploration_const, - rollout_policy=problem.agent.policy_model) - if visualize: - viz = TagViz(problem.env, controllable=False) - if viz.on_init() == False: - raise Exception("Environment failed to initialize") - viz.update(None, - None, - problem.agent.cur_belief) - viz.on_render() - - _discount = 1.0 - _time_used = 0 - _find_actions_count = 0 - _total_reward = 0 # total, undiscounted reward - _total_discounted_reward = 0 - for i in range(max_steps): - # Plan action - _start = time.time() - real_action = planner.plan(problem.agent) - _time_used += time.time() - _start - if _time_used > max_time: - break # no more time to update. - - # Execute action - reward = problem.env.state_transition(real_action, execute=True) - - # Receive observation - _start = time.time() - real_observation = \ - problem.env.provide_observation(problem.agent.observation_model, real_action) - - # Updates - problem.agent.clear_history() # truncate history - problem.agent.update_history(real_action, real_observation) - planner.update(problem.agent, real_action, real_observation) - if planner_type == "pouct": - belief_update(problem.agent, real_action, real_observation) - _time_used += time.time() - _start - - # Info and render - _total_reward += reward - _total_discounted_reward += reward * _discount - _discount = _discount * discount_factor - print("==== Step %d ====" % (i+1)) - print("Action: %s" % str(real_action)) - print("Observation: %s" % str(real_observation)) - print("Reward: %s" % str(reward)) - print("Reward (Cumulative): %s" % str(_total_reward)) - print("Reward (Discounted): %s" % str(_total_discounted_reward)) - print("Find Actions Count: %d" % _find_actions_count) - if isinstance(planner, pomdp_py.POUCT): - print("__num_sims__: %d" % planner.last_num_sims) - - if visualize: - viz.update(real_action, - real_observation, - problem.agent.cur_belief) - viz.on_loop() - viz.on_render() - - # Termination check - if problem.env.state.target_found: - print("Done!") - break - if _time_used > max_time: - print("Maximum time reached.") - break - if _discount*10 < 1e-4: - print("Discount factor already too small") - break - - return _total_discounted_reward
    - - -
    [docs]def main(): - worldstr, robotstr = world0 - grid_map = GridMap.from_str(worldstr) - free_cells = grid_map.free_cells() - init_robot_position = random.sample(free_cells, 1)[0] - init_target_position = random.sample(free_cells, 1)[0] - - problem = TagProblem(init_robot_position, - init_target_position, - grid_map, - pr_stay=0.2, - small=1, - big=10, - prior="uniform", - belief_type="histogram") - solve(problem, - max_depth=15, - discount_factor=0.95, - planning_time=0.8, - exploration_const=20, - visualize=True, - max_time=360, - max_steps=251, - planner_type="pouct")
    - - -if __name__ == "__main__": - main() -
    - -
    - -
    -
    -
    -
    - - - - - - - \ No newline at end of file diff --git a/docs/html/_modules/pomdp_py/algorithms/bsp/blqr.html b/docs/html/_modules/pomdp_py/algorithms/bsp/blqr.html index 93e6356c..8b3c7a63 100644 --- a/docs/html/_modules/pomdp_py/algorithms/bsp/blqr.html +++ b/docs/html/_modules/pomdp_py/algorithms/bsp/blqr.html @@ -1,26 +1,24 @@ - - + - pomdp_py.algorithms.bsp.blqr — pomdp_py 1.3.1 documentation - - - - - - - - - + + pomdp_py.algorithms.bsp.blqr — pomdp_py 1.3.4 documentation + + + + + + + + -
    @@ -29,14 +27,14 @@
    -

    A framework to build and solve POMDP problems (v1.3.1).

    +

    A framework to build and solve POMDP problems (v1.3.4).

    @@ -51,18 +49,16 @@

    Navigation

    -

    Overview

    +

    Overview

    -

    API References

    +

    API References

    @@ -87,12 +83,12 @@

    Related Topics

    Quick search

    - +

    Donate/support

    @@ -126,21 +122,33 @@

    Source code for pomdp_py.algorithms.bsp.blqr

    import numpy as np
     from scipy import optimize
     
    -
    [docs]class BLQR(pomdp_py.Planner): - def __init__(self, - func_sysd, func_obs, jac_sysd, jac_obs, jac_sysd_u, - noise_obs, noise_sysd, - Qlarge, L, Q, R, - planning_horizon=15): - """To initialize the planenr of B-LQR, one needs to supply parameters +
    +[docs] +class BLQR(pomdp_py.Planner): + def __init__( + self, + func_sysd, + func_obs, + jac_sysd, + jac_obs, + jac_sysd_u, + noise_obs, + noise_sysd, + Qlarge, + L, + Q, + R, + planning_horizon=15, + ): + """To initialize the planenr of B-LQR, one needs to supply parameters that describe the underlying linear gaussian system, and also matrices that describe the cost function. Note that math symbols - (e.g. xt, ut) are vectors or matrices represented as np.arrays. + (e.g. xt, ut) are vectors or matrices represented as np.arrays. The B-LQR cost function (Eq.14 in the paper): :math:`J(b_{t:T},u_{t:T}) = \bar{m}_T^TQ_{large}\bar{m}_T+\bar{s}_T^T\Lambda\bar{s}_T + \sum_{k=t}^{T-1}\bar{m}_k^TQ\bar{m}_k+\bar{u}_t^TR\bar{u}_t` - + Args: func_sysd (function): f: (xt, ut) -> xt+1 func_obs (function): g: (xt) -> zt @@ -169,7 +177,7 @@

    Source code for pomdp_py.algorithms.bsp.blqr

    self._jac_obs = jac_obs
             self._jac_sysd = jac_sysd_u
             self._noise_obs = noise_obs
    -        self._noise_sysd = noise_sysd        
    +        self._noise_sysd = noise_sysd
             self._Qlarge = Qlarge
             self._L = L  # Lambda
             self._Q = Q
    @@ -178,9 +186,10 @@ 

    Source code for pomdp_py.algorithms.bsp.blqr

    self._dim_state = self._Q.shape[0]
             self._dim_control = self._R.shape[0]
     
    -        
    -
    [docs] def ekf_update_mlo(self, bt, ut): - """ +
    +[docs] + def ekf_update_mlo(self, bt, ut): + """ Performs the ekf belief update assuming maximum likelihood observation. This follows equations 12, 13 in the paper. It's the function :math:`F`. @@ -199,28 +208,31 @@

    Source code for pomdp_py.algorithms.bsp.blqr

                    observation function. This corresponds to Wt in equation 13.
             """
             # TODO: FIX
    -        mt, Cov_t = bt        
    +        mt, Cov_t = bt
             At = self._jac_sysd(mt, ut)
             Ct = self._jac_obs(mt)  # based on maximum likelihood observation
             Wt = self._noise_obs(mt).cov
             Gat = np.dot(np.dot(At, Cov_t), At.transpose())  # Gamma_t = At*Cov_t*At^T
             CGC_W_inv = np.linalg.inv(np.dot(np.dot(Ct, Gat), Ct.transpose()) + Wt)
    -        Cov_next = Gat - np.dot(np.dot(np.dot(np.dot(Gat, Ct.transpose()), CGC_W_inv), Ct), Gat)
    +        Cov_next = Gat - np.dot(
    +            np.dot(np.dot(np.dot(Gat, Ct.transpose()), CGC_W_inv), Ct), Gat
    +        )
             m_next = self._func_sysd(mt, ut) + self._noise_sysd(mt).random()
             return (m_next, Cov_next)
    + def _b_u_seg(self, x, i): - """Returns the elements of x that corresponds to the belief and controls, + """Returns the elements of x that corresponds to the belief and controls, as a tuple (m_i, Covi, u_i)""" d = self._dim_state c = self._dim_control - start = i*(d + (d*d) + c) - end = (i+1)*(d + (d*d) + c) - m_i_end = i*(d + (d*d) + c) + d - Covi_end = i*(d + (d*d) + c) + d + d*d - u_end = i*(d + (d*d) + c) + d + d*d + c + start = i * (d + (d * d) + c) + end = (i + 1) * (d + (d * d) + c) + m_i_end = i * (d + (d * d) + c) + d + Covi_end = i * (d + (d * d) + c) + d + d * d + u_end = i * (d + (d * d) + c) + d + d * d + c return x[start:m_i_end], x[m_i_end:Covi_end], x[Covi_end:u_end] - + def _control_max_constraint(self, x, i, max_val): _, _, u_i = self._b_u_seg(x, i) return max_val - u_i @@ -230,9 +242,9 @@

    Source code for pomdp_py.algorithms.bsp.blqr

    return u_i - min_val
     
         def _mean_final_constraint(self, x, m_des, num_segments):
    -        m_k, _, _ = self._b_u_seg(x, num_segments-1)
    +        m_k, _, _ = self._b_u_seg(x, num_segments - 1)
             return m_k - m_des
    -    
    +
         def _mean_start_constraint(self, x, m_0):
             m_k, _, _ = self._b_u_seg(x, 0)
             return m_k - m_0
    @@ -241,14 +253,18 @@ 

    Source code for pomdp_py.algorithms.bsp.blqr

    m_i, s_i, u_i = self._b_u_seg(x, i)
             Cov_i = s_i.reshape(self._dim_state, self._dim_state).transpose()
             m_ip1, Cov_ip1 = self.integrate_belief_segment((m_i, Cov_i), u_i, num_segments)
    -        s_ip1 = Cov_ip1.transpose().reshape(-1,)
    +        s_ip1 = Cov_ip1.transpose().reshape(
    +            -1,
    +        )
             b_i_vec = np.append(m_i, s_i)
             b_ip1_vec = np.append(m_ip1, s_ip1)
             return b_i_vec - b_ip1_vec
     
    -
    [docs] def integrate_belief_segment(self, b_i, u_i, num_segments): - """This is to represent equation 18. - +
    +[docs] + def integrate_belief_segment(self, b_i, u_i, num_segments): + """This is to represent equation 18. + phi(b_i', u_i') = F(b_i', u_i') + sum F(b_{t+1}, u_i) - F(b_t, u_i) t in seg @@ -257,18 +273,18 @@

    Source code for pomdp_py.algorithms.bsp.blqr

    m_i, Cov_i = b_i
             b_seg = [self.ekf_update_mlo((m_i, Cov_i), u_i)]
             for t in range(1, self._planning_horizon // num_segments):
    -            b_seg.append(self.ekf_update_mlo(b_seg[t-1], u_i))
    +            b_seg.append(self.ekf_update_mlo(b_seg[t - 1], u_i))
             sum_mean = b_seg[0][0]
             sum_Cov = b_seg[0][1]
             for t in range(len(b_seg)):
                 if t + 1 < len(b_seg) - 1:
    -                sum_mean += (b_seg[t+1][0] - b_seg[t][0])
    -                sum_Cov += (b_seg[t+1][1] - b_seg[t][1])
    +                sum_mean += b_seg[t + 1][0] - b_seg[t][0]
    +                sum_Cov += b_seg[t + 1][1] - b_seg[t][1]
             return sum_mean, sum_Cov
    - + def _opt_cost_func_seg(self, x, b_des, u_des, num_segments): - """This will be used as part of the objective function for scipy + """This will be used as part of the objective function for scipy optimizer. Therefore we only take in one input vector, x. We require the structure of x to be: @@ -283,8 +299,10 @@

    Source code for pomdp_py.algorithms.bsp.blqr

    bu_traj.append(((m_i, Cov_i), u_i))
             return self.segmented_cost_function(bu_traj, b_des, u_des, num_segments)
     
    -
    [docs] def segmented_cost_function(self, bu_traj, b_des, u_des, num_segments): - """The cost function in eq 17. +
    +[docs] + def segmented_cost_function(self, bu_traj, b_des, u_des, num_segments): + """The cost function in eq 17. Args: b_des (tuple): The desired belief (mT, CovT). This is needed to compute the cost function. @@ -292,13 +310,17 @@

    Source code for pomdp_py.algorithms.bsp.blqr

                    If this information is not available, pass in an empty list.
             """
             if len(u_des) > 0 and len(u_des) != num_segments:
    -            raise ValueError("The list of desired controls, if provided, must have one control"\
    -                             "per segment")
    +            raise ValueError(
    +                "The list of desired controls, if provided, must have one control"
    +                "per segment"
    +            )
     
             b_T, u_T = bu_traj[-1]
             m_T, Cov_T = b_T
    -        s_T = Cov_T.transpose().reshape(-1,)
    -        
    +        s_T = Cov_T.transpose().reshape(
    +            -1,
    +        )
    +
             sLs = np.dot(np.dot(s_T.transpose(), self._L), s_T)
             Summation = 0
             for i in range(num_segments):
    @@ -310,13 +332,25 @@ 

    Source code for pomdp_py.algorithms.bsp.blqr

    else:
                     u_i_des = np.zeros(self._dim_control)
                 u_i_diff = u_i - u_i_des
    -            Summation += np.dot(np.dot(m_i_diff.transpose(), self._Q), m_i_diff)\
    -                + np.dot(np.dot(u_i_diff.transpose(), self._R), u_i_diff)
    +            Summation += np.dot(
    +                np.dot(m_i_diff.transpose(), self._Q), m_i_diff
    +            ) + np.dot(np.dot(u_i_diff.transpose(), self._R), u_i_diff)
             return sLs + Summation
    - -
    [docs] def create_plan(self, b_0, b_des, u_init, num_segments=5, control_bounds=None, - opt_options={}, opt_callback=None): - """Solves the SQP problem using direct transcription, and produce belief points + + +
    +[docs] + def create_plan( + self, + b_0, + b_des, + u_init, + num_segments=5, + control_bounds=None, + opt_options={}, + opt_callback=None, + ): + """Solves the SQP problem using direct transcription, and produce belief points and controls at segments. Reference: https://docs.scipy.org/doc/scipy/reference/tutorial/optimize.html""" # build initial guess from initial belief and the given trajectory. @@ -324,61 +358,81 @@

    Source code for pomdp_py.algorithms.bsp.blqr

    b_i = b_0
             for i in range(num_segments):
                 m_i, Cov_i = b_i
    -            s_i = Cov_i.transpose().reshape(-1,)
    +            s_i = Cov_i.transpose().reshape(
    +                -1,
    +            )
                 u_i = u_init[i]
                 x_0.extend(m_i)
                 x_0.extend(s_i)
                 x_0.extend(u_i)
                 b_i = self.integrate_belief_segment(b_i, u_i, num_segments)
     
    -        # constraints        
    +        # constraints
             constraints = []
             ## initial belief constraint
    -        cons_start = {'type': 'eq',
    -                      'fun': self._mean_start_constraint,
    -                      'args': [b_0[0]]}
    +        cons_start = {
    +            "type": "eq",
    +            "fun": self._mean_start_constraint,
    +            "args": [b_0[0]],
    +        }
             constraints.append(cons_start)
             ## belief dynamics constraints and control bounds
             for i in range(num_segments):
    -            if i + 1 < num_segments-1:
    -                cons_belief = {'type': 'eq',
    -                               'fun': self._belief_constraint,
    -                               'args': [i, num_segments]}
    +            if i + 1 < num_segments - 1:
    +                cons_belief = {
    +                    "type": "eq",
    +                    "fun": self._belief_constraint,
    +                    "args": [i, num_segments],
    +                }
                     constraints.append(cons_belief)
     
                     # control bounds
                     if control_bounds is not None:
    -                    cons_control_min = {'type': 'ineq',
    -                                        'fun': self._control_min_constraint,
    -                                        'args': [i, control_bounds[0]]}                
    -                    cons_control_max = {'type': 'ineq',
    -                                        'fun': self._control_max_constraint,
    -                                        'args': [i, control_bounds[1]]}
    +                    cons_control_min = {
    +                        "type": "ineq",
    +                        "fun": self._control_min_constraint,
    +                        "args": [i, control_bounds[0]],
    +                    }
    +                    cons_control_max = {
    +                        "type": "ineq",
    +                        "fun": self._control_max_constraint,
    +                        "args": [i, control_bounds[1]],
    +                    }
                         constraints.append(cons_control_min)
                         constraints.append(cons_control_max)
     
             # final belief constraint
    -        cons_final = {'type': 'eq',
    -                      'fun': self._mean_final_constraint,
    -                      'args': [b_des[0], num_segments]}
    +        cons_final = {
    +            "type": "eq",
    +            "fun": self._mean_final_constraint,
    +            "args": [b_des[0], num_segments],
    +        }
             constraints.append(cons_final)
     
    -        opt_res = optimize.minimize(self._opt_cost_func_seg, x_0,
    -                                    method="SLSQP",
    -                                    args=(b_des, u_init, num_segments),
    -                                    constraints=constraints,
    -                                    options=opt_options,
    -                                    callback=opt_callback)
    +        opt_res = optimize.minimize(
    +            self._opt_cost_func_seg,
    +            x_0,
    +            method="SLSQP",
    +            args=(b_des, u_init, num_segments),
    +            constraints=constraints,
    +            options=opt_options,
    +            callback=opt_callback,
    +        )
             return opt_res
    -
    [docs] def interpret_sqp_plan(self, opt_res, num_segments): + +
    +[docs] + def interpret_sqp_plan(self, opt_res, num_segments): x_res = opt_res.x plan = [] for i in range(num_segments): m_i, s_i, u_i = self._b_u_seg(x_res, i) Cov_i = s_i.reshape(self._dim_state, self._dim_state).transpose() plan.append((m_i, Cov_i, u_i)) - return plan
    + return plan
    +
    +
    @@ -388,11 +442,11 @@

    Source code for pomdp_py.algorithms.bsp.blqr

    diff --git a/docs/html/_modules/pomdp_py/algorithms/visual/visual.html b/docs/html/_modules/pomdp_py/algorithms/visual/visual.html deleted file mode 100644 index cbe6b8da..00000000 --- a/docs/html/_modules/pomdp_py/algorithms/visual/visual.html +++ /dev/null @@ -1,275 +0,0 @@ - - - - - - - pomdp_py.algorithms.visual.visual — pomdp_py 1.3.1 documentation - - - - - - - - - - - - - - - - - - -
    - - -
    -
    - - -
    - -

    Source code for pomdp_py.algorithms.visual.visual

    -import networkx as nx
    -from networkx.drawing.nx_agraph import graphviz_layout
    -import matplotlib.pyplot as plt
    -from pomdp_py import QNode, VNode, RootVNode, util
    -
    -# ---- POMCP Visualization ---- #
    -
    -def _build_graph(G, root, parent, conn, depth,
    -                 max_depth=None, visit_threshold=0,
    -                 max_value=None, min_value=None,
    -                 relabel_actions={},
    -                 relabel_observations={}):
    -    if max_depth is not None and depth >= max_depth:
    -        return
    -    G.add_node(root)
    -    if parent is not None:
    -        if isinstance(root, VNode):
    -            if len(relabel_observations) > 0:
    -                conn = relabel_observations[conn]
    -        else:
    -            if len(relabel_actions) > 0:
    -                conn = relabel_actions[conn]
    -        if max_value - min_value > 0.0:
    -            weight = util.remap(root.value,
    -                                min_value, max_value,
    -                                0.1, 3.0)
    -        else:
    -            weight = 0.1
    -        G.add_edge(parent, root, **{"label":conn,
    -                                    "weight": weight})
    -    min_value = float('inf')
    -    max_value = float('-inf')
    -    for c in root.children:
    -        max_value = max(max_value, root[c].value)
    -        min_value = min(min_value, root[c].value)
    -    for c in root.children:
    -        if root[c].num_visits > visit_threshold:
    -            _build_graph(G, root[c], root, c, depth+1,
    -                         max_value=max_value, min_value=min_value,
    -                         max_depth=max_depth, visit_threshold=visit_threshold,
    -                         relabel_actions=relabel_actions, relabel_observations=relabel_observations)
    -
    -def _build_relabel_dict(root, conn, depth, actions, observations, max_depth=None, visit_threshold=0):
    -    """Traverse the tree and collect unique actions and observations,
    -    store them in dictionaries `actions` and `observations`. Requires
    -    all observations and actions to be hashable."""
    -    if max_depth is not None and depth >= max_depth:
    -        return
    -    if conn is not None:
    -        if isinstance(root, VNode):
    -            if conn not in observations:
    -                observations[conn] = "o" + str(len(observations))
    -        else:
    -            if conn not in actions:
    -                actions[conn] = "a" + str(len(actions))
    -    for c in root.children:
    -        if root[c].num_visits > visit_threshold:
    -            _build_relabel_dict(root[c], c,  depth+1, actions, observations, max_depth=max_depth, visit_threshold=visit_threshold)
    -
    -
    [docs]def visualize_pouct_search_tree(root, max_depth=1, - visit_threshold=1, anonymize=False, - anonymize_actions=False, anonymize_observations=False, - output_file=None, use_dot=False, ax=None): - """ - Visualize the given tree up to depth `max_depth`. Display nodes - with number of visits >= `visit_threshold`. - - If anonymize is True, will only display actions as a1,a2,... and observations - as o1,o2,... . - """ - relabel_actions = {} - relabel_observations = {} - if anonymize: - anonymize_actions = True - anonymize_observations = True - if anonymize_actions or anonymize_observations: - _build_relabel_dict(root, None, 0, relabel_actions, relabel_observations, - max_depth=max_depth, visit_threshold=visit_threshold) - - print("---- Action labels ----") - action_map = {relabel_actions[action]:action for action in relabel_actions} - for label in sorted(action_map): - print("%s : %s" % (label, action_map[label])) - print("---- Observation labels ----") - observation_map = {relabel_observations[ob]:ob for ob in relabel_observations} - for label in sorted(observation_map): - print("%s : %s" % (label, observation_map[label])) - - if not anonymize_actions: - relabel_actions = {} - if not anonymize_observations: - relabel_observations = {} - - # Build a networkx graph. - G = nx.DiGraph() - _build_graph(G, root, None, None, 0, max_depth=max_depth, visit_threshold=visit_threshold, - relabel_actions=relabel_actions, relabel_observations=relabel_observations) - if use_dot: - if output_file is None: - raise TypeError("Please provide output .dot file.") - nx.nx_agraph.write_dot(G, output_file) - print("Dot file saved at %s" % output_file) - print("Please run `dot -Tpng %s > %s.png" % (output_file, output_file)) - else: - node_labels = {} - color_map = [] - for node in G.nodes(): - belief_str = "" - if hasattr(node, "belief"): - belief_str = " | %d" % len(node.belief) - if isinstance(node, RootVNode): - color_map.append("cyan") - node_labels[node] = "R(%d | %.2f%s)" % (node.num_visits, node.value, belief_str) - elif isinstance(node, VNode): - color_map.append("yellow") - node_labels[node] = "V(%d | %.2f%s)" % (node.num_visits, node.value, belief_str) - else: - color_map.append("orange") - node_labels[node] = "Q(%d | %.2f)" % (node.num_visits, node.value) - edge_labels = {(edge[0],edge[1]): edge[2]["label"] for edge in G.edges(data=True)} - edge_widths = [edge[2]["weight"] for edge in G.edges(data=True)] - - pos = graphviz_layout(G, prog='dot') - nx.draw_networkx(G, pos, - node_color=color_map, labels=node_labels, - width=edge_widths, - font_size=7, ax=ax) - nx.draw_networkx_edge_labels(G, pos, - edge_labels=edge_labels, ax=ax) - if output_file is None: - plt.show() - else: - plt.savefig(output_file)
    -
    - -
    - -
    -
    -
    -
    - - - - - - - \ No newline at end of file diff --git a/docs/html/_modules/pomdp_problems/light_dark/env/env.html b/docs/html/_modules/pomdp_py/problems/light_dark/env/env.html similarity index 63% rename from docs/html/_modules/pomdp_problems/light_dark/env/env.html rename to docs/html/_modules/pomdp_py/problems/light_dark/env/env.html index d1ad5d1b..563f8e94 100644 --- a/docs/html/_modules/pomdp_problems/light_dark/env/env.html +++ b/docs/html/_modules/pomdp_py/problems/light_dark/env/env.html @@ -1,25 +1,24 @@ - - + - pomdp_problems.light_dark.env.env — pomdp_py 1.3.1 documentation - - - - - - - - - + pomdp_py.problems.light_dark.env.env — pomdp_py 1.3.4 documentation + + + + + + + + - + + + -
    @@ -27,15 +26,15 @@