-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7e25dc8
commit a982dd1
Showing
10 changed files
with
301 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,156 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 1, | ||
"id": "8013f1f2-f771-43b4-ba2a-c584d05d21b2", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"import stormvogel.model\n", | ||
"from stormvogel.layout import Layout\n", | ||
"from stormvogel.show import show" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "dbc502e0-a2f6-49c8-b9b1-638666906e27", | ||
"metadata": {}, | ||
"source": [ | ||
"The scenario is as follows. You are dropped in some city, but you are not sure which city. By walking and seeing landmarks, you learn where you are." | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 2, | ||
"id": "887c917f-6df3-4379-b1e0-9471d76b0180", | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"data": { | ||
"application/vnd.jupyter.widget-view+json": { | ||
"model_id": "76eca30fd0d2467ca33df54cf6c1dbb9", | ||
"version_major": 2, | ||
"version_minor": 0 | ||
}, | ||
"text/plain": [ | ||
"Output()" | ||
] | ||
}, | ||
"metadata": {}, | ||
"output_type": "display_data" | ||
}, | ||
{ | ||
"data": { | ||
"text/html": [ | ||
"<script>fetch('http://127.0.0.1:8890/kWbJuvBmZs/MESSAGE/' + 'test message')</script>" | ||
], | ||
"text/plain": [ | ||
"<IPython.core.display.HTML object>" | ||
] | ||
}, | ||
"metadata": {}, | ||
"output_type": "display_data" | ||
}, | ||
{ | ||
"data": { | ||
"text/html": [ | ||
"<script>fetch('http://127.0.0.1:8890/kWbJuvBmZs/MESSAGE/' + 'test message')</script>" | ||
], | ||
"text/plain": [ | ||
"<IPython.core.display.HTML object>" | ||
] | ||
}, | ||
"metadata": {}, | ||
"output_type": "display_data" | ||
}, | ||
{ | ||
"data": { | ||
"application/vnd.jupyter.widget-view+json": { | ||
"model_id": "5091be68b3b748299cb3b6e3eaf58ff4", | ||
"version_major": 2, | ||
"version_minor": 0 | ||
}, | ||
"text/plain": [ | ||
"Output()" | ||
] | ||
}, | ||
"metadata": {}, | ||
"output_type": "display_data" | ||
}, | ||
{ | ||
"data": { | ||
"application/vnd.jupyter.widget-view+json": { | ||
"model_id": "4619d769b6fa4739aa6bb8400100ff2e", | ||
"version_major": 2, | ||
"version_minor": 0 | ||
}, | ||
"text/plain": [ | ||
"HBox(children=(Output(), Output()))" | ||
] | ||
}, | ||
"metadata": {}, | ||
"output_type": "display_data" | ||
} | ||
], | ||
"source": [ | ||
"pomdp = stormvogel.model.new_pomdp(create_initial_state=False)\n", | ||
"\n", | ||
"nijmegen = pomdp.new_state(\"nijmegen\")\n", | ||
"eindhoven = pomdp.new_state(\"eindhoven\")\n", | ||
"aachen = pomdp.new_state(\"aachen\")\n", | ||
"cities = [nijmegen, eindhoven, aachen]\n", | ||
"\n", | ||
"saw_nijmegen = pomdp.new_state(\"saw nijmegen\")\n", | ||
"saw_eindhoven = pomdp.new_state(\"saw eindhoven\")\n", | ||
"saw_aachen = pomdp.new_state(\"saw aachen\")\n", | ||
"saw_cities = [saw_nijmegen, saw_eindhoven, saw_aachen]\n", | ||
"\n", | ||
"walk = pomdp.new_action(\"walk\")\n", | ||
"stay_put = pomdp.new_action(\"stay put\")\n", | ||
"\n", | ||
"for city, saw_city in zip(cities, saw_cities):\n", | ||
" city.set_transitions([\n", | ||
" (walk, saw_city),\n", | ||
" (stay_put, city)\n", | ||
" ])\n", | ||
" saw_city.set_transitions([(1, city)])\n", | ||
"\n", | ||
"# We add an observation to the saw states.\n", | ||
"for saw_city in saw_cities:\n", | ||
" saw_city.set_observation(saw_city.id)\n", | ||
"\n", | ||
"vis = show(pomdp, show_editor=True)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "b76ee6e4-156e-4a02-81b9-e150f5903df4", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3 (ipykernel)", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.12.3" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 5 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.