-
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
257bb30
commit 62f4d42
Showing
6 changed files
with
128 additions
and
10 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
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,99 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 1, | ||
"id": "a8ddc37c-66d2-43e4-8162-6be19a1d70a1", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"import stormvogel.simulator\n", | ||
"import stormvogel.model\n", | ||
"import examples.monty_hall" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 2, | ||
"id": "eb0fadc0-7bb6-4c1d-ae3e-9e16527726ab", | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"ModelType.MDP with name None\n", | ||
"\n", | ||
"States:\n", | ||
"State 0 with labels ['init'] and features {}\n", | ||
"State 1 with labels ['carchosen'] and features {}\n", | ||
"State 2 with labels ['open'] and features {}\n", | ||
"State 3 with labels ['goatrevealed'] and features {}\n", | ||
"State 4 with labels ['done'] and features {}\n", | ||
"\n", | ||
"Transitions:\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"#we take for example the monty hall mdp model:\n", | ||
"mdp = examples.monty_hall.create_monty_hall_mdp()\n", | ||
"\n", | ||
"#we cam then simulate the model with the simulator to create a partial model:\n", | ||
"partial_model = stormvogel.simulator.simulate(mdp, runs=1, steps=4, seed=123456)\n", | ||
"\n", | ||
"print(partial_model)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 6, | ||
"id": "34d0c293-d090-4e3d-9e80-4351f5fcba62", | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"initial state --(action: empty)--> state: 2 --(action: open2)--> state: 9 --(action: empty)--> state: 20 --(action: stay)--> state: 39\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"#we can also simulate a path:\n", | ||
"path = stormvogel.simulator.simulate_path(mdp, steps=4, seed=123456)\n", | ||
"\n", | ||
"print(path)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "6b03bb18-4c65-4544-9f2b-fd58682a829d", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python (stormvogel)", | ||
"language": "python", | ||
"name": "stormvogel-env" | ||
}, | ||
"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.7" | ||
} | ||
}, | ||
"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